diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-07-30 18:07:35 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-07-30 18:07:35 -0700 |
commit | 854e6acb424faa843f9bff7875927fcfec2cb1d4 (patch) | |
tree | 5a5f21c59ba6eb1c6551bb37538f3125c2c4ccbb /indra/newview/llviewermessage.cpp | |
parent | 547bcc907389aeb1a3d974025b621e98d1178714 (diff) | |
parent | afaa076b7dd300a2836205fe6eb9ba5ab08bfb28 (diff) |
Merge with dessie/viewer-release
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 525413edc2..df2c5543c5 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1142,10 +1142,26 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam } else if(from_name.empty()) { + std::string folder_name; + if (parent_folder) + { + // Localize folder name. + // *TODO: share this code? + folder_name = parent_folder->getName(); + if (LLFolderType::lookupIsProtectedType(parent_folder->getPreferredType())) + { + LLTrans::findString(folder_name, "InvFolder " + folder_name); + } + } + else + { + folder_name = LLTrans::getString("Unknown"); + } + // we receive a message from LLOpenTaskOffer, it mean that new landmark has been added. LLSD args; args["LANDMARK_NAME"] = item->getName(); - args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); + args["FOLDER_NAME"] = folder_name; LLNotificationsUtil::add("LandmarkCreated", args); } } @@ -1219,8 +1235,10 @@ bool highlight_offered_object(const LLUUID& obj_id) void inventory_offer_mute_callback(const LLUUID& blocked_id, const std::string& full_name, bool is_group, - LLOfferInfo* offer = NULL) + boost::shared_ptr<LLNotificationResponderInterface> offer_ptr) { + LLOfferInfo* offer = dynamic_cast<LLOfferInfo*>(offer_ptr.get()); + std::string from_name = full_name; LLMute::EType type; if (is_group) @@ -1407,7 +1425,13 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // * we can't build two messages at once. if (2 == button) // Block { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,this)); + LLNotificationPtr notification_ptr = LLNotifications::instance().find(notification["id"].asUUID()); + + llassert(notification_ptr != NULL); + if (notification_ptr != NULL) + { + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,notification_ptr->getResponderPtr())); + } } std::string from_string; // Used in the pop-up. @@ -1541,7 +1565,13 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const // * we can't build two messages at once. if (2 == button) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,this)); + LLNotificationPtr notification_ptr = LLNotifications::instance().find(notification["id"].asUUID()); + + llassert(notification_ptr != NULL); + if (notification_ptr != NULL) + { + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,notification_ptr->getResponderPtr())); + } } LLMessageSystem* msg = gMessageSystem; @@ -5356,7 +5386,7 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) void process_alert_core(const std::string& message, BOOL modal) { - // HACK -- handle callbacks for specific alerts + // HACK -- handle callbacks for specific alerts. It also is localized in notifications.xml if ( message == "You died and have been teleported to your home location") { LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); |