Pull merge from viewer-fbc

meow-7.2.2
Merov Linden 2013-06-07 18:07:59 -07:00
commit e110d87a63
7 changed files with 67 additions and 4 deletions

View File

@ -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++;

View File

@ -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

View File

@ -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;

View File

@ -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));
}

View File

@ -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 * );

View File

@ -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..."

View File

@ -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>