summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelsnapshotpostcard.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-04-01 06:18:49 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-04-01 06:18:49 +0300
commit0ff6fa576a653597d0e9dda7f1de5f568e8d6829 (patch)
tree21e1b8f1253eedc1cc844553dcf46fef390d5a7d /indra/newview/llpanelsnapshotpostcard.cpp
parenta04341efaa63cd6bc47db25c1e4b4bf1e31d90a8 (diff)
parenteb413ec41e6ee49055464a636a73a7243c172c67 (diff)
Merged in lindenlab/viewer-bear
Diffstat (limited to 'indra/newview/llpanelsnapshotpostcard.cpp')
-rw-r--r--indra/newview/llpanelsnapshotpostcard.cpp52
1 files changed, 37 insertions, 15 deletions
diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp
index 8e37b1418c..e4f39aac04 100644
--- a/indra/newview/llpanelsnapshotpostcard.cpp
+++ b/indra/newview/llpanelsnapshotpostcard.cpp
@@ -40,6 +40,7 @@
#include "llpostcard.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llviewerwindow.h"
+#include "llviewerregion.h"
#include <boost/regex.hpp>
@@ -67,7 +68,8 @@ private:
/*virtual*/ void updateControls(const LLSD& info);
bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response);
- void sendPostcard();
+ static void sendPostcardFinished(LLSD result);
+ void sendPostcard();
void onMsgFormFocusRecieved();
void onFormatComboCommit(LLUICtrl* ctrl);
@@ -166,24 +168,44 @@ bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notificati
}
-void LLPanelSnapshotPostcard::sendPostcard()
+void LLPanelSnapshotPostcard::sendPostcardFinished(LLSD result)
{
- std::string to(getChild<LLUICtrl>("to_form")->getValue().asString());
- std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString());
+ LL_WARNS() << result << LL_ENDL;
- LLSD postcard = LLSD::emptyMap();
- postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue();
- postcard["to"] = to;
- postcard["from"] = mAgentEmail;
- postcard["name"] = getChild<LLUICtrl>("name_form")->getValue().asString();
- postcard["subject"] = subject;
- postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString();
- LLPostCard::send(LLFloaterSnapshot::getImageData(), postcard);
+ std::string state = result["state"].asString();
- // Give user feedback of the event.
- gViewerWindow->playSnapshotAnimAndSound();
+ LLPostCard::reportPostResult((state == "complete"));
+}
- LLFloaterSnapshot::postSave();
+
+void LLPanelSnapshotPostcard::sendPostcard()
+{
+ // upload the image
+ std::string url = gAgent.getRegion()->getCapability("SendPostcard");
+ if (!url.empty())
+ {
+ LLResourceUploadInfo::ptr_t uploadInfo(new LLPostcardUploadInfo(
+ mAgentEmail,
+ getChild<LLUICtrl>("name_form")->getValue().asString(),
+ getChild<LLUICtrl>("to_form")->getValue().asString(),
+ getChild<LLUICtrl>("subject_form")->getValue().asString(),
+ getChild<LLUICtrl>("msg_form")->getValue().asString(),
+ LLFloaterSnapshot::getPosTakenGlobal(),
+ LLFloaterSnapshot::getImageData(),
+ boost::bind(&LLPanelSnapshotPostcard::sendPostcardFinished, _4)));
+
+ LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo);
+ }
+ else
+ {
+ LL_WARNS() << "Postcards unavailable in this region." << LL_ENDL;
+ }
+
+
+ // Give user feedback of the event.
+ gViewerWindow->playSnapshotAnimAndSound();
+
+ LLFloaterSnapshot::postSave();
}
void LLPanelSnapshotPostcard::onMsgFormFocusRecieved()