diff options
| author | Merov Linden <merov@lindenlab.com> | 2012-10-17 19:33:09 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2012-10-17 19:33:09 -0700 |
| commit | ec9260701feaa9ae1453c57f0f70449bb9b60af2 (patch) | |
| tree | 9a6e74ee503c956dc8f13851f3ff0da712861b08 /indra/newview/llimconversation.cpp | |
| parent | e56145176875a09dc9e1524a47bcc1259582c896 (diff) | |
| parent | 49ad7fd4b57cec635c557070be02556094e90ff6 (diff) | |
Pull merge from richard/viewer-chui
Diffstat (limited to 'indra/newview/llimconversation.cpp')
| -rw-r--r-- | indra/newview/llimconversation.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 2ad7f9b193..bd2a2419a8 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -54,7 +54,6 @@ LLIMConversation::LLIMConversation(const LLSD& session_id) , mInputEditor(NULL) , mInputEditorTopPad(0) , mRefreshTimer(new LLTimer()) - , mHasFocus(false) { mSession = LLIMModel::getInstance()->findIMSession(mSessionID); @@ -216,21 +215,11 @@ void LLIMConversation::onFocusReceived() } LLTransientDockableFloater::onFocusReceived(); - - mHadFocus = mHasFocus; - mHasFocus = true; - - if (! mHadFocus) - { - LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); - container->setConvItemSelect(mSessionID); - } } void LLIMConversation::onFocusLost() { setBackgroundOpaque(false); - mHasFocus = false; LLTransientDockableFloater::onFocusLost(); } @@ -393,7 +382,7 @@ void LLIMConversation::updateHeaderAndToolbar() // prevent start conversation before its container LLIMFloaterContainer::getInstance(); - bool is_torn_off = !getHost(); + bool is_torn_off = checkIfTornOff(); if (!is_torn_off) { hideAllStandardButtons(); @@ -505,16 +494,12 @@ void LLIMConversation::onSlide(LLIMConversation* self) /*virtual*/ void LLIMConversation::onOpen(const LLSD& key) { - LLIMFloaterContainer* host_floater = dynamic_cast<LLIMFloaterContainer*>(getHost()); - bool is_hosted = !!host_floater; - if (is_hosted) + if (!checkIfTornOff()) { + LLIMFloaterContainer* host_floater = dynamic_cast<LLIMFloaterContainer*>(getHost()); // Show the messages pane when opening a floater hosted in the Conversations host_floater->collapseMessagesPane(false); } - - setTornOff(!is_hosted); - updateHeaderAndToolbar(); } // virtual @@ -546,3 +531,16 @@ bool LLIMConversation::isChatMultiTab() // Restart is required in order to change chat window type. return true; } + +bool LLIMConversation::checkIfTornOff() +{ + bool isTorn = !getHost(); + + if (isTorn != isTornOff()) + { + setTornOff(isTorn); + updateHeaderAndToolbar(); + } + + return isTorn; +} |
