ACME-344 : Menu hooked up. Readded the missing completedHeader() methods in responder that I mistakenly took out during the refactor.
parent
cc87c67852
commit
dbef09a2bb
|
|
@ -31,12 +31,13 @@
|
|||
|
||||
#include "llagent.h"
|
||||
#include "llcallingcard.h" // for LLAvatarTracker
|
||||
//#include "llcommandhandler.h"
|
||||
#include "llcommandhandler.h"
|
||||
#include "llhttpclient.h"
|
||||
#include "llurlaction.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/*
|
||||
|
||||
class LLFacebookConnectHandler : public LLCommandHandler
|
||||
{
|
||||
public:
|
||||
|
|
@ -59,7 +60,6 @@ public:
|
|||
}
|
||||
};
|
||||
LLFacebookConnectHandler gFacebookConnectHandler;
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
@ -83,6 +83,15 @@ public:
|
|||
LL_WARNS("FacebookConnect") << "Failed to get a 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"]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -163,6 +172,14 @@ public:
|
|||
LL_WARNS("FacebookConnect") << "Failed to get a 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"]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -175,6 +192,11 @@ LLFacebookConnect::LLFacebookConnect()
|
|||
{
|
||||
}
|
||||
|
||||
void LLFacebookConnect::openFacebookWeb(std::string url)
|
||||
{
|
||||
LLUrlAction::openURLExternal(url);
|
||||
}
|
||||
|
||||
std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
|
||||
{
|
||||
//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public:
|
|||
bool getConnected() { return mConnectedToFbc; }
|
||||
S32 generation() { return mGeneration; }
|
||||
|
||||
void openFacebookWeb(std::string url);
|
||||
private:
|
||||
|
||||
friend class LLSingleton<LLFacebookConnect>;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@
|
|||
#include "llsociallist.h"
|
||||
#include "llspeakers.h"
|
||||
#include "llfloaterwebcontent.h"
|
||||
#include "llurlaction.h"
|
||||
|
||||
#define FRIEND_LIST_UPDATE_TIMEOUT 0.5
|
||||
#define NEARBY_LIST_UPDATE_INTERVAL 1
|
||||
|
|
@ -1645,13 +1644,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
|
|||
return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
|
||||
}
|
||||
|
||||
/*
|
||||
void LLPanelPeople::openFacebookWeb(std::string url)
|
||||
{
|
||||
LLUrlAction::openURLExternal(url);
|
||||
}
|
||||
*/
|
||||
|
||||
void LLPanelPeople::addTestParticipant()
|
||||
{
|
||||
std::string suffix("Aa");
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ public:
|
|||
|
||||
static void idle(void * user_data);
|
||||
|
||||
// void openFacebookWeb(std::string url);
|
||||
void addTestParticipant();
|
||||
void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
#include "lldaycyclemanager.h"
|
||||
#include "lldebugview.h"
|
||||
#include "llenvmanager.h"
|
||||
#include "llfacebookconnect.h"
|
||||
#include "llfilepicker.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloaterbuy.h"
|
||||
|
|
@ -5970,6 +5971,21 @@ void handle_report_abuse()
|
|||
LLFloaterReporter::showFromMenu(COMPLAINT_REPORT);
|
||||
}
|
||||
|
||||
void handle_facebook_connect()
|
||||
{
|
||||
if (LLFacebookConnect::instance().getConnected())
|
||||
{
|
||||
LLFacebookConnect::instance().disconnectFromFacebook();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFacebookConnect::instance().getConnectionToFacebook();
|
||||
}
|
||||
}
|
||||
|
||||
//bool is_facebook_connected();
|
||||
|
||||
|
||||
void handle_buy_currency()
|
||||
{
|
||||
LLBuyCurrencyHTML::openCurrencyFloater();
|
||||
|
|
@ -8719,4 +8735,7 @@ void initialize_menus()
|
|||
view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");
|
||||
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
|
||||
view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
|
||||
|
||||
// Facebook Connect
|
||||
commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,10 @@ bool enable_pay_object();
|
|||
bool enable_buy_object();
|
||||
bool handle_go_to();
|
||||
|
||||
// Facebook Connect
|
||||
void handle_facebook_connect();
|
||||
//bool is_facebook_connected();
|
||||
|
||||
// Export to XML or Collada
|
||||
void handle_export_selected( void * );
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
label="Connect to Facebook..."
|
||||
name="ConnectToFacebook">
|
||||
<menu_item_call.on_click
|
||||
function="People.loginFBC" />
|
||||
function="Facebook.Connect" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator/>
|
||||
<menu_item_call
|
||||
|
|
|
|||
Loading…
Reference in New Issue