summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-07-01 23:27:52 +0100
committerCho <cho@lindenlab.com>2013-07-01 23:27:52 +0100
commitfa1e0e486a2c32911e6bfe9d72264c3d9ebe1d9f (patch)
tree0203878b7e0b47faa4c9e6b8958dc84e65dd701b
parent90b5bd51486e8a5cb5072974c331d1ed61b7e08b (diff)
Removed image URL callback from LLWebProfile for ACME-657
-rw-r--r--indra/newview/llfacebookconnect.cpp2
-rwxr-xr-xindra/newview/llwebprofile.cpp44
-rwxr-xr-xindra/newview/llwebprofile.h5
3 files changed, 10 insertions, 41 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index dc450aab7a..24100a9a55 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -101,7 +101,6 @@ public:
// Grab some graph data now that we are connected
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
- LLFacebookConnect::instance().loadFacebookFriends();
}
else
{
@@ -204,7 +203,6 @@ public:
// Grab some graph data if already connected
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
- LLFacebookConnect::instance().loadFacebookFriends();
}
else
{
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 6923724de2..69255af179 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder
LOG_CLASS(LLWebProfileResponders::ConfigResponder);
public:
- ConfigResponder(LLPointer<LLImageFormatted> imagep, LLWebProfile::image_url_callback_t cb)
- : mImagep(imagep), mImageCallback(cb)
+ ConfigResponder(LLPointer<LLImageFormatted> imagep)
+ : mImagep(imagep)
{
}
@@ -113,12 +113,11 @@ public:
// Do the actual image upload using the configuration.
LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
- LLWebProfile::post(mImagep, config, upload_url, mImageCallback);
+ LLWebProfile::post(mImagep, config, upload_url);
}
private:
LLPointer<LLImageFormatted> mImagep;
- LLWebProfile::image_url_callback_t mImageCallback;
};
///////////////////////////////////////////////////////////////////////////////
@@ -128,22 +127,6 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder);
public:
- PostImageRedirectResponder(LLWebProfile::image_url_callback_t cb)
- : mImageCallback(cb)
- {
- }
-
- /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- if (status == 200)
- {
- std::string image_url = content.get("Location");
- llinfos << "Image uploaded to " << image_url << llendl;
- if (!mImageCallback.empty() && !image_url.empty())
- mImageCallback(image_url);
- }
- }
-
/*virtual*/ void completedRaw(
U32 status,
const std::string& reason,
@@ -165,9 +148,6 @@ public:
LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl;
LLWebProfile::reportImageUploadStatus(true);
}
-
-private:
- LLWebProfile::image_url_callback_t mImageCallback;
};
@@ -178,11 +158,6 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
LOG_CLASS(LLWebProfileResponders::PostImageResponder);
public:
- PostImageResponder(LLWebProfile::image_url_callback_t cb)
- : mImageCallback(cb)
- {
- }
-
/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
{
// Viewer seems to fail to follow a 303 redirect on POST request
@@ -194,7 +169,7 @@ public:
headers["Cookie"] = LLWebProfile::getAuthCookie();
const std::string& redir_url = content["location"];
LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl;
- LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCallback), headers);
+ LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(), headers);
}
else
{
@@ -210,9 +185,6 @@ public:
const LLIOPipe::buffer_ptr_t& buffer)
{
}
-
-private:
- LLWebProfile::image_url_callback_t mImageCallback;
};
///////////////////////////////////////////////////////////////////////////////
@@ -222,7 +194,7 @@ std::string LLWebProfile::sAuthCookie;
LLWebProfile::status_callback_t LLWebProfile::mStatusCallback;
// static
-void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, LLWebProfile::image_url_callback_t cb)
+void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location)
{
// Get upload configuration data.
std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config");
@@ -232,7 +204,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
LLSD headers = LLViewerMedia::getHeaders();
headers["Cookie"] = getAuthCookie();
- LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, cb), headers);
+ LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers);
}
// static
@@ -243,7 +215,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie)
}
// static
-void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, LLWebProfile::image_url_callback_t cb)
+void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url)
{
if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
{
@@ -309,7 +281,7 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
memcpy(data, body.str().data(), size);
// Send request, successful upload will trigger posting metadata.
- LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(cb), headers);
+ LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(), headers);
}
// static
diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h
index 63dccf80af..10279bffac 100755
--- a/indra/newview/llwebprofile.h
+++ b/indra/newview/llwebprofile.h
@@ -48,9 +48,8 @@ class LLWebProfile
public:
typedef boost::function<void(bool ok)> status_callback_t;
- typedef boost::function<void(const std::string& image_url)> image_url_callback_t;
- static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t());
+ static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location);
static void setAuthCookie(const std::string& cookie);
static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; }
@@ -59,7 +58,7 @@ private:
friend class LLWebProfileResponders::PostImageResponder;
friend class LLWebProfileResponders::PostImageRedirectResponder;
- static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, image_url_callback_t cb);
+ static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url);
static void reportImageUploadStatus(bool ok);
static std::string getAuthCookie();