From f49d47b3041c6b36b36a23b67eec609e95494acc Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 10 Dec 2012 17:22:56 +0200 Subject: CHUI-394 (Group moderation tools missing in right click menus) --- indra/newview/llfloaterimcontainer.cpp | 38 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'indra/newview/llfloaterimcontainer.cpp') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index c36128b0bd..e900f583b3 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -509,6 +509,22 @@ void LLFloaterIMContainer::draw() // still needs the conversation list. Simply collapse the message pane in that case. collapseMessagesPane(true); } + + //Update moderator options visibility + const LLConversationItem *current_session = getCurSelectedViewModelItem(); + if (current_session) + { + LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = current_session->getChildrenBegin(); + LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = current_session->getChildrenEnd(); + while (current_participant_model != end_participant_model) + { + LLConversationItemParticipant* participant_model = dynamic_cast(*current_participant_model); + participant_model->setModeratorOptionsVisible(isGroupModerator() && participant_model->getUUID() != gAgentID); + + current_participant_model++; + } + } + LLFloater::draw(); } @@ -1156,7 +1172,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" == item) || ("can_unmute" == item)) + else if (("can_moderate_voice" == item) || ("can_allow_text_chat" == item) || ("can_mute_unmute" == item)) { // *TODO : get that out of here... return enableModerateContextMenuItem(item); @@ -1246,11 +1262,11 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool } } - // Set the focus on the selected floater - if (!session_floater->hasFocus()) - { - session_floater->setFocus(TRUE); - } + // Set the focus on the selected floater + if (!session_floater->hasFocus()) + { + session_floater->setFocus(TRUE); + } return handled; } @@ -1463,18 +1479,10 @@ bool LLFloaterIMContainer::enableModerateContextMenuItem(const std::string& user bool voice_channel = speakerp->isInVoiceChannel(); - if ("can_moderate_voice" == userdata) + if ("can_moderate_voice" == userdata || "can_mute_unmute" == 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()); -- cgit v1.2.3 From 6b1ab1b81c6b23a1947d0038686e294b6344eddb Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Tue, 11 Dec 2012 15:20:46 +0200 Subject: CHUI-587 FIXED Disable menu item if "KeepConversationLogTranscripts" is false. --- indra/newview/llfloaterimcontainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llfloaterimcontainer.cpp') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index a76714950d..cc053ca658 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1696,6 +1696,11 @@ void LLFloaterIMContainer::updateSpeakBtnState() mSpeakBtn->setEnabled(LLAgent::isActionAllowed("speak")); } +bool LLFloaterIMContainer::isConversationLoggingAllowed() +{ + return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); +} + void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, bool is_flashes) { //Finds the conversation line item to flash using the session_id -- cgit v1.2.3