From 30446d6afc974ff07bde69b0f969bc5fbd3902ef Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Mon, 11 Jan 2016 03:24:36 +0200 Subject: MAINT-6018 Open URL dialog spam Added the ability to close all notifications from one owner at once --- indra/llui/llnotifications.cpp | 24 ++++++++++++++++++++++ indra/llui/llnotifications.h | 1 + indra/newview/llchiclet.cpp | 4 ++++ indra/newview/llscriptfloater.cpp | 12 +++++++++++ indra/newview/llscriptfloater.h | 5 +++++ .../skins/default/xui/en/menu_script_chiclet.xml | 8 ++++++++ 6 files changed, 54 insertions(+) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7e235997d8..77e7d375c8 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1715,6 +1715,30 @@ void LLNotifications::cancelByName(const std::string& name) } } +void LLNotifications::cancelByOwner(const LLUUID ownerId) +{ + std::vector notifs_to_cancel; + for (LLNotificationSet::iterator it = mItems.begin(), end_it = mItems.end(); + it != end_it; + ++it) + { + LLNotificationPtr pNotif = *it; + if (pNotif && pNotif->getPayload().get("owner_id").asUUID() == ownerId) + { + notifs_to_cancel.push_back(pNotif); + } + } + + for (std::vector::iterator it = notifs_to_cancel.begin(), end_it = notifs_to_cancel.end(); + it != end_it; + ++it) + { + LLNotificationPtr pNotif = *it; + pNotif->cancel(); + updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); + } +} + void LLNotifications::update(const LLNotificationPtr pNotif) { LLNotificationSet::iterator it=mItems.find(pNotif); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 0d673d178b..010e6caba2 100755 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -924,6 +924,7 @@ public: void add(const LLNotificationPtr pNotif); void cancel(LLNotificationPtr pNotif); void cancelByName(const std::string& name); + void cancelByOwner(const LLUUID ownerId); void update(const LLNotificationPtr pNotif); LLNotificationPtr find(LLUUID uuid); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index dedb06c945..ad26bbd491 100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1092,6 +1092,10 @@ void LLScriptChiclet::onMenuItemClicked(const LLSD& user_data) { LLScriptFloaterManager::instance().removeNotification(getSessionId()); } + else if ("end_owner" == action) + { + LLScriptFloaterManager::instance().removeAllNotificationsByOwner(getSessionId()); + } } void LLScriptChiclet::createPopupMenu() diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 1d021ec28f..b5b5bc855d 100755 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -420,6 +420,18 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) toggleScriptFloater(notification_id, set_new_message); } +void LLScriptFloaterManager::removeAllNotificationsByOwner(const LLUUID& notification_id) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notification_id); + if (notification != NULL && !notification->isCancelled()) + { + LLSD payload = notification->getPayload(); + LLUUID owner = payload.get("owner_id").asUUID(); + + LLNotifications::instance().cancelByOwner(owner); + } +} + void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id) { LLNotificationPtr notification = LLNotifications::instance().find(notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 70451194b3..bb35526cf7 100755 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -59,6 +59,11 @@ public: */ void onAddNotification(const LLUUID& notification_id); + /** + * Removes all notifications by owner id. + */ + void removeAllNotificationsByOwner(const LLUUID& notification_id); + /** * Removes notification. */ diff --git a/indra/newview/skins/default/xui/en/menu_script_chiclet.xml b/indra/newview/skins/default/xui/en/menu_script_chiclet.xml index db29d9cebc..ceeef1cd46 100755 --- a/indra/newview/skins/default/xui/en/menu_script_chiclet.xml +++ b/indra/newview/skins/default/xui/en/menu_script_chiclet.xml @@ -16,4 +16,12 @@ function="ScriptChiclet.Action" parameter="end" /> + + + -- cgit v1.2.3 From f6d995b0a2a1eff20a1d0c00ed905354ec440cec Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Mon, 11 Jan 2016 03:35:24 +0200 Subject: MAINT-6018 Open URL dialog spam Remove notifications of muted agents --- indra/newview/llmutelist.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index d79baf90e7..3f4f2446e8 100755 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -315,6 +315,11 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) { LLPipeline::removeMutedAVsLights(avatarp); } + //remove agent's notifications as well + if (localmute.mType == LLMute::AGENT) + { + LLNotifications::instance().cancelByOwner(localmute.mID); + } return TRUE; } } -- cgit v1.2.3 From 61f3a060031d840329328fdb5bae3fc90cbdcc93 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 12 Jan 2016 21:08:27 +0200 Subject: MAINT-6018 Open URL dialog spam Removed "close by owner" item form chiclet's right-click menu --- indra/newview/llchiclet.cpp | 4 ---- indra/newview/llscriptfloater.cpp | 12 ------------ indra/newview/llscriptfloater.h | 5 ----- indra/newview/skins/default/xui/en/menu_script_chiclet.xml | 8 -------- 4 files changed, 29 deletions(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index ad26bbd491..dedb06c945 100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1092,10 +1092,6 @@ void LLScriptChiclet::onMenuItemClicked(const LLSD& user_data) { LLScriptFloaterManager::instance().removeNotification(getSessionId()); } - else if ("end_owner" == action) - { - LLScriptFloaterManager::instance().removeAllNotificationsByOwner(getSessionId()); - } } void LLScriptChiclet::createPopupMenu() diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index b5b5bc855d..1d021ec28f 100755 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -420,18 +420,6 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) toggleScriptFloater(notification_id, set_new_message); } -void LLScriptFloaterManager::removeAllNotificationsByOwner(const LLUUID& notification_id) -{ - LLNotificationPtr notification = LLNotifications::instance().find(notification_id); - if (notification != NULL && !notification->isCancelled()) - { - LLSD payload = notification->getPayload(); - LLUUID owner = payload.get("owner_id").asUUID(); - - LLNotifications::instance().cancelByOwner(owner); - } -} - void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id) { LLNotificationPtr notification = LLNotifications::instance().find(notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index bb35526cf7..70451194b3 100755 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -59,11 +59,6 @@ public: */ void onAddNotification(const LLUUID& notification_id); - /** - * Removes all notifications by owner id. - */ - void removeAllNotificationsByOwner(const LLUUID& notification_id); - /** * Removes notification. */ diff --git a/indra/newview/skins/default/xui/en/menu_script_chiclet.xml b/indra/newview/skins/default/xui/en/menu_script_chiclet.xml index ceeef1cd46..db29d9cebc 100755 --- a/indra/newview/skins/default/xui/en/menu_script_chiclet.xml +++ b/indra/newview/skins/default/xui/en/menu_script_chiclet.xml @@ -16,12 +16,4 @@ function="ScriptChiclet.Action" parameter="end" /> - - - -- cgit v1.2.3