From dd1b70f712849b7d0c96f0720e28453121b2bf1e Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 20 Oct 2010 17:03:36 -0400
Subject: [PATCH] SOCIAL-84, SOCIAL-85 WIP

---
 indra/newview/llavataractions.cpp |  2 +-
 indra/newview/llpanelpicks.cpp    | 75 ++++++++++++++++++++++++++-----
 indra/newview/llpanelprofile.cpp  |  2 +-
 3 files changed, 65 insertions(+), 14 deletions(-)
 mode change 100644 => 100755 indra/newview/llpanelpicks.cpp

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 219fca66bd6..811d07418ce 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -323,7 +323,7 @@ void LLAvatarActions::showProfile(const LLUUID& id)
 			std::string agent_name = first_name + "." + last_name;
 			llinfos << "opening web profile for " << agent_name << llendl;		
 			std::string url = getProfileURL(agent_name);
-			LLWeb::loadURL(url);
+			LLWeb::loadURLInternal(url);
 		}
 		else
 		{
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
old mode 100644
new mode 100755
index 27787ac211a..e70c7be728d
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -70,6 +70,39 @@ static const std::string CLASSIFIED_NAME("classified_name");
 
 static LLRegisterPanelClassWrapper<LLPanelPicks> t_panel_picks("panel_picks");
 
+class LLPickHandler : public LLCommandHandler
+{
+public:
+	// requires trusted browser to trigger
+	LLPickHandler() : LLCommandHandler("pick", UNTRUSTED_THROTTLE) { }
+
+	bool handle(const LLSD& params, const LLSD& query_map,
+		LLMediaCtrl* web)
+	{
+		if (params.size() < 1) return false;
+		const std::string verb = params[0];
+
+		if (verb == "create")
+		{
+			// Open "create pick" in side tab.
+		}
+		else if (verb == "edit")
+		{
+			// How to identify the pick?
+			llwarns << "how to identify pick?" << llendl;
+		}
+		else
+		{
+			llwarns << "unknown verb " << verb << llendl;
+			return false;
+		}
+			
+		return true;
+	}
+};
+
+LLPickHandler gPickHandler;
+
 class LLClassifiedHandler :
 	public LLCommandHandler,
 	public LLAvatarPropertiesObserver
@@ -80,6 +113,8 @@ class LLClassifiedHandler :
 
 	std::set<LLUUID> mClassifiedIds;
 
+	std::string mRequestVerb;
+	
 	bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
 	{
 		// handle app/classified/create urls first
@@ -107,6 +142,15 @@ class LLClassifiedHandler :
 		const std::string verb = params[1].asString();
 		if (verb == "about")
 		{
+			mRequestVerb = verb;
+			mClassifiedIds.insert(classified_id);
+			LLAvatarPropertiesProcessor::getInstance()->addObserver(LLUUID(), this);
+			LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(classified_id);
+			return true;
+		}
+		else if (verb == "edit")
+		{
+			mRequestVerb = verb;
 			mClassifiedIds.insert(classified_id);
 			LLAvatarPropertiesProcessor::getInstance()->addObserver(LLUUID(), this);
 			LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(classified_id);
@@ -128,18 +172,25 @@ class LLClassifiedHandler :
 
 	void openClassified(LLAvatarClassifiedInfo* c_info)
 	{
-		// open the classified info panel on the Me > Picks sidetray
-		LLSD params;
-		params["id"] = c_info->creator_id;
-		params["open_tab_name"] = "panel_picks";
-		params["show_tab_panel"] = "classified_details";
-		params["classified_id"] = c_info->classified_id;
-		params["classified_creator_id"] = c_info->creator_id;
-		params["classified_snapshot_id"] = c_info->snapshot_id;
-		params["classified_name"] = c_info->name;
-		params["classified_desc"] = c_info->description;
-		params["from_search"] = true;
-		LLSideTray::getInstance()->showPanel("panel_profile_view", params);
+		if (mRequestVerb == "about")
+		{
+			// open the classified info panel on the Me > Picks sidetray
+			LLSD params;
+			params["id"] = c_info->creator_id;
+			params["open_tab_name"] = "panel_picks";
+			params["show_tab_panel"] = "classified_details";
+			params["classified_id"] = c_info->classified_id;
+			params["classified_creator_id"] = c_info->creator_id;
+			params["classified_snapshot_id"] = c_info->snapshot_id;
+			params["classified_name"] = c_info->name;
+			params["classified_desc"] = c_info->description;
+			params["from_search"] = true;
+			LLSideTray::getInstance()->showPanel("panel_profile_view", params);
+		}
+		else if (mRequestVerb == "edit")
+		{
+			llwarns << "edit in progress" << llendl;
+		}
 	}
 
 	/*virtual*/ void processProperties(void* data, EAvatarProcessorType type)
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 38683ab5f73..1268c181ad2 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -61,7 +61,7 @@ class LLProfileHandler : public LLCommandHandler
 		std::string agent_name = params[0];
 		llinfos << "Profile, agent_name " << agent_name << llendl;
 		std::string url = getProfileURL(agent_name);
-		LLWeb::loadURL(url);
+		LLWeb::loadURLInternal(url);
 
 		return true;
 	}
-- 
GitLab