summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 9e3bc76c9c..cb67fd34e5 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -725,6 +725,8 @@ void LLIMMgr::addMessage(
dialog,
FALSE);
+ notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id);
+
// When we get a new IM, and if you are a god, display a bit
// of information about the source. This is to help liaisons
// when answering questions.
@@ -897,6 +899,7 @@ LLUUID LLIMMgr::addSession(
}
//mTabContainer->selectTabPanel(panel);
floater->setInputFocus(TRUE);
+ notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id);
return floater->getSessionID();
}
@@ -947,6 +950,7 @@ LLUUID LLIMMgr::addSession(
}
//mTabContainer->selectTabPanel(panel);
floater->setInputFocus(TRUE);
+ notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id);
return floater->getSessionID();
}
@@ -964,6 +968,7 @@ void LLIMMgr::removeSession(const LLUUID& session_id)
clearPendingInvitation(session_id);
clearPendingAgentListUpdates(session_id);
}
+ notifyObserverSessionRemoved(session_id);
}
void LLIMMgr::inviteToSession(
@@ -1238,6 +1243,32 @@ void LLIMMgr::clearPendingAgentListUpdates(const LLUUID& session_id)
}
}
+void LLIMMgr::notifyObserverSessionAdded(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)->sessionAdded(session_id, name, other_participant_id);
+ }
+}
+
+void LLIMMgr::notifyObserverSessionRemoved(const LLUUID& session_id)
+{
+ for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++)
+ {
+ (*it)->sessionRemoved(session_id);
+ }
+}
+
+void LLIMMgr::addSessionObserver(LLIMSessionObserver *observer)
+{
+ mSessionObservers.push_back(observer);
+}
+
+void LLIMMgr::removeSessionObserver(LLIMSessionObserver *observer)
+{
+ mSessionObservers.remove(observer);
+}
+
// create a floater and update internal representation for
// consistency. Returns the pointer, caller (the class instance since
// it is a private method) is not responsible for deleting the