summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationofferhandler.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-24 12:10:10 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-24 12:10:10 -0500
commita22bb00530bb779d8e5bb40b68e55767604d88dc (patch)
tree520019b0c1e8c9cf475d19a60a0322a3c1caea6e /indra/newview/llnotificationofferhandler.cpp
parent0904cbe4846192c9897267c9a60175f84881f9ed (diff)
parent76be5ddc7022508e7d3fcb04165b4a6f64f1d58d (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llnotificationofferhandler.cpp')
-rw-r--r--indra/newview/llnotificationofferhandler.cpp26
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);