diff options
author | Merov Linden <merov@lindenlab.com> | 2013-08-12 20:28:59 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-08-12 20:28:59 -0700 |
commit | b338aa42c61b3a31be6e4e486fd8d4acf482e990 (patch) | |
tree | 7f869a0ec4634a1ba31e97264da901a6c1e64566 | |
parent | abc2abf45dbe69daa0130ad823ca7184acc9d8df (diff) | |
parent | d0e964289ec9888686619c4edd756edd622ca214 (diff) |
Pull merge from viewer-fbc
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llfacebookconnect.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llfacebookconnect.h | 3 |
3 files changed, 25 insertions, 15 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 20919adc76..bebd1fd9e8 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3465,7 +3465,7 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>http://pdp15.lindenlab.com</string> + <string></string> </map> <key>FastCacheFetchEnabled</key> <map> diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 5551acff0d..0a4fefbd24 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -119,7 +119,6 @@ public: { LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; - // Grab some graph data now that we are connected LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); } else if (status != 302) @@ -324,7 +323,8 @@ LLFacebookConnect::LLFacebookConnect() mInfo(), mContent(), mRefreshInfo(false), - mRefreshContent(false) + mRefreshContent(false), + mReadFromMaster(false) { } @@ -346,7 +346,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url) //LLUrlAction::openURLExternal(url); } -std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) +std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); @@ -363,6 +363,10 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) //End removable part std::string url = sFacebookConnectUrl + route; + if (include_read_from_master && mReadFromMaster) + { + url += "?read_from_master=true"; + } return url; } @@ -384,10 +388,10 @@ void LLFacebookConnect::disconnectFromFacebook() void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect), - LLSD(), timeout, follow_redirects); + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection", true), new LLFacebookConnectedResponder(auto_connect), + LLSD(), timeout, follow_redirects); } void LLFacebookConnect::loadFacebookInfo() @@ -396,7 +400,7 @@ void LLFacebookConnect::loadFacebookInfo() { const bool follow_redirects = false; const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), + LLHTTPClient::get(getFacebookConnectURL("/info", true), new LLFacebookInfoResponder(), LLSD(), timeout, follow_redirects); } } @@ -407,7 +411,7 @@ void LLFacebookConnect::loadFacebookFriends() { const bool follow_redirects = false; const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), + LLHTTPClient::get(getFacebookConnectURL("/friends", true), new LLFacebookFriendsResponder(), LLSD(), timeout, follow_redirects); } } @@ -427,7 +431,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/checkin", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) @@ -437,7 +441,7 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri body["caption"] = caption; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/photo", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption) @@ -490,7 +494,7 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std: memcpy(data, body.str().data(), size); // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers); + LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo", true), data, size, new LLFacebookShareResponder(), headers); } void LLFacebookConnect::updateStatus(const std::string& message) @@ -499,7 +503,7 @@ void LLFacebookConnect::updateStatus(const std::string& message) body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/wall", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::storeInfo(const LLSD& info) @@ -548,6 +552,7 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c { if(connection_state == FB_CONNECTED) { + mReadFromMaster = true; setConnected(true); setDataDirty(); } @@ -555,6 +560,10 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c { setConnected(false); } + else if(connection_state == FB_POSTED) + { + mReadFromMaster = false; + } if (mConnectionState != connection_state) { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 77c26842de..a77ac24167 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -88,7 +88,7 @@ private: LLFacebookConnect(); ~LLFacebookConnect() {}; - std::string getFacebookConnectURL(const std::string& route = ""); + std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false); EConnectionState mConnectionState; BOOL mConnected; @@ -96,6 +96,7 @@ private: LLSD mContent; bool mRefreshInfo; bool mRefreshContent; + bool mReadFromMaster; static boost::scoped_ptr<LLEventPump> sStateWatcher; static boost::scoped_ptr<LLEventPump> sInfoWatcher; |