summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-01-26 10:45:53 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-01-26 10:45:53 +0200
commitcd790bfd54733fe2d14dc501d99b826d968e1252 (patch)
tree1b325b52335c884dd2ad6d4129599dcceafb19b6 /indra/newview/llviewermessage.cpp
parenta5bb9a722d18ceb0f569013f0c522429bd037030 (diff)
Update for low bug EXT-4306 - Landmark name is shown with prefix in the group notice attachment.
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 0358efc0af..1d3ac3fb0f 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1436,6 +1436,31 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
return false;
}
+std::string get_display_name(const std::string& name)
+{
+ // We receive landmark name as \'<n>@name\' where <n> is a number
+ // LLViewerInventoryItem::getDisplayName will remove \'<n>@ though we need the \'
+ // Lets save all chars preceding @ and insert them back after <n>@ was removed
+
+ std::string saved;
+
+ if(std::string::npos != name.find(LLViewerInventoryItem::getSeparator()))
+ {
+ int n = 0;
+ while(!isdigit(name[n]) && LLViewerInventoryItem::getSeparator() != name[n])
+ {
+ ++n;
+ }
+ saved = name.substr(0, n);
+ }
+
+ std::string d_name = LLViewerInventoryItem::getDisplayName(name);
+ d_name.insert(0, saved);
+ LLStringUtil::trim(d_name);
+
+ return d_name;
+}
+
void inventory_offer_handler(LLOfferInfo* info)
{
//Until throttling is implmented, busy mode should reject inventory instead of silently
@@ -1475,7 +1500,7 @@ void inventory_offer_handler(LLOfferInfo* info)
if(LLAssetType::AT_LANDMARK == info->mType)
{
- msg = LLViewerInventoryItem::getDisplayName(msg);
+ msg = get_display_name(msg);
}
LLSD args;