summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-10-12 08:43:16 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-10-12 08:43:16 -0400
commit993136fe347075b71f649ec70ce1a463afb073f8 (patch)
treecd2729ca91aac104fb7a13493b015b1955957948
parent48c2b2496d3ed6aeeebb0bc8950725f8ef7e305f (diff)
Initial hooks for web profiles support
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llavataractions.cpp18
-rw-r--r--indra/newview/llpanelprofile.cpp24
3 files changed, 53 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 742a20a849..a7d3b6436d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3854,6 +3854,17 @@
<key>Value</key>
<string>http://search.secondlife.com/viewer/[CATEGORY]?q=[QUERY]&amp;p=[AUTH_TOKEN]&amp;r=[MATURITY]&amp;lang=[LANGUAGE]&amp;g=[GODLIKE]&amp;sid=[SESSION_ID]&amp;rid=[REGION_ID]&amp;pid=[PARCEL_ID]&amp;channel=[CHANNEL]&amp;version=[VERSION]&amp;major=[VERSION_MAJOR]&amp;minor=[VERSION_MINOR]&amp;patch=[VERSION_PATCH]&amp;build=[VERSION_BUILD]</string>
</map>
+ <key>WebProfileURL</key>
+ <map>
+ <key>Comment</key>
+ <string>URL for Web Profiles</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>http://profiles.secondlife.local/[AGENT_NAME]</string>
+ </map>
<key>HighResSnapshot</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 79b0c63b38..42701bcff9 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -59,6 +59,7 @@
#include "llrecentpeople.h"
#include "llsidetray.h"
#include "lltrans.h"
+#include "llviewercontrol.h"
#include "llviewerobjectlist.h"
#include "llviewermessage.h" // for handle_lure
#include "llviewerregion.h"
@@ -314,6 +315,22 @@ void LLAvatarActions::showProfile(const LLUUID& id)
params["id"] = id;
params["open_tab_name"] = "panel_profile";
+ // PROFILES: open in webkit window
+ std::string first_name,last_name;
+ if (gCacheName->getName(id,first_name,last_name))
+ {
+ llinfos << "opening web profile for " << first_name << "." << last_name << llendl;
+ std::string url = gSavedSettings.getString("WebProfileURL");
+ LLSD subs;
+ subs["AGENT_NAME"] = first_name + "." + last_name;
+ url = LLWeb::expandURLSubstitutions(url,subs);
+ LLWeb::loadURL(url);
+ }
+ else
+ {
+ llwarns << "no name info for agent id " << id << llendl;
+ }
+#if 0
//Show own profile
if(gAgent.getID() == id)
{
@@ -324,6 +341,7 @@ void LLAvatarActions::showProfile(const LLUUID& id)
{
LLSideTray::getInstance()->showPanel("panel_profile_view", params);
}
+#endif
}
}
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 4e63563979..00191b17bd 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -33,10 +33,34 @@
#include "llcommandhandler.h"
#include "llpanelpicks.h"
#include "lltabcontainer.h"
+#include "llviewercontrol.h"
static const std::string PANEL_PICKS = "panel_picks";
static const std::string PANEL_PROFILE = "panel_profile";
+class LLProfileHandler : public LLCommandHandler
+{
+public:
+ // requires trusted browser to trigger
+ LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { }
+
+ bool handle(const LLSD& params, const LLSD& query_map,
+ LLMediaCtrl* web)
+ {
+ if (params.size() < 1) return false;
+ std::string agent_name = params[0];
+ llinfos << "Profile, agent_name " << agent_name << llendl;
+ std::string url = gSavedSettings.getString("WebProfileURL");
+ LLSD subs;
+ subs["AGENT_NAME"] = agent_name;
+ url = LLWeb::expandURLSubstitutions(url,subs);
+ LLWeb::loadURL(url);
+
+ return true;
+ }
+};
+LLProfileHandler gProfileHandler;
+
class LLAgentHandler : public LLCommandHandler
{
public: