diff options
-rwxr-xr-x | indra/llui/llnotifications.cpp | 24 | ||||
-rwxr-xr-x | indra/llui/llnotifications.h | 1 | ||||
-rwxr-xr-x | indra/newview/llchiclet.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llmutelist.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/llscriptfloater.cpp | 12 | ||||
-rwxr-xr-x | indra/newview/llscriptfloater.h | 5 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_script_chiclet.xml | 8 |
7 files changed, 59 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); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index dedb06c945..ad26bbd491 100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1092,6 +1092,10 @@ void LLScriptChiclet::onMenuItemClicked(const LLSD& user_data) { LLScriptFloaterManager::instance().removeNotification(getSessionId()); } + else if ("end_owner" == action) + { + LLScriptFloaterManager::instance().removeAllNotificationsByOwner(getSessionId()); + } } void LLScriptChiclet::createPopupMenu() diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index d79baf90e7..3f4f2446e8 100755 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -315,6 +315,11 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) { LLPipeline::removeMutedAVsLights(avatarp); } + //remove agent's notifications as well + if (localmute.mType == LLMute::AGENT) + { + LLNotifications::instance().cancelByOwner(localmute.mID); + } return TRUE; } } diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 1d021ec28f..b5b5bc855d 100755 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -420,6 +420,18 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) toggleScriptFloater(notification_id, set_new_message); } +void LLScriptFloaterManager::removeAllNotificationsByOwner(const LLUUID& notification_id) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notification_id); + if (notification != NULL && !notification->isCancelled()) + { + LLSD payload = notification->getPayload(); + LLUUID owner = payload.get("owner_id").asUUID(); + + LLNotifications::instance().cancelByOwner(owner); + } +} + void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id) { LLNotificationPtr notification = LLNotifications::instance().find(notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 70451194b3..bb35526cf7 100755 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -60,6 +60,11 @@ public: void onAddNotification(const LLUUID& notification_id); /** + * Removes all notifications by owner id. + */ + void removeAllNotificationsByOwner(const LLUUID& notification_id); + + /** * Removes notification. */ void removeNotification(const LLUUID& notification_id); diff --git a/indra/newview/skins/default/xui/en/menu_script_chiclet.xml b/indra/newview/skins/default/xui/en/menu_script_chiclet.xml index db29d9cebc..ceeef1cd46 100755 --- a/indra/newview/skins/default/xui/en/menu_script_chiclet.xml +++ b/indra/newview/skins/default/xui/en/menu_script_chiclet.xml @@ -16,4 +16,12 @@ function="ScriptChiclet.Action" parameter="end" /> </menu_item_call> + <menu_item_call + label="Close by owner" + layout="topleft" + name="CloseByOwner"> + <menu_item_call.on_click + function="ScriptChiclet.Action" + parameter="end_owner" /> + </menu_item_call> </menu> |