summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-02-14 17:28:50 -0800
committerMerov Linden <merov@lindenlab.com>2013-02-14 17:28:50 -0800
commit4aa22db0379ba66017fe551c5466e4c1c6a888cb (patch)
treee302711c1f9e324ddefdc8ea821f4b980f28bf08 /indra/newview/llfloaterimcontainer.cpp
parent96bc3d206d890255300d367a70493f93cd0dc5f8 (diff)
parent638d94eef75799d47f8b913e0909b4079e55c03b (diff)
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index cef45a5b56..4a19440caa 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -68,8 +68,9 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param
mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2));
mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2));
- mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMContainer::checkContextMenuItem, this, _2));
- mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMContainer::enableContextMenuItem, this, _2));
+ mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMContainer::checkContextMenuItem, this, _2));
+ mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMContainer::enableContextMenuItem, this, _2));
+ mEnableCallbackRegistrar.add("Avatar.VisibleItem", boost::bind(&LLFloaterIMContainer::visibleContextMenuItem, this, _2));
mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMContainer::doToSelected, this, _2));
mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&LLFloaterIMContainer::doToSelectedGroup, this, _2));
@@ -259,6 +260,7 @@ void LLFloaterIMContainer::onOpen(const LLSD& key)
{
LLMultiFloater::onOpen(key);
openNearbyChat();
+ reSelectConversation();
assignResizeLimits();
}
@@ -1245,7 +1247,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
{
return LLAvatarActions::canOfferTeleport(uuids);
}
- else if (("can_moderate_voice" == item) || ("can_allow_text_chat" == item) || ("can_mute_unmute" == item))
+ else if (("can_moderate_voice" == item) || ("can_allow_text_chat" == item) || ("can_mute" == item) || ("can_unmute" == item))
{
// *TODO : get that out of here...
return enableModerateContextMenuItem(item);
@@ -1290,6 +1292,22 @@ bool LLFloaterIMContainer::checkContextMenuItem(const std::string& item, uuid_ve
return false;
}
+bool LLFloaterIMContainer::visibleContextMenuItem(const LLSD& userdata)
+{
+ const std::string& item = userdata.asString();
+
+ if ("show_mute" == item)
+ {
+ return !isMuted(getCurSelectedViewModelItem()->getUUID());
+ }
+ else if ("show_unmute" == item)
+ {
+ return isMuted(getCurSelectedViewModelItem()->getUUID());
+ }
+
+ return true;
+}
+
void LLFloaterIMContainer::showConversation(const LLUUID& session_id)
{
setVisibleAndFrontmost(false);
@@ -1327,6 +1345,7 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
if (widget && widget->getParentFolder())
{
widget->getParentFolder()->setSelection(widget, FALSE, FALSE);
+ mConversationsRoot->scrollToShowSelection();
}
//When in DND mode, remove stored IM notifications
@@ -1589,10 +1608,18 @@ bool LLFloaterIMContainer::enableModerateContextMenuItem(const std::string& user
bool voice_channel = speakerp->isInVoiceChannel();
- if ("can_moderate_voice" == userdata || "can_mute_unmute" == userdata)
+ if ("can_moderate_voice" == userdata)
{
return voice_channel;
}
+ else if ("can_mute" == userdata)
+ {
+ return voice_channel && !isMuted(getCurSelectedViewModelItem()->getUUID());
+ }
+ else if ("can_unmute" == userdata)
+ {
+ return voice_channel && isMuted(getCurSelectedViewModelItem()->getUUID());
+ }
// The last invoke is used to check whether the "can_allow_text_chat" will enabled
return LLVoiceClient::getInstance()->isParticipantAvatar(getCurSelectedViewModelItem()->getUUID());