From 5609fdbf3d06bcd608a4a30c997d2c0995ee3c76 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 29 Oct 2020 17:46:28 +0100 Subject: [PATCH] FIRE-11339: Persisted group notifications get logged to IM on each login --- indra/llui/llnotifications.cpp | 3 ++- indra/llui/llnotifications.h | 13 +++++++++++++ indra/newview/llnotificationhandlerutil.cpp | 6 ++++++ indra/newview/llpersistentnotificationstorage.cpp | 3 +++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2295ec04b8..d7df19f5cb 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -499,7 +499,8 @@ LLNotification::LLNotification(const LLSDParamAdapter& p) : mResponderObj(NULL), mId(p.id.isProvided() ? p.id : LLUUID::generateNewID()), mOfferFromAgent(p.offer_from_agent), - mIsDND(p.is_dnd) + mIsDND(p.is_dnd), + mIsFromStorage(false)// FIRE-11339: Persisted group notifications get logged to IM on each login { if (p.functor.name.isChosen()) { diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 1d2f3e75ec..3b9f61b345 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -400,6 +400,7 @@ private: LLNotificationResponderPtr mResponder; bool mOfferFromAgent; bool mIsDND; + bool mIsFromStorage; // FIRE-11339: Persisted group notifications get logged to IM on each login // a reference to the template LLNotificationTemplatePtr mTemplatep; @@ -557,6 +558,18 @@ public: mIsDND = flag; } + // FIRE-11339: Persisted group notifications get logged to IM on each login + bool isFromStorage() const + { + return mIsFromStorage; + } + + void setIsFromStorage(bool logged) + { + mIsFromStorage = logged; + } + // + std::string getType() const; std::string getMessage() const; std::string getFooter() const; diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 15f57d98ad..4b231ca72b 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -204,6 +204,12 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi void LLHandlerUtil::logGroupNoticeToIMGroup( const LLNotificationPtr& notification) { + // FIRE-11339: Persisted group notifications get logged to IM on each login + if (notification->isFromStorage()) + { + return; + } + // const LLSD& payload = notification->getPayload(); LLGroupData groupData; diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 221dfa4244..0020bab035 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -153,6 +153,9 @@ void LLPersistentNotificationStorage::loadNotifications() LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); notification->setResponseFunctor(responder); + // FIRE-11339: Persisted group notifications get logged to IM on each login + notification->setIsFromStorage(true); + instance.add(notification); // hide script floaters so they don't confuse the user and don't overlap startup toast