summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
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())