diff options
author | skolb <none@none> | 2009-12-03 09:18:11 -0800 |
---|---|---|
committer | skolb <none@none> | 2009-12-03 09:18:11 -0800 |
commit | 7851819c88e8049c1c3d07d279d479c53d5de777 (patch) | |
tree | e8c81e110a71427b64e0b34f4351e7acf44465f3 /indra/newview/llnotificationofferhandler.cpp | |
parent | 9b17e6710b713fa12f6db7d6f51d97e4052a0835 (diff) | |
parent | 57b68d9bfe25fc7b9efe41a9fa30935c156acb34 (diff) |
local merge
Diffstat (limited to 'indra/newview/llnotificationofferhandler.cpp')
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 49 |
1 files changed, 34 insertions, 15 deletions
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<LLScreenChannel*>(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<LLScreenChannel*>(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; |