From 726fd48a3fa04563f7864ed952cb291f6b254c44 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 7 Sep 2014 01:31:45 +0200 Subject: [PATCH] FIRE-2012: Fix the call button in ad-hoc chats the correct way: Call updateCallButton() during sessionInitReplyReceived() for either group and ad-hoc, that will invoked if the session has been initialized --- indra/newview/fsfloaterim.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index c8c16cda75..7303a02c25 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -552,14 +552,11 @@ void FSFloaterIM::updateCallButton() return; } - //bool session_initialized = session->mSessionInitialized; + bool session_initialized = session->mSessionInitialized; bool callback_enabled = session->mCallBackEnabled; - //[Possible FIX-FIRE-2012] GROUP and Ad-Hoc don't have session initialized --> removing that from the condition to enable_connect - //BOOL enable_connect = session_initialized - //&& voice_enabled - //&& callback_enabled; - BOOL enable_connect = voice_enabled + BOOL enable_connect = session_initialized + && voice_enabled && callback_enabled; getChild("call_btn")->setEnabled(enable_connect); @@ -1166,10 +1163,14 @@ void FSFloaterIM::sessionInitReplyReceived(const LLUUID& im_session_id) mControlPanel->setSessionId(im_session_id); } - // updating "Call" button from group control panel here to enable it without placing into draw() (EXT-4796) - if(gAgent.isInGroup(im_session_id)) + // updating "Call" button from group/ad-hoc control panel here to enable it without placing into draw() (EXT-4796) + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(im_session_id); + if (session) { - updateCallButton(); + if ((session->isGroupSessionType() && gAgent.isInGroup(im_session_id)) || session->isAdHocSessionType()) + { + updateCallButton(); + } } //*TODO here we should remove "starting session..." warning message if we added it in postBuild() (IB)