From 4d162e1ec2cd716f40666056bb9e2710958e3360 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 5 Jun 2013 23:52:34 +0100 Subject: added callback to post photo with actual image url --- indra/newview/llpanelsnapshotfacebook.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelsnapshotfacebook.cpp') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 200c64f16b..954941274a 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -64,6 +64,7 @@ private: /*virtual*/ void updateControls(const LLSD& info); void onSend(); + void onImageUploaded(const std::string& image_url, const std::string& caption); }; static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); @@ -98,9 +99,17 @@ void LLPanelSnapshotFacebook::onSend() std::string caption = getChild("caption")->getValue().asString(); bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2)); 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); + //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& image_url, const std::string& caption) +{ + if (!image_url.empty()) + { + LLFacebookConnect::instance().sharePhoto(image_url, caption); + } } -- cgit v1.2.3 From 9232d919c8571743d9f5c899b80e2807f131f4d3 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 6 Jun 2013 00:09:59 +0100 Subject: removed unnecessary passing of image caption --- indra/newview/llpanelsnapshotfacebook.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelsnapshotfacebook.cpp') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 954941274a..9bea5aa796 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -64,7 +64,7 @@ private: /*virtual*/ void updateControls(const LLSD& info); void onSend(); - void onImageUploaded(const std::string& image_url, const std::string& caption); + void onImageUploaded(const std::string& caption, const std::string& image_url); }; static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); @@ -99,14 +99,14 @@ void LLPanelSnapshotFacebook::onSend() std::string caption = getChild("caption")->getValue().asString(); bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2)); + 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& image_url, const std::string& caption) +void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) { if (!image_url.empty()) { -- cgit v1.2.3 From 58177c83b0a81aae363bccc0e5ac2312b083341d Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 6 Jun 2013 00:17:33 +0100 Subject: uncommented the placeholder image upload --- indra/newview/llpanelsnapshotfacebook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelsnapshotfacebook.cpp') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 9bea5aa796..56b1f921b9 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -103,7 +103,7 @@ void LLPanelSnapshotFacebook::onSend() 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); + 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) -- cgit v1.2.3