CHUI-380: Final commit for this issue. After code review changed some method names to be more accurate. Also using dynamic_cast instead of static_cast for safety.
parent
d7d0416547
commit
5a5df259ff
|
|
@ -166,12 +166,12 @@ void LLKDUMessageWarning::put_text(const kdu_uint16 *s)
|
|||
|
||||
void LLKDUMessageError::put_text(const char *s)
|
||||
{
|
||||
//llinfos << "KDU Error: " << s << llendl;
|
||||
llinfos << "KDU Error: " << s << llendl;
|
||||
}
|
||||
|
||||
void LLKDUMessageError::put_text(const kdu_uint16 *s)
|
||||
{
|
||||
//llinfos << "KDU Error: " << s << llendl;
|
||||
llinfos << "KDU Error: " << s << llendl;
|
||||
}
|
||||
|
||||
void LLKDUMessageError::flush(bool end_of_message)
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver
|
|||
friend class LLUICtrlFactory;
|
||||
public:
|
||||
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
|
||||
/*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
|
||||
/*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
|
||||
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
|
||||
/*virtual*/ void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); }
|
||||
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
// LLIMSessionObserver observe triggers
|
||||
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
/*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};
|
||||
/*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};
|
||||
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
|
||||
/*virtual*/ void sessionRemoved(const LLUUID& session_id);
|
||||
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public:
|
|||
|
||||
// LLIMSessionObserver triggers
|
||||
virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub
|
||||
virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub
|
||||
virtual void sessionRemoved(const LLUUID& session_id){} // Stub
|
||||
virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){}; // Stub
|
||||
virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){}; // Stub
|
||||
|
|
|
|||
|
|
@ -101,9 +101,9 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str
|
|||
addConversationListItem(session_id);
|
||||
}
|
||||
|
||||
void LLIMFloaterContainer::sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
|
||||
void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
|
||||
{
|
||||
doSomething(session_id);
|
||||
setItemSelect(session_id);
|
||||
}
|
||||
|
||||
void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
|
||||
|
|
@ -1064,6 +1064,7 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata)
|
|||
return false;
|
||||
}
|
||||
|
||||
//Will select only the conversation item
|
||||
void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)
|
||||
{
|
||||
LLFolderViewItem* widget = mConversationsWidgets[session_id];
|
||||
|
|
@ -1074,15 +1075,22 @@ void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)
|
|||
}
|
||||
}
|
||||
|
||||
void LLIMFloaterContainer::doSomething(const LLUUID& session_id)
|
||||
//Will select the conversation/participant item
|
||||
void LLIMFloaterContainer::setItemSelect(const LLUUID& session_id)
|
||||
{
|
||||
LLConversationItem* vmi = static_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem());
|
||||
|
||||
if(session_id != vmi->getUUID())
|
||||
if(mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getParentFolder())
|
||||
{
|
||||
mSelectedSession = session_id;
|
||||
LLFolderViewItem* widget = mConversationsWidgets[session_id];
|
||||
(widget->getRoot())->setSelection(widget, FALSE, FALSE);
|
||||
//Retreive the conversation id. When a participant is selected, then have to to get the converation id from the parent.
|
||||
LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem());
|
||||
|
||||
//Will allow selection/highlighting of the conversation/participant
|
||||
if(session_id != vmi->getUUID())
|
||||
{
|
||||
mSelectedSession = session_id;
|
||||
LLFolderViewItem* widget = mConversationsWidgets[session_id];
|
||||
(widget->getRoot())->setSelection(widget, FALSE, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
BOOL select_added_floater,
|
||||
LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
|
||||
void setConvItemSelect(const LLUUID& session_id);
|
||||
void doSomething(const LLUUID& session_id);
|
||||
void setItemSelect(const LLUUID& session_id);
|
||||
/*virtual*/ void tabClose();
|
||||
|
||||
static LLFloater* getCurrentVoiceFloater();
|
||||
|
|
@ -82,7 +82,7 @@ public:
|
|||
|
||||
// LLIMSessionObserver observe triggers
|
||||
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
/*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
/*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id);
|
||||
/*virtual*/ void sessionRemoved(const LLUUID& session_id);
|
||||
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
|
||||
|
|
|
|||
|
|
@ -2650,14 +2650,16 @@ LLUUID LLIMMgr::addSession(
|
|||
}
|
||||
}
|
||||
|
||||
//Notify observers that a session was added
|
||||
if (new_session)
|
||||
{
|
||||
LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice);
|
||||
}
|
||||
//Notifies observers that the session was already added
|
||||
else
|
||||
{
|
||||
std::string session_name = LLIMModel::getInstance()->getName(session_id);
|
||||
LLIMMgr::getInstance()->notifyObserverSessionAlreadyAdded(session_id, session_name, other_participant_id);
|
||||
LLIMMgr::getInstance()->notifyObserverSessionActivated(session_id, session_name, other_participant_id);
|
||||
}
|
||||
|
||||
//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions
|
||||
|
|
@ -2961,11 +2963,11 @@ void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::st
|
|||
}
|
||||
}
|
||||
|
||||
void LLIMMgr::notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
|
||||
void LLIMMgr::notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
|
||||
{
|
||||
for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++)
|
||||
{
|
||||
(*it)->sessionAlreadyAdded(session_id, name, other_participant_id);
|
||||
(*it)->sessionActivated(session_id, name, other_participant_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ class LLIMSessionObserver
|
|||
public:
|
||||
virtual ~LLIMSessionObserver() {}
|
||||
virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;
|
||||
virtual void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;
|
||||
virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;
|
||||
virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) = 0;
|
||||
virtual void sessionRemoved(const LLUUID& session_id) = 0;
|
||||
virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) = 0;
|
||||
|
|
@ -470,7 +470,8 @@ private:
|
|||
static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group);
|
||||
|
||||
void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
void notifyObserverSessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
//Triggers when a session has already been added
|
||||
void notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
void notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id);
|
||||
void notifyObserverSessionRemoved(const LLUUID& session_id);
|
||||
void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ public:
|
|||
|
||||
// LLIMSessionObserver observe triggers
|
||||
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
|
||||
/*virtual*/ void sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
|
||||
/*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
|
||||
/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
|
||||
/*virtual*/ void sessionRemoved(const LLUUID& session_id);
|
||||
/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue