ACME-381 : Implement experimental checkin feature (used to test publish_actions permissions workflow)
parent
7ba7f6d3c2
commit
53ed2e4ac6
|
|
@ -94,6 +94,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
|
||||
|
|
@ -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++;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ private:
|
|||
void onFacebookAppRequestClicked();
|
||||
void onFacebookAppSendClicked();
|
||||
void onFacebookTestAddClicked();
|
||||
void onFacebookCheckinClicked();
|
||||
|
||||
bool onFriendsViewSortMenuItemCheck(const LLSD& userdata);
|
||||
bool onRecentViewSortMenuItemCheck(const LLSD& userdata);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
Loading…
Reference in New Issue