From cc107c55cd977487a1f32041713d7482df372354 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 9 Jun 2013 11:32:51 -0400 Subject: [PATCH] [Voice Update] Fix the current voice chat button If the current voice chat's floater is undocked, grab it by session id so that it's not labeled blank When the button is clicked, open the current voice chat floater, not the communications floater, this is the intended action.. how it should have acted in the first place. --- indra/newview/llvoiceremotectrl.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoiceremotectrl.cpp b/indra/newview/llvoiceremotectrl.cpp index 9f7cb768a..1863020f9 100644 --- a/indra/newview/llvoiceremotectrl.cpp +++ b/indra/newview/llvoiceremotectrl.cpp @@ -158,13 +158,17 @@ void LLVoiceRemoteCtrl::draw() } LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater(); + LLVoiceChannel* current_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (!voice_floater) // Maybe it's undocked + { + voice_floater = gIMMgr->findFloaterBySession(current_channel->getSessionID()); + } std::string active_channel_name; if (voice_floater) { active_channel_name = voice_floater->getShortTitle(); } - LLVoiceChannel* current_channel = LLVoiceChannel::getCurrentVoiceChannel(); if (LLButton* end_call_btn = findChild("end_call_btn")) end_call_btn->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && current_channel @@ -290,5 +294,16 @@ void LLVoiceRemoteCtrl::onClickSpeakers() //static void LLVoiceRemoteCtrl::onClickVoiceChannel() { - LLFloaterChatterBox::showInstance(); + if (LLFloater* floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater()) + { + if (LLMultiFloater* mf = floater->getHost()) // Docked + mf->showFloater(floater); + else // Probably only local chat + floater->open(); + } + else if (LLVoiceChannel* chan = LLVoiceChannel::getCurrentVoiceChannel()) // Detached chat floater + { + if (LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(chan->getSessionID())) + floater->open(); + } }