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
meow-7.2.2
Eugene Mutavchi 2010-04-02 13:36:58 +03:00
parent 81582cb376
commit 32283a93e0
4 changed files with 44 additions and 2 deletions

View File

@ -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");

View File

@ -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.,

View File

@ -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());

View File

@ -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;