diff options
author | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-12-03 12:09:16 -0500 |
---|---|---|
committer | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-12-03 12:09:16 -0500 |
commit | b05ebd89775792762063d3af08f0fe9ae785454a (patch) | |
tree | ee364573584ba2dbd2d2699707f985fbad0cbf42 /indra/newview/llviewermessage.cpp | |
parent | 0cfc3af9aceede80230c7f2b36fb7fdcf0fcc179 (diff) | |
parent | 67f11add9c2e05e1c86e30c44c94ee1b7d9205d0 (diff) |
merge of viewer2 into avp branch
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4d26f6294c..2ae8aca6ad 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1176,6 +1176,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gInventory.addObserver(opener); } + // Remove script dialog because there is no need in it no more. + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); + delete this; return false; } @@ -1350,7 +1354,11 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const { gInventory.addObserver(opener); } - + + // Remove script dialog because there is no need in it no more. + LLUUID object_id = notification["payload"]["object_id"].asUUID(); + LLScriptFloaterManager::instance().removeNotificationByObjectId(object_id); + delete this; return false; } @@ -1438,7 +1446,18 @@ void inventory_offer_handler(LLOfferInfo* info) } } + // If mObjectID is null then generate the object_id based on msg to prevent + // multiple creation of chiclets for same object. + LLUUID object_id = info->mObjectID; + if (object_id.isNull()) + object_id.generate(msg); + payload["from_id"] = info->mFromID; + // Needed by LLScriptFloaterManager to bind original notification with + // faked for toast one. + payload["object_id"] = object_id; + // Flag indicating that this notification is faked for toast. + payload["give_inventory_notification"] = FALSE; args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); @@ -1479,9 +1498,16 @@ void inventory_offer_handler(LLOfferInfo* info) // In viewer 2 we're now auto receiving inventory offers and messaging as such (not sending reject messages). info->send_auto_receive_response(); } - + // Pop up inv offer notification and let the user accept (keep), or reject (and silently delete) the inventory. - LLNotifications::instance().add(p); + LLNotifications::instance().add(p); + + // Inform user that there is a script floater via toast system + { + payload["give_inventory_notification"] = TRUE; + LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); + LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); + } } bool lure_callback(const LLSD& notification, const LLSD& response) @@ -4283,7 +4309,28 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) // *TODO: Translate LLSD args; args["MESSAGE"] = desc; - LLNotificationsUtil::add("SystemMessage", args); + + // this is a marker to retrieve avatar name from server message: + // "<avatar name> paid you L$" + const std::string marker = "paid you L$"; + + // extract avatar name from system message + std::string name = desc.substr(0, desc.find(marker, 0)); + LLStringUtil::trim(name); + + // if name extracted and name cache contains avatar id send loggable notification + LLUUID from_id; + if(name.size() > 0 && gCacheName->getUUID(name, from_id)) + { + args["NAME"] = name; + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("PaymentRecived", args, payload); + } + else + { + LLNotificationsUtil::add("SystemMessage", args); + } // Once the 'recent' container gets large enough, chop some // off the beginning. |