diff options
| author | Merov Linden <merov@lindenlab.com> | 2013-05-20 19:32:55 -0700 | 
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2013-05-20 19:32:55 -0700 | 
| commit | 53ed2e4ac67088dce27f4c391d3e980e2d63154b (patch) | |
| tree | bcf655df4baa6b8befb58c28bf90fe4a9e697b46 /indra | |
| parent | 7ba7f6d3c2db80e412e5658a5c6ce8755b75997b (diff) | |
ACME-381 : Implement experimental checkin feature (used to test publish_actions permissions workflow)
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfacebookconnect.cpp | 43 | ||||
| -rw-r--r-- | indra/newview/llfacebookconnect.h | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelpeople.cpp | 13 | ||||
| -rw-r--r-- | indra/newview/llpanelpeople.h | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_gear_fbc.xml | 7 | 
5 files changed, 65 insertions, 0 deletions
| diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 39aa82dc7a..eb70cf4d10 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -96,6 +96,35 @@ public:  ///////////////////////////////////////////////////////////////////////////////  // +class LLFacebookPostResponder : public LLHTTPClient::Responder +{ +	LOG_CLASS(LLFacebookPostResponder); +public: +     +	virtual void completed(U32 status, const std::string& reason, const LLSD& content) +	{ +		if (isGoodStatus(status)) +		{ +			LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL; +		} +		else +		{ +			LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL; +		} +	} +     +    void completedHeader(U32 status, const std::string& reason, const LLSD& content) +    { +        if (status == 302) +        { +            LLFacebookConnect::instance().openFacebookWeb(content["location"]); +        } +    } +     +}; + +/////////////////////////////////////////////////////////////////////////////// +//  class LLFacebookDisconnectResponder : public LLHTTPClient::Responder  {  	LOG_CLASS(LLFacebookDisconnectResponder); @@ -247,6 +276,20 @@ void LLFacebookConnect::loadFacebookFriends()  					  LLSD(), timeout, follow_redirects);  } +void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url) +{ +    // Note: We need to improve the API support to provide all the relevant data if possible +    // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html +	LLSD body; +	if (!message.empty()) +		body["message"] = message; +	if (!url.empty()) +		body["link"] = url; +     +    // Note: we can use that route for different publish action. We should be able to use the same responder. +	LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder()); +} +  void LLFacebookConnect::storeContent(const LLSD& content)  {      mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 8036c9ce3e..f151dd95c1 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,6 +46,7 @@ public:      void getConnectionToFacebook();      void loadFacebookFriends(); +    void postCheckinMessage(const std::string& message, const std::string& url);      void clearContent();  	void storeContent(const LLSD& content); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 0847878fb4..e0b1c3abba 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -76,6 +76,9 @@  #include "llspeakers.h"  #include "llfloaterwebcontent.h" +#include "llagentui.h" +#include "llslurl.h" +  #define FRIEND_LIST_UPDATE_TIMEOUT	0.5  #define NEARBY_LIST_UPDATE_INTERVAL 1  #define FBCTEST_LIST_UPDATE_INTERVAL 0.25 @@ -568,6 +571,7 @@ LLPanelPeople::LLPanelPeople()  	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));  	mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this));  	mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); +	mCommitCallbackRegistrar.add("People.testFBCCheckin", boost::bind(&LLPanelPeople::onFacebookCheckinClicked, this));  	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));  	mCommitCallbackRegistrar.add("People.AddFriendWizard",	boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked,	this)); @@ -1716,6 +1720,15 @@ void LLPanelPeople::onLoginFbcButtonClicked()  	}  } +void LLPanelPeople::onFacebookCheckinClicked() +{ +    // Get the local SLURL  +	LLSLURL slurl; +	LLAgentUI::buildSLURL(slurl); + +    LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString()); +} +  void LLPanelPeople::onFacebookAppRequestClicked()  {  } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index be780bec5e..f617517392 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -123,6 +123,7 @@ private:  	void					onFacebookAppRequestClicked();  	void					onFacebookAppSendClicked();  	void					onFacebookTestAddClicked(); +    void                    onFacebookCheckinClicked();  	bool					onFriendsViewSortMenuItemCheck(const LLSD& userdata);  	bool					onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index d73cee344b..2c341b6ecc 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -41,4 +41,11 @@      <menu_item_check.on_click       function="People.testaddFBCFolderView"/>    </menu_item_check>   +  <menu_item_check +   label="Facebook post checkin message" +   layout="topleft" +   name="Facebook Checkin"> +   <menu_item_check.on_click +    function="People.testFBCCheckin"/> +  </menu_item_check>  </toggleable_menu>
\ No newline at end of file | 
