diff options
author | Igor Borovkov <iborovkov@productengine.com> | 2009-12-16 15:30:33 +0200 |
---|---|---|
committer | Igor Borovkov <iborovkov@productengine.com> | 2009-12-16 15:30:33 +0200 |
commit | 9dd2b290318f657b3dca81278f597cc702a6e149 (patch) | |
tree | 12fca0ae49b009cf0532e8fdaa7ffb4dcd9c1742 /indra/newview/llbottomtray.cpp | |
parent | 734f37816ef35089bc0f5710dc1f9684bc5b9b69 (diff) |
fixed EXT-2884 Initiation of a voice call should not bring text chat (p2p, ad-hoc, group)
Added flag to an LLIMSession which indicated whether it has been created for a voice call.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llbottomtray.cpp')
-rw-r--r-- | indra/newview/llbottomtray.cpp | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 8c793873f4..8389895479 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -78,6 +78,9 @@ LLBottomTray::LLBottomTray(const LLSD&) LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraPresets, _2)); LLIMMgr::getInstance()->addSessionObserver(this); + //managing chiclets for voice calls + LLIMModel::getInstance()->addNewMsgCallback(boost::bind(&LLBottomTray::onNewIM, this, _1)); + //this is to fix a crash that occurs because LLBottomTray is a singleton //and thus is deleted at the end of the viewers lifetime, but to be cleanly //destroyed LLBottomTray requires some subsystems that are long gone @@ -143,25 +146,22 @@ LLIMChiclet* LLBottomTray::createIMChiclet(const LLUUID& session_id) //virtual void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - if(getChicletPanel()) - { - if(getChicletPanel()->findChiclet<LLChiclet>(session_id)) - { + if (!getChicletPanel()) return; - } - else - { - LLIMChiclet* chiclet = createIMChiclet(session_id); - if(chiclet) - { - chiclet->setIMSessionName(name); - chiclet->setOtherParticipantId(other_participant_id); - } - else - { - llerrs << "Could not create chiclet" << llendl; - } - } + if (getChicletPanel()->findChiclet<LLChiclet>(session_id)) return; + + // For im sessions started as voice call chiclet gets created on the first incoming message + if (gIMMgr->isVoiceCall(session_id)) return; + + LLIMChiclet* chiclet = createIMChiclet(session_id); + if(chiclet) + { + chiclet->setIMSessionName(name); + chiclet->setOtherParticipantId(other_participant_id); + } + else + { + llerrs << "Could not create chiclet" << llendl; } } @@ -194,6 +194,28 @@ void LLBottomTray::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& } } +void LLBottomTray::onNewIM(const LLSD& data) +{ + LLUUID from_id = data["from_id"]; + if (from_id.isNull() || gAgentID == from_id) return; + + LLUUID session_id = data["session_id"]; + if (session_id.isNull()) return; + + if (!gIMMgr->isVoiceCall(session_id)) return; + + if (getChicletPanel()->findChiclet<LLChiclet>(session_id)) return; + + //first real message, time to create chiclet + LLIMChiclet* chiclet = createIMChiclet(session_id); + if(chiclet) + { + chiclet->setIMSessionName(LLIMModel::getInstance()->getName(session_id)); + chiclet->setOtherParticipantId(LLIMModel::getInstance()->getOtherParticipantID(session_id)); + } +} + + // virtual void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, bool proximal) { |