diff options
author | Merov Linden <merov@lindenlab.com> | 2012-07-10 10:59:23 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-07-10 10:59:23 -0700 |
commit | 5db5e86f4192b570b53ed4dfe8187701b47d3142 (patch) | |
tree | a4a154dfde271f0e74e646d9353722af462e2c82 | |
parent | 550c6e369474a68bf43af039cd522165eaac1512 (diff) | |
parent | b203fe12f8ea19ee80d9de1ac6ff4ebbc3bdb493 (diff) |
Pull from richard/viewer-chui
-rw-r--r-- | indra/newview/llimfloater.cpp | 57 | ||||
-rw-r--r-- | indra/newview/llimfloater.h | 2 |
2 files changed, 33 insertions, 26 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index a506f0f9f3..23c97c5345 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -118,6 +118,35 @@ void LLIMFloater::refresh() } } +// virtual +void LLIMFloater::onClickCloseBtn() +{ + 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; + } + + LLIMConversation::onClickCloseBtn(); +} + /* static */ void LLIMFloater::newIMCallback(const LLSD& data) { @@ -407,8 +436,7 @@ void LLIMFloater::addSessionParticipants(const uuid_vec_t& uuids) bool is_voice_call = voice_channel != NULL && voice_channel->isActive(); // then we can close the current session - gIMMgr->leaveSession(mSessionID); - LLIMConversation::onClose(false); + onClose(false); // Start a new ad hoc voice call if we invite new participants to a P2P call, // or start a text chat otherwise. @@ -667,29 +695,6 @@ LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id) void LLIMFloater::onClose(bool 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 @@ -1278,7 +1283,7 @@ void LLIMFloater::confirmLeaveCallCallback(const LLSD& notification, const LLSD& const LLSD& payload = notification["payload"]; LLUUID session_id = payload["session_id"]; - LLFloater* im_floater = LLFloaterReg::findInstance("impanel", session_id); + LLFloater* im_floater = findInstance(session_id); if (option == 0 && im_floater != NULL) { im_floater->closeFloater(); diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 2e8fc84746..2ac11ded20 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -132,6 +132,8 @@ private: /*virtual*/ void refresh(); + /*virtual*/ void onClickCloseBtn(); + // Update the window title, input field help text, etc. void updateSessionName(const std::string& ui_title, const std::string& ui_label); |