summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-06-07 18:07:59 -0700
committerMerov Linden <merov@lindenlab.com>2013-06-07 18:07:59 -0700
commite110d87a63cfb4c50fe60930eb6cfcaa1b3d41b8 (patch)
treea4aca66fdf1b7ed01db0024a57a2cc2da09fc11c /indra/newview
parent2b138990f8531df51f38e5e15309e1c92483dd05 (diff)
parentb6180c6a08fc25cbacfded7ba048c71b96292729 (diff)
Pull merge from viewer-fbc
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfacebookconnect.cpp9
-rw-r--r--indra/newview/llfacebookconnect.h3
-rwxr-xr-xindra/newview/llnotificationscripthandler.cpp3
-rwxr-xr-xindra/newview/llviewermenu.cpp20
-rwxr-xr-xindra/newview/llviewermenu.h5
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_viewer.xml10
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml21
7 files changed, 67 insertions, 4 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 4c9de17e2e..1986814815 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -352,6 +352,15 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri
LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder());
}
+void LLFacebookConnect::updateStatus(const std::string& message)
+{
+ LLSD body;
+ body["message"] = message;
+
+ // Note: we can use that route for different publish action. We should be able to use the same responder.
+ LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder());
+}
+
void LLFacebookConnect::storeContent(const LLSD& content)
{
mGeneration++;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 2dba182267..58e2707ba3 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -49,6 +49,7 @@ public:
void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture);
void sharePhoto(const std::string& image_url, const std::string& caption);
+ void updateStatus(const std::string& message);
void clearContent();
void storeContent(const LLSD& content);
@@ -69,7 +70,7 @@ private:
bool mConnectedToFbc;
LLSD mContent;
- S32 mGeneration;
+ S32 mGeneration;
};
#endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index 08c98e4f28..2854962922 100755
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -35,6 +35,9 @@
#include "llnotificationmanager.h"
#include "llnotifications.h"
#include "llscriptfloater.h"
+#include "llfacebookconnect.h"
+#include "llavatarname.h"
+#include "llavatarnamecache.h"
using namespace LLNotificationsUI;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 1bfa5ac2d1..67460c4bc6 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6005,6 +6005,23 @@ void handle_facebook_checkin()
LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, "");
}
+bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0)
+ {
+ std::string message = response["message"].asString();
+ if (!message.empty())
+ LLFacebookConnect::instance().updateStatus(message);
+ }
+ return false;
+}
+
+void handle_facebook_status()
+{
+ LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2));
+}
+
void handle_buy_currency()
{
LLBuyCurrencyHTML::openCurrencyFloater();
@@ -8761,4 +8778,7 @@ void initialize_menus()
// Facebook Checkin
commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
+
+ // Facebook Status Update
+ commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status));
}
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 9c3f13f843..e71beef10d 100755
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -138,9 +138,12 @@ bool handle_go_to();
// Facebook Connect
void handle_facebook_connect();
-//Facebook Checkin
+// Facebook Checkin
void handle_facebook_checkin();
+// Facebook Status Update
+void handle_facebook_status();
+
// Export to XML or Collada
void handle_export_selected( void * );
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index e67350722d..ebf21ffd1c 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -24,11 +24,17 @@
function="Facebook.EnableConnect" />
</menu_item_call>
<menu_item_call
- label="Check in to Facebook"
+ label="Check in to Facebook..."
name="CheckinToFacebook">
<menu_item_call.on_click
function="Facebook.Checkin" />
- </menu_item_call>
+ </menu_item_call>
+ <menu_item_call
+ label="Update status on Facebook..."
+ name="UpdateStatusOnFacebook">
+ <menu_item_call.on_click
+ function="Facebook.UpdateStatus" />
+ </menu_item_call>
<menu_item_separator/>
<menu_item_call
label="Appearance..."
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index b0203b5694..d69f1bb4d5 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -10135,4 +10135,25 @@ Cannot create large prims that intersect other players. Please re-try when othe
yestext="OK"/>
</notification>
+ <notification
+ icon="alertmodal.tga"
+ name="FacebookUpdateStatus"
+ type="alertmodal">
+ What's on your mind? (asks Facebook)
+ <tag>confirm</tag>
+ <form name="form">
+ <input name="message" type="text">
+ </input>
+ <button
+ default="true"
+ index="0"
+ name="OK"
+ text="OK"/>
+ <button
+ index="1"
+ name="Cancel"
+ text="Cancel"/>
+ </form>
+ </notification>
+
</notifications>