diff options
| author | Eugene Mutavchi <emutavchi@productengine.com> | 2010-04-02 13:36:58 +0300 | 
|---|---|---|
| committer | Eugene Mutavchi <emutavchi@productengine.com> | 2010-04-02 13:36:58 +0300 | 
| commit | 32283a93e08a27e179486a5162367885131dffba (patch) | |
| tree | 4962fcb86d239b7d8967533c648d6f0a37f83a98 | |
| parent | 81582cb3764c7a0d3031f8259a4be9375fb1bd81 (diff) | |
Fixed normal bug EXT-6357 (SLapp for object chat does display an inspector) - added new LLUrlEntry to support 'secondlife:///app/objectim/{UUID}/' SLapps. Fixed passing the SLURL to inspect_remote_object floater.
Reviewed by Vadim Savchuk, https://codereview.productengine.com/secondlife/r/158/
--HG--
branch : product-engine
| -rw-r--r-- | indra/llui/llurlentry.cpp | 31 | ||||
| -rw-r--r-- | indra/llui/llurlentry.h | 12 | ||||
| -rw-r--r-- | indra/llui/llurlregistry.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llchathistory.cpp | 2 | 
4 files changed, 44 insertions, 2 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e8e3459673..2f93ab0f04 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -493,6 +493,35 @@ std::string LLUrlEntryInventory::getLabel(const std::string &url, const LLUrlLab  	return LLURI::unescape(label.empty() ? url : label);  } +// +// LLUrlEntryObjectIM Describes a Second Life inspector for the object Url, e.g., +// secondlife:///app/objectim/7bcd7864-da6b-e43f-4486-91d28a28d95b?name=Object&owner=3de548e1-57be-cfea-2b78-83ae3ad95998&slurl=Danger!%20Danger!/200/200/30/&groupowned=1 +// +LLUrlEntryObjectIM::LLUrlEntryObjectIM() +{ +	mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\?.*", +							boost::regex::perl|boost::regex::icase); +	mMenuName = "menu_url_objectim.xml"; +} + +std::string LLUrlEntryObjectIM::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ +	LLURI uri(url); +	LLSD query_map = uri.queryMap(); +	if (query_map.has("name")) +		return query_map["name"]; +	return unescapeUrl(url); +} + +std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const +{ +	LLURI uri(url); +	LLSD query_map = uri.queryMap(); +	if (query_map.has("slurl")) +		return query_map["slurl"]; +	return LLUrlEntryBase::getLocation(url); +} +  ///  /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,  /// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about @@ -515,7 +544,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC  //  LLUrlEntryPlace::LLUrlEntryPlace()  { -	mPattern = boost::regex("secondlife://\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", +	mPattern = boost::regex("secondlife://(?!/)\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?",  							boost::regex::perl|boost::regex::icase);  	mMenuName = "menu_url_slurl.xml";  	mTooltip = LLTrans::getString("TooltipSLURL"); diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 84d0968779..29575d752c 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -201,6 +201,18 @@ public:  private:  }; +/// +/// LLUrlEntryObjectIM Describes a Second Life inspector for the object Url, e.g., +/// secondlife:///app/objectim/7bcd7864-da6b-e43f-4486-91d28a28d95b?name=Object&owner=3de548e1-57be-cfea-2b78-83ae3ad95998&slurl=Danger!%20Danger!/200/200/30/&groupowned=1 +/// +class LLUrlEntryObjectIM : public LLUrlEntryBase +{ +public: +	LLUrlEntryObjectIM(); +	/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); +	/*virtual*/ std::string getLocation(const std::string &url) const; +private: +};  ///  /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g., diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index faa02e1904..7e09a5a919 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -55,6 +55,7 @@ LLUrlRegistry::LLUrlRegistry()  	registerUrl(new LLUrlEntryWorldMap());  	registerUrl(new LLUrlEntryPlace());  	registerUrl(new LLUrlEntryInventory()); +	registerUrl(new LLUrlEntryObjectIM());  	//LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,   	//so it should be registered in the end of list  	registerUrl(new LLUrlEntrySL()); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index ec5e61f384..68c31d87fa 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -93,7 +93,7 @@ public:  		payload["object_id"] = object_id;  		payload["owner_id"] = query_map["owner"];  		payload["name"] = query_map["name"]; -		payload["slurl"] = query_map["slurl"]; +		payload["slurl"] = LLWeb::escapeURL(query_map["slurl"]);  		payload["group_owned"] = query_map["groupowned"];  		LLFloaterReg::showInstance("inspect_remote_object", payload);  		return true;  | 
