diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-24 02:24:42 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-24 02:24:42 +0300 |
commit | ba90f3a8e4afb5eb303dab5f590db713ff82ec0e (patch) | |
tree | 715fb1613676b6893bec2111cd14e3fcb938fdb8 /indra/newview/lltwitterconnect.cpp | |
parent | 8a79174b0a7ef9eb3b6edde9fd8f9e4565b99ded (diff) |
SL-10994 Removed Facebook In-world Sharing
SL-11024 Fixed Twitter connect failure
Diffstat (limited to 'indra/newview/lltwitterconnect.cpp')
-rw-r--r-- | indra/newview/lltwitterconnect.cpp | 44 |
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) |