diff options
author | Cho <cho@lindenlab.com> | 2013-06-12 01:16:27 +0100 |
---|---|---|
committer | Cho <cho@lindenlab.com> | 2013-06-12 01:16:27 +0100 |
commit | 933debfc10d09d1d25fd196597904fc9753b4cb0 (patch) | |
tree | 52701d571d736e67683df1f894421d6e5438429d /indra/newview/llpanelsnapshotfacebook.cpp | |
parent | e3f093a87157c012ab4e9d378cc26876b7b91900 (diff) |
cleaned up FBC snapshot feature and made it work with new direct upload route on FBC API
Diffstat (limited to 'indra/newview/llpanelsnapshotfacebook.cpp')
-rwxr-xr-x | indra/newview/llpanelsnapshotfacebook.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 7c8fc044c0..30ef5f326c 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -39,6 +39,8 @@ #include "llwebprofile.h" #include "llfacebookconnect.h" +#include "llslurl.h" +#include "llagentui.h" /** * Posts a snapshot to the resident Facebook account. @@ -113,12 +115,19 @@ void LLPanelSnapshotFacebook::onSend() { std::string caption = getChild<LLUICtrl>("caption")->getValue().asString(); bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean(); - - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); + + if (add_location) + { + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + if (caption.empty()) + caption = slurl.getSLURLString(); + else + caption = caption + " " + slurl.getSLURLString(); + } + LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption); + //LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); LLFloaterSnapshot::postSave(); - - // test with a placeholder image, until we can figure out a way to grab the uploaded image url - LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) |