summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
authorJonathan Yap <jhwelch@gmail.com>2018-01-12 09:08:49 -0500
committerJonathan Yap <jhwelch@gmail.com>2018-01-12 09:08:49 -0500
commit1e586749efeeb8c40503330572680a8709ae5487 (patch)
tree5c1ebee5dbdb5004f354b9fb0837d60f6dd3cfcc /indra/newview/llfloaterimcontainer.cpp
parent32f16633c77564d567ed0752e56eb38abb916ccd (diff)
parent1693ccba58eef676df1f91e50627545ac35bb819 (diff)
STORM-2145 Merge up to viewer-release
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 15b67b905d..333765f99f 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -101,7 +101,7 @@ LLFloaterIMContainer::~LLFloaterIMContainer()
gSavedPerAccountSettings.setBOOL("ConversationsMessagePaneCollapsed", mMessagesPane->isCollapsed());
gSavedPerAccountSettings.setBOOL("ConversationsParticipantListCollapsed", !isParticipantListExpanded());
- if (!LLSingleton<LLIMMgr>::destroyed())
+ if (LLIMMgr::instanceExists())
{
LLIMMgr::getInstance()->removeSessionObserver(this);
}
@@ -1150,11 +1150,11 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
}
else if ("block_unblock" == command)
{
- toggleMute(userID, LLMute::flagVoiceChat);
+ LLAvatarActions::toggleMute(userID, LLMute::flagVoiceChat);
}
else if ("mute_unmute" == command)
{
- toggleMute(userID, LLMute::flagTextChat);
+ LLAvatarActions::toggleMute(userID, LLMute::flagTextChat);
}
else if ("selected" == command || "mute_all" == command || "unmute_all" == command)
{
@@ -1505,15 +1505,21 @@ bool LLFloaterIMContainer::checkContextMenuItem(const std::string& item, uuid_ve
bool LLFloaterIMContainer::visibleContextMenuItem(const LLSD& userdata)
{
+ const LLConversationItem *conversation_item = getCurSelectedViewModelItem();
+ if(!conversation_item)
+ {
+ return false;
+ }
+
const std::string& item = userdata.asString();
if ("show_mute" == item)
{
- return !isMuted(getCurSelectedViewModelItem()->getUUID());
+ return !isMuted(conversation_item->getUUID());
}
else if ("show_unmute" == item)
{
- return isMuted(getCurSelectedViewModelItem()->getUUID());
+ return isMuted(conversation_item->getUUID());
}
return true;
@@ -2090,23 +2096,6 @@ void LLFloaterIMContainer::toggleAllowTextChat(const LLUUID& participant_uuid)
}
}
-void LLFloaterIMContainer::toggleMute(const LLUUID& participant_id, U32 flags)
-{
- BOOL is_muted = LLMuteList::getInstance()->isMuted(participant_id, flags);
- std::string name;
- gCacheName->getFullName(participant_id, name);
- LLMute mute(participant_id, name, LLMute::AGENT);
-
- if (!is_muted)
- {
- LLMuteList::getInstance()->add(mute, flags);
- }
- else
- {
- LLMuteList::getInstance()->remove(mute, flags);
- }
-}
-
void LLFloaterIMContainer::openNearbyChat()
{
// If there's only one conversation in the container and that conversation is the nearby chat