From daefef6e66ef312e4e036fe05584ed2cafe1c56c Mon Sep 17 00:00:00 2001
From: Lynx Linden <lynx@lindenlab.com>
Date: Thu, 12 Nov 2009 12:43:18 +0000
Subject: [PATCH] DEV-2925: Remove support for secondlife:///app/objectim URLs.

These are no longer generated in Viewer 2.0 (instead we use
notifications to send object IMs to the user), so there's no
need to look for them in every textbox. Users can get details
on any objects spamming them via the new remote object inspector.
---
 indra/llui/llurlentry.cpp         | 44 -------------------------------
 indra/llui/llurlentry.h           | 12 ---------
 indra/llui/llurlregistry.cpp      |  1 -
 indra/newview/llagentlistener.cpp |  2 +-
 indra/newview/llurldispatcher.cpp |  6 ++---
 5 files changed, 4 insertions(+), 61 deletions(-)

diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index dae4b512d15..219fae84be8 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -512,50 +512,6 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const
 	return ::getStringAfterToken(url, "app/teleport/");
 }
 
-///
-/// LLUrlEntryObjectIM Describes a Second Life object instant msg Url, e.g.,
-/// secondlife:///app/objectim/<sessionid>
-///
-LLUrlEntryObjectIM::LLUrlEntryObjectIM()
-{
-	mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\\??\\S*",
-							boost::regex::perl|boost::regex::icase);
-	mMenuName = "menu_url_objectim.xml";
-	mTooltip = LLTrans::getString("TooltipObjectIMUrl");
-}
-
-std::string LLUrlEntryObjectIM::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
-{
-	LLURI uri(url);
-	LLSD params = uri.queryMap();
-	if (params.has("name"))
-	{
-		// look for a ?name=<obj-name> param in the url
-		// and use that as the label if present.
-		std::string name = params.get("name");
-		LLStringUtil::trim(name);
-		if (name.empty())
-		{
-			name = LLTrans::getString("Unnamed");
-		}
-		return name;
-	}
-
-	return unescapeUrl(url);
-}
-
-std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const
-{
-	LLURI uri(url);
-	LLSD params = uri.queryMap();
-	if (params.has("slurl"))
-	{
-		return params.get("slurl");
-	}
-
-	return "";
-}
-
 //
 // LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts
 // with secondlife:// (used as a catch-all for cases not matched above)
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 4507572b1e1..7970b48eb5a 100644
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -208,18 +208,6 @@ class LLUrlEntryTeleport : public LLUrlEntryBase
 	/*virtual*/ std::string getLocation(const std::string &url) const;
 };
 
-///
-/// LLUrlEntryObjectIM Describes a Second Life object instant msg Url, e.g.,
-/// secondlife:///app/objectim/<sessionid>?name=Foo
-///
-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;
-};
-
 ///
 /// LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts
 /// with secondlife:// (used as a catch-all for cases not matched above)
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 60275b60bc2..a6922b019b5 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -52,7 +52,6 @@ LLUrlRegistry::LLUrlRegistry()
 	registerUrl(new LLUrlEntryParcel());
 	registerUrl(new LLUrlEntryTeleport());
 	registerUrl(new LLUrlEntryWorldMap());
-	registerUrl(new LLUrlEntryObjectIM());
 	registerUrl(new LLUrlEntryPlace());
 	registerUrl(new LLUrlEntrySL());
 	registerUrl(new LLUrlEntrySLLabel());
diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp
index 0f00078b33c..b227799a223 100644
--- a/indra/newview/llagentlistener.cpp
+++ b/indra/newview/llagentlistener.cpp
@@ -40,7 +40,7 @@ void LLAgentListener::requestTeleport(LLSD const & event_data) const
 		params.append(event_data["y"]);
 		params.append(event_data["z"]);
 		LLCommandDispatcher::dispatch("teleport", params, LLSD(), NULL, true);
-		// *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "objectim", "parcel", "login", login_refresh", "balance", "chat"
+		// *TODO - lookup other LLCommandHandlers for "agent", "classified", "event", "group", "floater", "parcel", "login", login_refresh", "balance", "chat"
 		// should we just compose LLCommandHandler and LLDispatchListener?
 	}
 	else
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index a3daca6fa42..9e064d81356 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -364,9 +364,9 @@ bool LLURLDispatcher::dispatchRightClick(const std::string& url)
 bool LLURLDispatcher::dispatchFromTextEditor(const std::string& url)
 {
 	// *NOTE: Text editors are considered sources of trusted URLs
-	// in order to make objectim and avatar profile links in chat
-	// history work.  While a malicious resident could chat an app
-	// SLURL, the receiving resident will see it and must affirmatively
+	// in order to make avatar profile links in chat history work.
+	// While a malicious resident could chat an app SLURL, the
+	// receiving resident will see it and must affirmatively
 	// click on it.
 	// *TODO: Make this trust model more refined.  JC
 	const bool trusted_browser = true;
-- 
GitLab