diff options
author | Richard Linden <none@none> | 2012-03-30 18:36:43 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2012-03-30 18:36:43 -0700 |
commit | c2afd200a0d55c5137de6f89200a8d4b09ba8b6e (patch) | |
tree | 88d83457bd871c829288d374fbcceb55f8b09308 /indra/newview | |
parent | 56f9c54c8348786db395ccd464eec17d5b17eeb1 (diff) |
CHUI-51 WIP notifications routing code cleanup
object inventory offers don't increment system menu count
added customizable merging behavior for duplicate "unique" notifications
fixed overeager notification channels
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llchiclet.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llnotificationhandler.h | 33 | ||||
-rw-r--r-- | indra/newview/llnotificationhinthandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llscreenchannel.cpp | 9 |
4 files changed, 34 insertions, 20 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 67519a3ca6..b4c70b6edb 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -393,9 +393,15 @@ void LLNotificationChiclet::setCounter(S32 counter) } -bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notify ) +bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notification ) { - return !(notify->canLogToIM() && notify->hasFormElements()); + if( !(notification->canLogToIM() && notification->hasFormElements()) + && (!notification->getPayload().has("give_inventory_notification") + || notification->getPayload()["give_inventory_notification"])) + { + return true; + } + return false; } ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 419b8a14b6..21f3961d18 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -94,7 +94,7 @@ public: // base interface functions /*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); } - /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } + /*virtual*/ void onLoad(LLNotificationPtr p) { processNotification(p); } /*virtual*/ void onDelete(LLNotificationPtr p) { if (mChannel) mChannel->killToastByNotificationID(p->getID());} virtual bool processNotification(const LLNotificationPtr& notify)=0; @@ -130,7 +130,7 @@ public: protected: bool processNotification(const LLNotificationPtr& p); - virtual void initChannel(); + /*virtual*/ void initChannel(); }; /** @@ -144,11 +144,12 @@ public: virtual ~LLTipHandler(); // base interface functions - virtual bool processNotification(const LLNotificationPtr& p); + /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } + /*virtual*/ bool processNotification(const LLNotificationPtr& p); protected: - virtual void onRejectToast(const LLUUID& id); - virtual void initChannel(); + /*virtual*/ void onRejectToast(const LLUUID& id); + /*virtual*/ void initChannel(); }; /** @@ -161,13 +162,13 @@ public: LLScriptHandler(); virtual ~LLScriptHandler(); - virtual void onDelete(LLNotificationPtr p); + /*virtual*/ void onDelete(LLNotificationPtr p); // base interface functions - virtual bool processNotification(const LLNotificationPtr& p); + /*virtual*/ bool processNotification(const LLNotificationPtr& p); protected: - virtual void onDeleteToast(LLToast* toast); - virtual void initChannel(); + /*virtual*/ void onDeleteToast(LLToast* toast); + /*virtual*/ void initChannel(); // own handlers void onRejectToast(LLUUID& id); @@ -184,7 +185,8 @@ public: virtual ~LLGroupHandler(); // base interface functions - virtual bool processNotification(const LLNotificationPtr& p); + /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } + /*virtual*/ bool processNotification(const LLNotificationPtr& p); protected: virtual void initChannel(); @@ -204,9 +206,7 @@ public: /*virtual*/ void onChange(LLNotificationPtr p); /*virtual*/ void onLoad(LLNotificationPtr p) { processNotification(p); } - - // base interface functions - virtual bool processNotification(const LLNotificationPtr& p); + /*virtual*/ bool processNotification(const LLNotificationPtr& p); protected: virtual void initChannel(); @@ -225,11 +225,12 @@ public: virtual ~LLOfferHandler(); // base interface functions + /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); } /*virtual*/ void onDelete(LLNotificationPtr notification); - virtual bool processNotification(const LLNotificationPtr& p); + /*virtual*/ bool processNotification(const LLNotificationPtr& p); protected: - virtual void initChannel(); + /*virtual*/ void initChannel(); // own handlers void onRejectToast(LLUUID& id); @@ -246,7 +247,7 @@ public: virtual ~LLHintHandler() {} /*virtual*/ void onAdd(LLNotificationPtr p); - /*virtual*/ void onChange(LLNotificationPtr p); + /*virtual*/ void onLoad(LLNotificationPtr p); /*virtual*/ void onDelete(LLNotificationPtr p); }; diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp index 47156a3915..271f418507 100644 --- a/indra/newview/llnotificationhinthandler.cpp +++ b/indra/newview/llnotificationhinthandler.cpp @@ -34,5 +34,5 @@ using namespace LLNotificationsUI; void LLHintHandler::onAdd(LLNotificationPtr p) { LLHints::show(p); } -void LLHintHandler::onChange(LLNotificationPtr p) { LLHints::show(p); } +void LLHintHandler::onLoad(LLNotificationPtr p) { LLHints::show(p); } void LLHintHandler::onDelete(LLNotificationPtr p) { LLHints::hide(p); } diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 5301955964..cc68c4c91a 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -251,7 +251,14 @@ void LLScreenChannel::addToast(const LLToast::Params& p) { bool store_toast = false, show_toast = false; - mDisplayToastsAlways ? show_toast = true : show_toast = mWasStartUpToastShown && (mShowToasts || p.force_show); + if (mDisplayToastsAlways) + { + show_toast = true; + } + else + { + show_toast = mWasStartUpToastShown && (mShowToasts || p.force_show); + } store_toast = !show_toast && p.can_be_stored && mCanStoreToasts; if(!show_toast && !store_toast) |