From 64c239fbf7f1fb668d94b9c26f413858058b8270 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 26 Feb 2014 00:32:49 +0000 Subject: Added machine tags to Flickr uploads for ACME-1323 --- indra/newview/llfloaterflickr.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 61f1487d4b..8c3db46d76 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -49,6 +49,7 @@ #include "llviewermedia.h" #include "lltabcontainer.h" #include "llviewerparcelmgr.h" +#include "llviewerregion.h" static LLRegisterPanelClassWrapper t_panel_photo("llflickrphotopanel"); static LLRegisterPanelClassWrapper t_panel_account("llflickraccountpanel"); @@ -56,6 +57,7 @@ static LLRegisterPanelClassWrapper t_panel_account("llflic const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=flickr&utm_medium=photo&utm_campaign=slshare"; const std::string DEFAULT_TAG_TEXT = "secondlife "; +const std::string FLICKR_MACHINE_TAGS_NAMESPACE = "secondlife"; /////////////////////////// //LLFlickrPhotoPanel/////// @@ -318,6 +320,26 @@ void LLFlickrPhotoPanel::sendPhoto() description = slurl_string; else description = description + "\n\n" + slurl_string; + + // Also add special "machine tags" with location metadata + const LLVector3& agent_pos_region = gAgent.getPositionAgent(); + LLViewerRegion* region = gAgent.getRegion(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (region && parcel) + { + S32 pos_x = S32(agent_pos_region.mV[VX]); + S32 pos_y = S32(agent_pos_region.mV[VY]); + S32 pos_z = S32(agent_pos_region.mV[VZ]); + + std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); + std::string region_name = region->getName(); + + tags += llformat(" \"%s:region=%s\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), region_name.c_str()); + tags += llformat(" \"%s:parcel=%s\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), parcel_name.c_str()); + tags += llformat(" \"%s:x=%d\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), pos_x); + tags += llformat(" \"%s:y=%d\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), pos_y); + tags += llformat(" \"%s:z=%d\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), pos_z); + } } // Get the content rating -- cgit v1.2.3 From d80a812ffc0e70dcb049aefca69f2a4f8bbd4ab8 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 26 Feb 2014 20:21:05 +0000 Subject: Changed SLShare photo upload filename to Untitled for the sake of default Flickr title --- indra/newview/llfacebookconnect.cpp | 2 +- indra/newview/llflickrconnect.cpp | 2 +- indra/newview/lltwitterconnect.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e3ddb31935..ec7d0f7c50 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -518,7 +518,7 @@ void LLFacebookConnect::sharePhoto(LLPointer image, const std: << caption << "\r\n"; body << "--" << boundary << "\r\n" - << "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot." << imageFormat << "\"\r\n" + << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n" << "Content-Type: image/" << imageFormat << "\r\n\r\n"; // Insert the image data. diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp index c09e738a26..1898842478 100644 --- a/indra/newview/llflickrconnect.cpp +++ b/indra/newview/llflickrconnect.cpp @@ -401,7 +401,7 @@ void LLFlickrConnect::uploadPhoto(LLPointer image, const std:: << safety_level << "\r\n"; body << "--" << boundary << "\r\n" - << "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot." << imageFormat << "\"\r\n" + << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n" << "Content-Type: image/" << imageFormat << "\r\n\r\n"; // Insert the image data. diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp index 350da84f69..cfdbca1b81 100644 --- a/indra/newview/lltwitterconnect.cpp +++ b/indra/newview/lltwitterconnect.cpp @@ -386,7 +386,7 @@ void LLTwitterConnect::uploadPhoto(LLPointer image, const std: << status << "\r\n"; body << "--" << boundary << "\r\n" - << "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot." << imageFormat << "\"\r\n" + << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n" << "Content-Type: image/" << imageFormat << "\r\n\r\n"; // Insert the image data. -- cgit v1.2.3