summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-12-04 21:17:04 -0800
committerMerov Linden <merov@lindenlab.com>2013-12-04 21:17:04 -0800
commit0dfc7f6145b0c179ee66dbc7539b7c3d9a68cc37 (patch)
tree7cce8cf627609aec932923679fd811a671bd3b9c /indra/newview/llfacebookconnect.cpp
parentf5b356a7d4b51fbf509926295cb38d3a1e8442e3 (diff)
parent5a23bf50bcee13a5841f680b13ca480753d367a1 (diff)
Pull merge from lindenlab/viewer-acme
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rw-r--r--indra/newview/llfacebookconnect.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 8cde871cd1..eeb28376a9 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -69,6 +69,75 @@ void toast_user_for_facebook_success()
///////////////////////////////////////////////////////////////////////////////
//
+class LLSLShareHandler : public LLCommandHandler
+{
+public:
+ LLSLShareHandler() : LLCommandHandler("slshare", UNTRUSTED_THROTTLE) { }
+
+ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ if (tokens.size() >= 1)
+ {
+ if (tokens[0].asString() == "connect")
+ {
+ if (tokens.size() >= 2 && tokens[1].asString() == "flickr")
+ {
+ // this command probably came from the flickr_web browser, so close it
+ LLFloater* flickr_web = LLFloaterReg::getInstance("flickr_web");
+ if (flickr_web)
+ {
+ flickr_web->closeFloater();
+ }
+
+ // connect to flickr
+ if (query_map.has("oauth_token"))
+ {
+ LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
+ }
+ else if (tokens.size() >= 2 && tokens[1].asString() == "twitter")
+ {
+ // this command probably came from the twitter_web browser, so close it
+ LLFloater* twitter_web = LLFloaterReg::getInstance("twitter_web");
+ if (twitter_web)
+ {
+ twitter_web->closeFloater();
+ }
+
+ // connect to twitter
+ if (query_map.has("oauth_token"))
+ {
+ LLTwitterConnect::instance().connectToTwitter(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
+ }
+ else //if (tokens.size() >= 2 && tokens[1].asString() == "facebook")
+ {
+ // this command probably came from the fbc_web browser, so close it
+ LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web");
+ if (fbc_web)
+ {
+ fbc_web->closeFloater();
+ }
+
+ // connect to facebook
+ if (query_map.has("code"))
+ {
+ LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+};
+LLSLShareHandler gSLShareHandler;
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// DEPRECATED - please remove once "fbc" is phased out of the web service
class LLFacebookConnectHandler : public LLCommandHandler
{
public: