Commits

VirLinden committed 33780ad

SOCIAL-84, SOCIAL-85 WIP

  • Participants
  • Parent commits adf8217

Comments (0)

Files changed (3)

File indra/newview/llavataractions.cpp

 			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
 		{

File indra/newview/llpanelpicks.cpp

 
 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
 
 	std::set<LLUUID> mClassifiedIds;
 
+	std::string mRequestVerb;
+	
 	bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
 	{
 		// handle app/classified/create urls first
 		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);
 
 	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)

File indra/newview/llpanelprofile.cpp

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