summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-06-20 17:51:56 +0300
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-06-20 17:51:56 +0300
commitfd247320ceab3ab6dc6abdf17008618cf3f6a8ff (patch)
treeb9546af55f44f16a67ecfcbb19da20fc8927e555 /indra
parent18aabdfd3d2efc1b5507e2fe001cfc36ee84b710 (diff)
CHUI-125 FIXED if a call is accept then open im-session's floater
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llchiclet.h7
-rw-r--r--indra/newview/llchicletbar.cpp19
-rw-r--r--indra/newview/llchicletbar.h7
-rw-r--r--indra/newview/llimfloatercontainer.cpp13
-rw-r--r--indra/newview/llimfloatercontainer.h11
-rw-r--r--indra/newview/llimview.cpp15
-rw-r--r--indra/newview/llimview.h2
-rw-r--r--indra/newview/llsyswellwindow.h1
8 files changed, 59 insertions, 16 deletions
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 3973b6547a..f51d7b622c 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -873,9 +873,10 @@ 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 sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); }
- virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {}
+ /*virtual*/ void sessionAdded(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) {}
~LLIMWellChiclet();
protected:
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index 8701b602ce..66c93bd18b 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -57,19 +57,24 @@ LLChicletBar::LLChicletBar(const LLSD&)
: mChicletPanel(NULL),
mToolbarStack(NULL)
{
- // Firstly add our self to IMSession observers, so we catch session events
- // before chiclets do that.
- LLIMMgr::getInstance()->addSessionObserver(this);
+ // IM floaters are from now managed by LLIMFloaterContainer.
+ // See LLIMFloaterContainer::sessionVoiceOrIMStarted() and CHUI-125
+
+// // Firstly add our self to IMSession observers, so we catch session events
+// // before chiclets do that.
+// LLIMMgr::getInstance()->addSessionObserver(this);
buildFromFile("panel_chiclet_bar.xml");
}
LLChicletBar::~LLChicletBar()
{
- if (!LLSingleton<LLIMMgr>::destroyed())
- {
- LLIMMgr::getInstance()->removeSessionObserver(this);
- }
+ // IM floaters are from now managed by LLIMFloaterContainer.
+ // See LLIMFloaterContainer::sessionVoiceOrIMStarted() and CHUI-125
+// if (!LLSingleton<LLIMMgr>::destroyed())
+// {
+// LLIMMgr::getInstance()->removeSessionObserver(this);
+// }
}
LLIMChiclet* LLChicletBar::createIMChiclet(const LLUUID& session_id)
diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h
index 1427bf95e0..7d0d904810 100644
--- a/indra/newview/llchicletbar.h
+++ b/indra/newview/llchicletbar.h
@@ -50,9 +50,10 @@ public:
LLChicletPanel* getChicletPanel() { return mChicletPanel; }
// LLIMSessionObserver observe triggers
- virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
- virtual void sessionRemoved(const LLUUID& session_id);
- void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
+ /*virtual*/ void sessionAdded(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);
S32 getTotalUnreadIMCount();
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 8493a0e7b8..deeb0e9e0b 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -50,6 +50,9 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
: LLMultiFloater(seed)
,mExpandCollapseBtn(NULL)
{
+ // Firstly add our self to IMSession observers, so we catch session events
+ LLIMMgr::getInstance()->addSessionObserver(this);
+
mAutoResize = FALSE;
LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::IM, this);
}
@@ -61,8 +64,18 @@ LLIMFloaterContainer::~LLIMFloaterContainer()
gSavedPerAccountSettings.setBOOL("ConversationsListPaneCollapsed", mConversationsPane->isCollapsed());
gSavedPerAccountSettings.setBOOL("ConversationsMessagePaneCollapsed", mMessagesPane->isCollapsed());
+
+ if (!LLSingleton<LLIMMgr>::destroyed())
+ {
+ LLIMMgr::getInstance()->removeSessionObserver(this);
+ }
}
+void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
+{
+ LLIMFloater::show(session_id);
+};
+
BOOL LLIMFloaterContainer::postBuild()
{
mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1));
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index b5b60615b3..239d6a08a3 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -30,6 +30,7 @@
#include <map>
#include <vector>
+#include "llimview.h"
#include "llfloater.h"
#include "llmultifloater.h"
#include "llavatarpropertiesprocessor.h"
@@ -117,7 +118,9 @@ private:
};
// CHUI-137 : End
-class LLIMFloaterContainer : public LLMultiFloater
+class LLIMFloaterContainer
+ : public LLMultiFloater
+ , public LLIMSessionObserver
{
public:
LLIMFloaterContainer(const LLSD& seed);
@@ -144,6 +147,12 @@ public:
LLFolderViewItem* createConversationItemWidget(LLConversationItem* item);
+ // LLIMSessionObserver observe triggers
+ /*virtual*/ void sessionAdded(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) {};
+
private:
typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t;
avatarID_panel_map_t mSessions;
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 0d2b1f06b5..4b82596f37 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2582,7 +2582,9 @@ LLUUID LLIMMgr::addSession(
{
LLDynamicArray<LLUUID> ids;
ids.put(other_participant_id);
- return addSession(name, dialog, other_participant_id, ids, voice);
+ LLUUID session_id = addSession(name, dialog, other_participant_id, ids, voice);
+ notifyObserverSessionVoiceOrIMStarted(session_id);
+ return session_id;
}
// Adds a session using the given session_id. If the session already exists
@@ -2609,7 +2611,8 @@ LLUUID LLIMMgr::addSession(
if (floater_id.notNull())
{
- LLIMFloater* im_floater = LLIMFloater::findInstance(floater_id);
+ LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+
if (im_floater && im_floater->getStartConferenceInSameFloater())
{
// The IM floater should be initialized with a new session_id
@@ -2936,6 +2939,14 @@ void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::st
}
}
+void LLIMMgr::notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id)
+{
+ for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++)
+ {
+ (*it)->sessionVoiceOrIMStarted(session_id);
+ }
+}
+
void LLIMMgr::notifyObserverSessionRemoved(const LLUUID& session_id)
{
for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++)
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 58a2ac5162..80bf315aa8 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -298,6 +298,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 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;
};
@@ -462,6 +463,7 @@ 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 notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id);
void notifyObserverSessionRemoved(const LLUUID& session_id);
void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index f497f546aa..8758c8c4e5 100644
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -169,6 +169,7 @@ public:
// LLIMSessionObserver observe triggers
/*virtual*/ void sessionAdded(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);