From 88cce61b09d225df0bcd8aab9dbd2c5a01ee7e19 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 19 Nov 2009 11:21:20 +0200 Subject: related to EXT-700 '"Offer" notifications should be accessible via chiclet' made 'FriendshipAccepted' notification show correct avatar icon; avoided empty avatar name on 'OfferFriendship' notifiaction; avoided creating IM session on offer from objects; --HG-- branch : product-engine --- indra/newview/llnotificationofferhandler.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/newview/llnotificationofferhandler.cpp') diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 94e733913d..dea3a0c169 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); -- cgit v1.2.3