From ba90f3a8e4afb5eb303dab5f590db713ff82ec0e Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 24 Apr 2019 02:24:42 +0300 Subject: SL-10994 Removed Facebook In-world Sharing SL-11024 Fixed Twitter connect failure --- indra/newview/lltwitterconnect.cpp | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'indra/newview/lltwitterconnect.cpp') 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) -- cgit v1.2.3