bool LLNotifications::failedUniquenessTest(const LLSD& payload) { LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID()); if (!pNotif || !pNotif->hasUniquenessConstraints()) { return false; } // checks against existing unique notifications for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName()); existing_it != mUniqueNotifications.end(); ++existing_it) { LLNotificationPtr existing_notification = existing_it->second; if (pNotif != existing_notification && pNotif->isEquivalentTo(existing_notification)) { // copy notification instance data over to oldest instance // of this unique notification and update it existing_notification->updateFrom(pNotif); // then delete the new one pNotif->cancel(); } } return false; }
bool LLNotifications::uniqueFilter(LLNotificationPtr pNotif) { if (!pNotif->hasUniquenessConstraints()) { return true; } // checks against existing unique notifications for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName()); existing_it != mUniqueNotifications.end(); ++existing_it) { LLNotificationPtr existing_notification = existing_it->second; if (pNotif != existing_notification && pNotif->isEquivalentTo(existing_notification)) { return false; } } return true; }