diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2018-07-10 09:13:03 +0000 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2018-07-10 09:13:03 +0000 |
commit | eaf6d49aecfc8cbba4484c2ac81579a6f689c09d (patch) | |
tree | 7b44936f12e6fdfe73868b4278c14b1336bf2a97 | |
parent | 05edfce7414bd1d4af6164387d3c862ff781fbdb (diff) | |
parent | a4c795f87b4a9026e850474cfd51b6b4253e31a4 (diff) |
Merged in maxim_productengine/viewer-neko_maint2 (pull request #651)
MAINT-8848 FIXED Object name in the llGiveInventory chat message is represented as a hyperlink
Approved-by: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com>
Approved-by: Simon Linden <simon@lindenlab.com>
-rw-r--r-- | indra/newview/llviewermessage.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llviewermessage.h | 1 |
2 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6cba7dd70c..a89b1220de 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1732,7 +1732,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { - log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); + log_message = "<nolink>" + chatHistory_string + "</nolink> " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); LLSD args; args["MESSAGE"] = log_message; LLNotificationsUtil::add("SystemMessageTip", args); @@ -1917,7 +1917,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { - log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); + log_message = "<nolink>" + chatHistory_string + "</nolink> " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); LLSD args; args["MESSAGE"] = log_message; LLNotificationsUtil::add("SystemMessageTip", args); @@ -1990,6 +1990,23 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const return false; } +std::string LLOfferInfo::getSanitizedDescription() +{ + // currently we get description from server as: 'Object' ( Location ) + // object name shouldn't be shown as a hyperlink + std::string description = mDesc; + + std::size_t start = mDesc.find_first_of("'"); + std::size_t end = mDesc.find_last_of("'"); + if ((start != std::string::npos) && (end != std::string::npos)) + { + description.insert(start, "<nolink>"); + description.insert(end + 8, "</nolink>"); + } + return description; +} + + void LLOfferInfo::initRespondFunctionMap() { if(mRespondFunctions.empty()) diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index b0eaa37541..424aae1229 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -257,6 +257,7 @@ public: private: void initRespondFunctionMap(); + std::string getSanitizedDescription(); typedef boost::function<bool (const LLSD&, const LLSD&)> respond_function_t; typedef std::map<std::string, respond_function_t> respond_function_map_t; |