diff options
author | Merov Linden <merov@lindenlab.com> | 2013-06-14 20:01:33 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-06-14 20:01:33 -0700 |
commit | 2eb466908e8056f9b890d06d449ad8d10d3ff4cf (patch) | |
tree | 15fd57d5af29efb39fc43c2ac1ad5d2532fd079c /indra/newview/llfacebookconnect.h | |
parent | f5fb235aac7bb437416d5c665ff43ed5685a6755 (diff) |
ACME-520 : Add more extended state in LLFacebookConnect and handle it consistently and transparently from the public interface
Diffstat (limited to 'indra/newview/llfacebookconnect.h')
-rw-r--r-- | indra/newview/llfacebookconnect.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 37b4e2bc94..e719314920 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -41,12 +41,19 @@ class LLFacebookConnect : public LLSingleton<LLFacebookConnect> { LOG_CLASS(LLFacebookConnect); public: + enum EConnectionState + { + FB_NOT_CONNECTED = 0, + FB_CONNECTION_IN_PROGRESS = 1, + FB_CONNECTED = 2, + FB_CONNECTION_FAILED = 3 + }; + typedef boost::function<void(bool ok)> share_callback_t; - void connectToFacebook(const std::string& auth_code = ""); - void disconnectFromFacebook(); - void tryToReconnectToFacebook(); - void getConnectionToFacebook(); + void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use. + void disconnectFromFacebook(); // Disconnect from the FBC service. + void getConnectionToFacebook(); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). void loadFacebookFriends(); void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); @@ -62,21 +69,20 @@ public: void storeContent(const LLSD& content); const LLSD& getContent() const; - void setConnected(bool connected) { mConnectedToFbc = connected; } - bool getConnected() { return mConnectedToFbc; } + void setConnectionState(EConnectionState connection_state) { mConnectionState = connection_state; } + bool isConnected() { return (mConnectionState == FB_CONNECTED); } S32 generation() { return mGeneration; } void openFacebookWeb(std::string url); private: - friend class LLSingleton<LLFacebookConnect>; LLFacebookConnect(); ~LLFacebookConnect() {}; std::string getFacebookConnectURL(const std::string& route = ""); - bool mConnectedToFbc; + EConnectionState mConnectionState; LLSD mContent; S32 mGeneration; |