diff options
Diffstat (limited to 'indra/newview/llnotificationtiphandler.cpp')
-rw-r--r-- | indra/newview/llnotificationtiphandler.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 83a2215ac6..df6f04b6ea 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -40,10 +40,11 @@ #include "lltoastnotifypanel.h" #include "llviewercontrol.h" #include "llviewerwindow.h" +#include "llnotificationmanager.h" +#include "llpaneltiptoast.h" using namespace LLNotificationsUI; - //-------------------------------------------------------------------------- LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id) { @@ -51,6 +52,10 @@ LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id) // Getting a Channel for our notifications mChannel = LLChannelManager::getInstance()->createNotificationChannel(); + + LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); + if(channel) + channel->setOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1)); } //-------------------------------------------------------------------------- @@ -114,7 +119,13 @@ bool LLTipHandler::processNotification(const LLSD& notify) LLHandlerUtil::spawnIMSession(name, from_id); } - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); + // don't spawn toast for inventory accepted/declined offers if respective IM window is open (EXT-5909) + if (!LLHandlerUtil::canSpawnToast(notification)) + { + return true; + } + + LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); LLToast::Params p; p.notif_id = notification->getID(); @@ -124,6 +135,8 @@ bool LLTipHandler::processNotification(const LLSD& notify) p.is_tip = true; p.can_be_stored = false; + removeExclusiveNotifications(notification); + LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); if(channel) channel->addToast(p); @@ -142,4 +155,14 @@ void LLTipHandler::onDeleteToast(LLToast* toast) //-------------------------------------------------------------------------- +void LLTipHandler::onRejectToast(const LLUUID& id) +{ + LLNotificationPtr notification = LLNotifications::instance().find(id); + if (notification + && LLNotificationManager::getInstance()->getHandlerForNotification( + notification->getType()) == this) + { + LLNotifications::instance().cancel(notification); + } +} |