summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-08-13 01:47:20 +0100
committerCho <cho@lindenlab.com>2013-08-13 01:47:20 +0100
commitd0e964289ec9888686619c4edd756edd622ca214 (patch)
tree2e0bfdeff68da5d3b77f686106ed13b777032eb5 /indra/newview/llfacebookconnect.cpp
parent481abb13812214d7d5f1124f8eb80f1cc1b08c19 (diff)
added read_from_master parameter for ACME-829
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rw-r--r--indra/newview/llfacebookconnect.cpp35
1 files changed, 22 insertions, 13 deletions
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)
{