From 1241558dbf7e21a39487c16f940aed1db689ef84 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 20 Apr 2016 19:40:19 +0300 Subject: MAINT-2129 "Block" button doesn't become disabled in remote object inspector after object has been added to block list --- indra/newview/llchathistory.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 4b426081d0..9564951986 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -169,6 +169,16 @@ public: } + bool onObjectIconContextMenuItemEnabled(const LLSD& userdata) + { + std::string level = userdata.asString(); + if (level == "is_blocked") + { + return !LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat); + } + return false; + } + void onAvatarIconContextMenuItemClicked(const LLSD& userdata) { std::string level = userdata.asString(); @@ -275,6 +285,7 @@ public: registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2)); registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); + registrar_enable.add("ObjectIcon.Enable", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemEnabled, this, _2)); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandleAvatar = menu->getHandle(); -- cgit v1.2.3 From efa716b5fcaa0f0faa4003e072747898a223e983 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 18 May 2016 19:29:31 +0300 Subject: MAINT-2129 "Block" button doesn't become disabled --- indra/newview/llchathistory.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 9564951986..5d2997688f 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -156,6 +156,10 @@ public: LLFloaterSidePanelContainer::showPanel("people", "panel_people", LLSD().with("people_panel_tab_name", "blocked_panel").with("blocked_to_select", getAvatarId())); } + else if (level == "unblock") + { + LLMuteList::getInstance()->remove(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); + } else if (level == "map") { std::string url = "secondlife://" + mObjectData["slurl"].asString(); @@ -169,10 +173,14 @@ public: } - bool onObjectIconContextMenuItemEnabled(const LLSD& userdata) + bool onObjectIconContextMenuItemVisible(const LLSD& userdata) { std::string level = userdata.asString(); if (level == "is_blocked") + { + return LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat); + } + else if (level == "not_blocked") { return !LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat); } @@ -285,7 +293,7 @@ public: registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2)); registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); - registrar_enable.add("ObjectIcon.Enable", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemEnabled, this, _2)); + registrar_enable.add("ObjectIcon.Visible", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2)); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandleAvatar = menu->getHandle(); @@ -730,6 +738,8 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) editor_params.trusted_content = false; mEditor = LLUICtrlFactory::create(editor_params, this); mEditor->setIsFriendCallback(LLAvatarActions::isFriend); + mEditor->setIsObjectBlockedCallback(boost::bind(&LLMuteList::isMuted, LLMuteList::getInstance(), _1, _2, 0)); + } LLSD LLChatHistory::getValue() const -- cgit v1.2.3