diff options
| author | bea@american.lindenlab.com <bea@american.lindenlab.com> | 2009-12-09 12:53:35 -0800 |
|---|---|---|
| committer | bea@american.lindenlab.com <bea@american.lindenlab.com> | 2009-12-09 12:53:35 -0800 |
| commit | 874f53230dbe40e599e8903fae87a60816508fd6 (patch) | |
| tree | 6affd304d74261bd45f13eff4c1521b580ae8bc1 /indra/newview/llnotificationofferhandler.cpp | |
| parent | 0bf7917ae848388a3e1bc6ad13e300880fed12d0 (diff) | |
| parent | 431bfca2ade364dc1165e402537e5e2d3616ebfd (diff) | |
merge
Diffstat (limited to 'indra/newview/llnotificationofferhandler.cpp')
| -rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 4f353bf6a5..4d64c5c0e4 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -40,6 +40,8 @@ #include "llnotificationmanager.h" #include "llnotifications.h" #include "llscriptfloater.h" +#include "llimview.h" +#include "llnotificationsutil.h" using namespace LLNotificationsUI; @@ -101,20 +103,48 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } 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(); + if (LLHandlerUtil::canSpawnIMSession(notification)) + { + const std::string name = notification->getSubstitutions().has( + "NAME") ? notification->getSubstitutions()["NAME"] + : notification->getSubstitutions()["[NAME]"]; + + LLUUID from_id = notification->getPayload()["from_id"]; + + LLUUID session_id = LLIMMgr::computeSessionID( + IM_NOTHING_SPECIAL, from_id); + + LLIMModel::LLIMSession* session = + LLIMModel::instance().findIMSession(session_id); + if (session == NULL) + { + LLIMMgr::instance().addSession(name, IM_NOTHING_SPECIAL, + from_id); + } + } + + if (notification->getPayload().has("SUPPRES_TOST") + && notification->getPayload()["SUPPRES_TOST"]) + { + LLNotificationsUtil::cancel(notification); + } + 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") |
