diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-01-26 10:45:53 +0200 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-01-26 10:45:53 +0200 |
commit | cd790bfd54733fe2d14dc501d99b826d968e1252 (patch) | |
tree | 1b325b52335c884dd2ad6d4129599dcceafb19b6 /indra | |
parent | a5bb9a722d18ceb0f569013f0c522429bd037030 (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')
-rw-r--r-- | indra/newview/llviewerinventory.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 27 |
2 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 917b8747ea..7f3f019b07 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -58,7 +58,6 @@ public: protected: ~LLViewerInventoryItem( void ); // ref counted BOOL extractSortFieldAndDisplayName(S32* sortField, std::string* displayName) const { return extractSortFieldAndDisplayName(mName, sortField, displayName); } - static char getSeparator() { return '@'; } mutable std::string mDisplayName; public: @@ -67,6 +66,7 @@ public: virtual const std::string& getName() const; virtual const std::string& getDisplayName() const; static std::string getDisplayName(const std::string& name); + static char getSeparator() { return '@'; } virtual S32 getSortField() const; virtual void setSortField(S32 sortField); virtual void rename(const std::string& new_name); 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; |