From 07f284408bbf9b7377860ddb9c3864d5a32e0b3e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Tue, 1 Dec 2009 21:46:19 +0200 Subject: Implemented normal task EXT-2476 (llGiveInventory() should be handled also by Chiclet subsystem along with Notificaton subsystem) --HG-- branch : product-engine --- indra/newview/llnotificationofferhandler.cpp | 49 +++++++++++++++++++--------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'indra/newview/llnotificationofferhandler.cpp') diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index c179a2cf90..4f353bf6a5 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -39,6 +39,7 @@ #include "llviewerwindow.h" #include "llnotificationmanager.h" #include "llnotifications.h" +#include "llscriptfloater.h" using namespace LLNotificationsUI; @@ -92,24 +93,42 @@ bool LLOfferHandler::processNotification(const LLSD& notify) { LLHandlerUtil::logToIMP2P(notification); - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); - - LLToast::Params p; - p.notif_id = notification->getID(); - p.notification = notification; - p.panel = notify_box; - p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1); - - LLScreenChannel* channel = dynamic_cast(mChannel); - if(channel) - channel->addToast(p); - - // send a signal to the counter manager - mNewNotificationSignal(); + if( notification->getPayload().has("give_inventory_notification") + && !notification->getPayload()["give_inventory_notification"] ) + { + // This is an original inventory offer, so add a script floater + LLScriptFloaterManager::instance().onAddNotification(notification->getID()); + } + else + { + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); + + LLToast::Params p; + p.notif_id = notification->getID(); + p.notification = notification; + p.panel = notify_box; + p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1); + + LLScreenChannel* channel = dynamic_cast(mChannel); + if(channel) + channel->addToast(p); + + // send a signal to the counter manager + mNewNotificationSignal(); + } } else if (notify["sigtype"].asString() == "delete") { - mChannel->killToastByNotificationID(notification->getID()); + if( notification->getPayload().has("give_inventory_notification") + && !notification->getPayload()["give_inventory_notification"] ) + { + // Remove original inventory offer script floater + LLScriptFloaterManager::instance().onRemoveNotification(notification->getID()); + } + else + { + mChannel->killToastByNotificationID(notification->getID()); + } } return true; -- cgit v1.2.3