summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-08-16 14:59:29 -0700
committerRichard Nelson <none@none>2010-08-16 14:59:29 -0700
commit94e406157d0b133d51b5dbb95aab296b46eae10e (patch)
tree5b3b7ba6d5abfa6faaffeef56c96d91b57398eee /indra/llui/llnotifications.cpp
parent1fe2cb24f4288840fd682cae8274c193d66a1886 (diff)
added ability to cancel all notifications with a given name
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 7fa3c2cf65..2da8f1eb1b 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1423,6 +1423,21 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
}
+void LLNotifications::cancelByName(const std::string& name)
+{
+ for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(), next_it = it;
+ it != end_it;
+ it = next_it, ++next_it)
+ {
+ LLNotificationPtr pNotif = *it;
+ if (pNotif->getName() == name)
+ {
+ pNotif->cancel();
+ updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
+ }
+ }
+}
+
void LLNotifications::update(const LLNotificationPtr pNotif)
{
LLNotificationSet::iterator it=mItems.find(pNotif);