summaryrefslogtreecommitdiff
path: root/indra/newview/lltwitterconnect.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-09-10 12:07:01 -0700
committerGraham Linden <graham@lindenlab.com>2019-09-10 12:07:01 -0700
commit3609eabe5460023d1460664feb5de10d68457725 (patch)
tree533d03aadf36730eb59c2627cfd09e35593dd03c /indra/newview/lltwitterconnect.cpp
parent3191a5ddc9b3512b79a8505072d13583eb9012c6 (diff)
parente241670694959833feaa0e667222b337095eb683 (diff)
Merge viewer-release 6.3.2
Diffstat (limited to 'indra/newview/lltwitterconnect.cpp')
-rw-r--r--indra/newview/lltwitterconnect.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp
index 5d598aaebe..b2d2fa9d77 100644
--- a/indra/newview/lltwitterconnect.cpp
+++ b/indra/newview/lltwitterconnect.cpp
@@ -28,6 +28,7 @@
#include "llviewerprecompiledheaders.h"
#include "lltwitterconnect.h"
+#include "llflickrconnect.h"
#include "llagent.h"
#include "llcallingcard.h" // for LLAvatarTracker
@@ -65,6 +66,49 @@ void toast_user_for_twitter_success()
LLNotificationsUtil::add("TwitterConnect", args);
}
+class LLTwitterConnectHandler : public LLCommandHandler
+{
+public:
+ LLTwitterConnectHandler() : LLCommandHandler("fbc", 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() == "twitter")
+ {
+ // this command probably came from the twitter_web browser, so close it
+ LLFloaterReg::hideInstance("twitter_web");
+
+ // 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() == "flickr")
+ {
+ // this command probably came from the flickr_web browser, so close it
+ LLFloaterReg::hideInstance("flickr_web");
+
+ // connect to flickr
+ if (query_map.has("oauth_token"))
+ {
+ LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+};
+LLTwitterConnectHandler gTwitterConnectHandler;
+
+
///////////////////////////////////////////////////////////////////////////////
//
void LLTwitterConnect::twitterConnectCoro(std::string requestToken, std::string oauthVerifier)