From 7d012cb35e9e71ef86f00ba8e2f0695b75068528 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 10 May 2013 13:31:10 +0200 Subject: [PATCH] - fixed : teleport and friendship offers don't increment the notificaiton systwell counter and can't be dismissed --HG-- branch : RLVa --- indra/newview/llchiclet.cpp | 14 +++++++++++ indra/newview/llnotificationofferhandler.cpp | 15 +++++++++--- indra/newview/llviewermessage.cpp | 25 ++++++++++++++++++-- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 88884042d4..f58823ef1b 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -35,6 +35,9 @@ #include "llscriptfloater.h" #include "llsingleton.h" #include "llsyswellwindow.h" +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) +#include "llchannelmanager.h" +// [/SL:KB] static LLDefaultChildRegistry::Register t1("chiclet_panel"); static LLDefaultChildRegistry::Register t2("chiclet_notification"); @@ -231,6 +234,17 @@ bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNo { return true; } + +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) + if ("offer" == notification->getType()) + { + // Assume that any offer notification with "getCanBeStored() == true" is the result of RLVa routing it to the notifcation syswell + /*const*/ LLNotificationsUI::LLScreenChannel* pChannel = LLNotificationsUI::LLChannelManager::instance().getNotificationScreenChannel(); + /*const*/ LLNotificationsUI::LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification->getID()) : NULL; + return (pToast) && (pToast->getCanBeStored()); + } +// [/SL:KB] + return false; } diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 17f593e55e..dc16aea84d 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -192,9 +192,18 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification) } else { - if (notification->canLogToIM() - && notification->hasFormElements() - && !LLHandlerUtil::isIMFloaterOpened(notification)) +// if (notification->canLogToIM() +// && notification->hasFormElements() +// && !LLHandlerUtil::isIMFloaterOpened(notification)) +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) + // The above test won't necessarily tell us whether the notification went into an IM or to the notification syswell + // -> the one and only time we need to decrease the unread IM count is when we've clicked any of the buttons on the *toast* + // -> since LLIMFloater::updateMessages() hides the toast when we open the IM (which resets the unread count to 0) we should + // *only* decrease the unread IM count if there's a visible toast since the unread count will be at 0 otherwise anyway + LLScreenChannel* pChannel = dynamic_cast(mChannel.get()); + LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification->getID()) : NULL; + if ( (pToast) && (!pToast->getCanBeStored()) ) +// [/SL:KB] { LLHandlerUtil::decIMMesageCounter(notification); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e3c841eb33..6289ef8f25 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -260,7 +260,17 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response) modified_form->setElementEnabled("Accept", false); modified_form->setElementEnabled("Decline", false); notification_ptr->updateForm(modified_form); - notification_ptr->repost(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) + // Assume that any offer notification with "getCanBeStored() == true" is the result of RLVa routing it to the notifcation syswell + /*const*/ LLNotificationsUI::LLScreenChannel* pChannel = LLNotificationsUI::LLChannelManager::instance().getNotificationScreenChannel(); + /*const*/ LLNotificationsUI::LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification["id"].asUUID()) : NULL; + if ( (!pToast) || (!pToast->getCanBeStored()) ) + { +// [/SL:KB] + notification_ptr->repost(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) + } +// [/SL:KB] } return false; @@ -2150,7 +2160,18 @@ bool lure_callback(const LLSD& notification, const LLSD& response) modified_form->setElementEnabled("Teleport", false); modified_form->setElementEnabled("Cancel", false); notification_ptr->updateForm(modified_form); - notification_ptr->repost(); + +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) + // Assume that any offer notification with "getCanBeStored() == true" is the result of RLVa routing it to the notifcation syswell + /*const*/ LLNotificationsUI::LLScreenChannel* pChannel = LLNotificationsUI::LLChannelManager::instance().getNotificationScreenChannel(); + /*const*/ LLNotificationsUI::LLToast* pToast = (pChannel) ? pChannel->getToastByNotificationID(notification["id"].asUUID()) : NULL; + if ( (!pToast) || (!pToast->getCanBeStored()) ) + { +// [/SL:KB] + notification_ptr->repost(); +// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) + } +// [/SL:KB] } return false;