summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2018-07-09 18:06:16 +0300
committermaxim_productengine <mnikolenko@productengine.com>2018-07-09 18:06:16 +0300
commita4c795f87b4a9026e850474cfd51b6b4253e31a4 (patch)
tree2e1a1bef97d75401439c9c7436ee022dd9fb6cbe /indra/newview/llviewermessage.cpp
parent9d3639ec4b1846d7bdcd59e6341d4bf866e9b979 (diff)
MAINT-8848 FIXED Object name in the llGiveInventory chat message is represented as a hyperlink
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp21
1 files changed, 19 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())