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; }
void UpdateItem::doit(void) const { LLNotifications::getInstance()->updateItem(LLSD().with("sigtype", sigtype).with("id", pNotif->id()), pNotif); if (!strcmp(sigtype, "delete")) { pNotif->cancel(); } }
void LLNotifications::cancel(LLNotificationPtr pNotif) { LLNotificationSet::iterator it=mItems.find(pNotif); if (it == mItems.end()) { llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl; } updateItem(LLSD().insert("sigtype", "delete").insert("id", pNotif->id()), pNotif); pNotif->cancel(); }