summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp44
1 files changed, 31 insertions, 13 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index c1daea0aeb..a5b93f3692 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -546,8 +546,10 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
// *TODO: find a way to move this to XML as a default panel or something like that
LLSD name("nearby_chat");
LLFloaterReg::toggleInstanceOrBringToFront(name);
+ setSelectedSession(LLUUID(NULL));
}
openNearbyChat();
+ selectConversationPair(getSelectedSession(), false);
}
nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
@@ -571,7 +573,6 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
// Now, do the normal multifloater show/hide
LLMultiFloater::setVisible(visible);
-
}
void LLFloaterIMContainer::collapseMessagesPane(bool collapse)
@@ -925,7 +926,11 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
}
else if ("block_unblock" == command)
{
- LLAvatarActions::toggleBlock(userID);
+ toggleMute(userID, LLMute::flagVoiceChat);
+ }
+ else if ("mute_unmute" == command)
+ {
+ toggleMute(userID, LLMute::flagTextChat);
}
else if ("selected" == command || "mute_all" == command || "unmute_all" == command)
{
@@ -1143,8 +1148,12 @@ bool LLFloaterIMContainer::checkContextMenuItem(const std::string& item, uuid_ve
{
if ("is_blocked" == item)
{
- return LLAvatarActions::isBlocked(uuids.front());
+ return LLMuteList::getInstance()->isMuted(uuids.front(), LLMute::flagVoiceChat);
}
+ else if (item == "is_muted")
+ {
+ return LLMuteList::getInstance()->isMuted(uuids.front(), LLMute::flagTextChat);
+ }
else if ("is_allowed_text_chat" == item)
{
const LLSpeaker * speakerp = getSpeakerOfSelectedParticipant(getSpeakerMgrForSelectedParticipant());
@@ -1590,6 +1599,23 @@ 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
@@ -1599,6 +1625,7 @@ void LLFloaterIMContainer::openNearbyChat()
LLConversationViewSession* nearby_chat = dynamic_cast<LLConversationViewSession*>(get_ptr_in_map(mConversationsWidgets,LLUUID()));
if (nearby_chat)
{
+ selectConversation(LLUUID());
nearby_chat->setOpen(TRUE);
}
}
@@ -1624,22 +1651,13 @@ void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id,
{
//Finds the conversation line item to flash using the session_id
LLConversationViewSession * widget = dynamic_cast<LLConversationViewSession *>(get_ptr_in_map(mConversationsWidgets,session_id));
- LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
if (widget)
{
//Start flash
if (is_flashes)
{
- //Only flash when conversation is not active
- if(session_floater
- && (!session_floater->isInVisibleChain()) //conversation floater not displayed
- ||
- (session_floater->isInVisibleChain() && session_floater->hasFocus() == false)) //conversation floater is displayed but doesn't have focus
-
- {
- widget->getFlashTimer()->startFlashing();
- }
+ widget->getFlashTimer()->startFlashing();
}
//Stop flash
else