diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfacebookconnect.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llfacebookconnect.h | 3 | ||||
-rwxr-xr-x | indra/newview/llnotificationscripthandler.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llviewermenu.h | 5 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_viewer.xml | 8 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 21 |
7 files changed, 66 insertions, 3 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 668ba04406..79e8d98668 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -323,6 +323,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 e451276e0a..ebf21ffd1c 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -28,7 +28,13 @@ 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 9d1973f267..31b0d20bd8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10124,4 +10124,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> |