diff options
author | Ramzi Linden <ramzi@lindenlab.com> | 2009-11-23 16:11:35 -0800 |
---|---|---|
committer | Ramzi Linden <ramzi@lindenlab.com> | 2009-11-23 16:11:35 -0800 |
commit | f39d4e98a73d5e13ce06f6188bf2d60d2db5d085 (patch) | |
tree | b39781e1fcbcc57139b395934594158102773c3b /indra/newview/llnotificationofferhandler.cpp | |
parent | 58eab5547fcd5f665c5254f31afd778797e5c84c (diff) | |
parent | c9a1d3040e4ec8fde7bc1d69ea0509f0f7d288a1 (diff) |
merge
Diffstat (limited to 'indra/newview/llnotificationofferhandler.cpp')
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 598d021703..0a595765a9 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -92,16 +92,26 @@ bool LLOfferHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { // add message to IM - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, notification->getPayload()["from_id"]); - if (!LLIMMgr::instance().hasSession(session_id)) + const std::string + name = + notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] + : notification->getSubstitutions()["[NAME]"]; + + // don't create IM session with objects + if (notification->getName() != "ObjectGiveItem" + && notification->getName() != "ObjectGiveItemUnknownUser") { - session_id = LLIMMgr::instance().addSession( - notification->getSubstitutions()["OBJECTFROMNAME"], IM_NOTHING_SPECIAL, - notification->getPayload()["from_id"]); + LLUUID from_id = notification->getPayload()["from_id"]; + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, + from_id); + if (!LLIMMgr::instance().hasSession(session_id)) + { + session_id = LLIMMgr::instance().addSession(name, + IM_NOTHING_SPECIAL, from_id); + } + LLIMMgr::instance().addMessage(session_id, LLUUID(), name, + notification->getMessage()); } - LLIMMgr::instance().addMessage(session_id, LLUUID(), - notification->getSubstitutions()["OBJECTFROMNAME"], - notification->getMessage()); LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); |