diff options
author | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-06-25 23:55:25 +0300 |
---|---|---|
committer | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-06-25 23:55:25 +0300 |
commit | 9353a9e6ef071bd980c319d038b1dedb649d2db0 (patch) | |
tree | 8c154015032a0bdfb5a4661167c3e7dedd53e80e /indra | |
parent | 94e6e4bd3d8260894a3d76e5101858cd1582be59 (diff) |
CHUI-167 FIXED Move onClose() from LLIMFloater to it's basic class (LLIMConversation) for correct using add/remove conversation list items also for LLNearbyChat
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llimconversation.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llimconversation.h | 1 | ||||
-rw-r--r-- | indra/newview/llimfloater.cpp | 84 |
3 files changed, 54 insertions, 45 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index cbebf3edd3..f304997abf 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -339,6 +339,20 @@ void LLIMConversation::onOpen(const LLSD& key) updateHeaderAndToolbar(); } +// virtual +void LLIMConversation::onClose(bool app_quitting) +{ + // Always suppress the IM from the conversations list on close if present for any reason + if (LLIMConversation::isChatMultiTab()) + { + LLIMFloaterContainer* im_box = LLIMFloaterContainer::findInstance(); + if (im_box) + { + im_box->removeConversationListItem(mSessionID); + } + } +} + void LLIMConversation::onTearOffClicked() { onClickTearOff(this); diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h index f4b8a38242..47c98d6f8b 100644 --- a/indra/newview/llimconversation.h +++ b/indra/newview/llimconversation.h @@ -63,6 +63,7 @@ public: // LLFloater overrides /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); /*virtual*/ BOOL postBuild(); protected: diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 98ebc82f99..37ee7b8a7c 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -105,51 +105,6 @@ void LLIMFloater::onFocusReceived() } } -// virtual -void LLIMFloater::onClose(bool app_quitting) -{ - // Always suppress the IM from the conversations list on close if present for any reason - if (LLIMConversation::isChatMultiTab()) - { - LLIMFloaterContainer* im_box = LLIMFloaterContainer::findInstance(); - if (im_box) - { - im_box->removeConversationListItem(mSessionID); - } - } - - LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( - mSessionID); - - if (session == NULL) - { - llwarns << "Empty session." << llendl; - return; - } - - bool is_call_with_chat = session->isGroupSessionType() - || session->isAdHocSessionType() || session->isP2PSessionType(); - - LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); - - if (is_call_with_chat && voice_channel != NULL - && voice_channel->isActive()) - { - LLSD payload; - payload["session_id"] = mSessionID; - LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload, confirmLeaveCallCallback); - return; - } - - setTyping(false); - - // The source of much argument and design thrashing - // Should the window hide or the session close when the X is clicked? - // - // Last change: - // EXT-3516 X Button should end IM session, _ button should hide - gIMMgr->leaveSession(mSessionID); -} /* static */ void LLIMFloater::newIMCallback(const LLSD& data) @@ -611,6 +566,45 @@ LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id) return conversation; } +void LLIMFloater::onClose(bool app_quitting) +{ + LLIMConversation::onClose(app_quitting); + + + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( + mSessionID); + + if (session == NULL) + { + llwarns << "Empty session." << llendl; + return; + } + + bool is_call_with_chat = session->isGroupSessionType() + || session->isAdHocSessionType() || session->isP2PSessionType(); + + LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); + + if (is_call_with_chat && voice_channel != NULL + && voice_channel->isActive()) + { + LLSD payload; + payload["session_id"] = mSessionID; + LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload, confirmLeaveCallCallback); + return; + } + + setTyping(false); + + // The source of much argument and design thrashing + // Should the window hide or the session close when the X is clicked? + // + // Last change: + // EXT-3516 X Button should end IM session, _ button should hide + gIMMgr->leaveSession(mSessionID); + +} + void LLIMFloater::setDocked(bool docked, bool pop_on_undock) { // update notification channel state |