summaryrefslogtreecommitdiff
path: root/indra/newview/llcallfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r--indra/newview/llcallfloater.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index 7db709086f..d6ae4603b4 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -64,6 +64,7 @@ BOOL LLCallFloater::postBuild()
{
LLDockableFloater::postBuild();
mAvatarList = getChild<LLAvatarList>("speakers_list");
+ childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this));
LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel");
@@ -90,6 +91,14 @@ void LLCallFloater::onOpen(const LLSD& /*key*/)
//////////////////////////////////////////////////////////////////////////
/// PRIVATE SECTION
//////////////////////////////////////////////////////////////////////////
+
+void LLCallFloater::leaveCall()
+{
+ LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
+ if (voice_channel && voice_channel->isActive())
+ voice_channel->deactivate();
+}
+
void LLCallFloater::updateSession()
{
LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
@@ -139,6 +148,11 @@ void LLCallFloater::updateSession()
}
updateTitle();
+
+ //hide "Leave Call" button for nearby chat
+ bool isLocalChat = mVoiceType == VC_LOCAL_CHAT;
+ childSetVisible("leave_btn_panel", !isLocalChat);
+
refreshPartisipantList();
}