summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index f66f725070..790be83e74 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -151,6 +151,33 @@ LLScreenChannel::~LLScreenChannel()
}
+std::list<LLToast*> LLScreenChannel::findToasts(const Matcher& matcher)
+{
+ std::list<LLToast*> res;
+
+ // collect stored toasts
+ for (std::vector<ToastElem>::iterator it = mStoredToastList.begin(); it
+ != mStoredToastList.end(); it++)
+ {
+ if (matcher.matches(it->toast->getNotification()))
+ {
+ res.push_back(it->toast);
+ }
+ }
+
+ // collect displayed toasts
+ for (std::vector<ToastElem>::iterator it = mToastList.begin(); it
+ != mToastList.end(); it++)
+ {
+ if (matcher.matches(it->toast->getNotification()))
+ {
+ res.push_back(it->toast);
+ }
+ }
+
+ return res;
+}
+
//--------------------------------------------------------------------------
void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect)
{
@@ -375,6 +402,16 @@ void LLScreenChannel::killToastByNotificationID(LLUUID id)
}
}
+void LLScreenChannel::killMatchedToasts(const Matcher& matcher)
+{
+ std::list<LLToast*> to_delete = findToasts(matcher);
+ for (std::list<LLToast*>::iterator it = to_delete.begin(); it
+ != to_delete.end(); it++)
+ {
+ killToastByNotificationID((*it)-> getNotificationID());
+ }
+}
+
//--------------------------------------------------------------------------
void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
{