diff options
Diffstat (limited to 'indra/newview/llfloaterimsessiontab.cpp')
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 3bef74f376..7b1c0ba5d4 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -80,6 +80,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) { setAutoFocus(false); mSession = LLIMModel::getInstance()->findIMSession(mSessionID); + LLIMMgr::instance().addSessionObserver(this); mCommitCallbackRegistrar.add("IMSession.Menu.Action", boost::bind(&LLFloaterIMSessionTab::onIMSessionMenuItemClicked, this, _2)); @@ -102,6 +103,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) LLFloaterIMSessionTab::~LLFloaterIMSessionTab() { delete mRefreshTimer; + LLIMMgr::instance().removeSessionObserver(this); LLFloaterIMContainer* im_container = LLFloaterIMContainer::findInstance(); if (im_container) @@ -440,7 +442,10 @@ void LLFloaterIMSessionTab::enableDisableCallBtn() bool enable = false; - if (mSessionID.notNull() && mSession && mSession->mSessionInitialized && mSession->mCallBackEnabled) + if (mSessionID.notNull() + && mSession + && mSession->mSessionInitialized + && mSession->mCallBackEnabled) { if (mVoiceButtonHangUpMode) { @@ -450,9 +455,10 @@ void LLFloaterIMSessionTab::enableDisableCallBtn() else { // We allow to start call from this state only - if (mSession->mVoiceChannel && - !mSession->mVoiceChannel->callStarted() && - LLVoiceClient::instanceExists()) + if (LLVoiceClient::instanceExists() && + mSession->mVoiceChannel && + !mSession->mVoiceChannel->callStarted() + ) { LLVoiceClient* client = LLVoiceClient::getInstance(); if (client->voiceEnabled() && client->isVoiceWorking()) @@ -1367,6 +1373,14 @@ LLView* LLFloaterIMSessionTab::getChatHistory() return mChatHistory; } +void LLFloaterIMSessionTab::sessionRemoved(const LLUUID& session_id) +{ + if (session_id == mSessionID) + { + mSession = nullptr; + } +} + bool LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask ) { bool handled = false; |