diff options
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; | 
