diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-01-11 03:24:36 +0200 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-01-11 03:24:36 +0200 |
commit | 29cb3a4a93543c41b23ba429c4d04189c24d30fc (patch) | |
tree | 7f13fb19fa83beb23a74a48df3de4bfba268824d /indra/llui | |
parent | 28c705fd1cc704ebff91339f87671337bd8987b9 (diff) |
MAINT-6018 Open URL dialog spam
Added the ability to close all notifications from one owner at once
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llnotifications.cpp | 24 | ||||
-rwxr-xr-x | indra/llui/llnotifications.h | 1 |
2 files changed, 25 insertions, 0 deletions
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<LLNotificationPtr> 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<LLNotificationPtr>::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); |