CHUI-577 FIXED "Mute text" and "Block voice" items are added to context menu instead of "Block\unblock"

meow-7.2.2
maxim@mnikolenko 2012-12-05 20:03:15 +02:00
parent fe09598fbe
commit e0b1b063c1
4 changed files with 38 additions and 4 deletions

View File

@ -115,6 +115,7 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items)
items.push_back(std::string("share"));
items.push_back(std::string("pay"));
items.push_back(std::string("block_unblock"));
items.push_back(std::string("MuteText"));
if(this->getType() != CONV_SESSION_1_ON_1)
{

View File

@ -926,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)
{
@ -1144,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());
@ -1591,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

View File

@ -150,6 +150,7 @@ private:
void moderateVoiceAllParticipants(bool unmute);
void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute);
void toggleAllowTextChat(const LLUUID& participant_uuid);
void toggleMute(const LLUUID& participant_id, U32 flags);
void openNearbyChat();
LLButton* mExpandCollapseBtn;

View File

@ -105,14 +105,21 @@
<on_enable function="Avatar.EnableItem" parameter="can_pay" />
</menu_item_call>
<menu_item_check
label="Block / unblock"
label="Block Voice"
layout="topleft"
name="block_unblock">
<on_click function="Avatar.DoToSelected" parameter="block_unblock" />
<on_check function="Avatar.CheckItem" parameter="is_blocked" />
<on_enable function="Avatar.EnableItem" parameter="can_block" />
</menu_item_check>
<menu_item_call
<menu_item_check
label="Block Text"
layout="topleft"
name="MuteText">
<on_click function="Avatar.DoToSelected" parameter="mute_unmute"/>
<on_check function="Avatar.CheckItem" parameter="is_muted" />
<on_enable function="Avatar.EnableItem" parameter="can_block" />
<menu_item_call
label="Group Profile"
layout="topleft"
name="group_profile">