summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llpanelpeople.cpp42
-rw-r--r--indra/newview/llpanelpeople.h2
2 files changed, 40 insertions, 4 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 8f138a821a..01d68cb9a0 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -896,7 +896,7 @@ void LLPanelPeople::updateFbcTestList()
{
// success! :)
if (title[1] == ')')
- {
+ {
mFbcTestText->setText(std::string("okay, now we can get the list of friends!"));
}
// failure :(
@@ -1665,11 +1665,47 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
}
}
-void LLPanelPeople::onLoginFbcButtonClicked()
+class LLFacebookLogin : public LLHTTPClient::Responder
{
+public:
+
+ LLPanelPeople * mPanelPeople;
+
+ LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+
+ /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
+ {
+ // in case of invalid characters, the avatar picker returns a 400
+ // just set it to process so it displays 'not found'
+ if (isGoodStatus(status) || status == 400)
+ {
+ llinfos << content << llendl;
+
+ bool has_token = content["has_access_token"].asBoolean();
+
+ //use the token to pull down graph data
+ if(has_token)
+ {
+
+ }
+ //request user to login
+ else
+ {
LLFloaterWebContent::Params p;
p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
- openFacebookWeb(p);
+ mPanelPeople->openFacebookWeb(p);
+}
+ }
+ else
+ {
+ llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
+ }
+ }
+};
+
+void LLPanelPeople::onLoginFbcButtonClicked()
+{
+ LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this));
}
void LLPanelPeople::onFacebookAppRequestClicked()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 39cdbc9bd7..dadd273603 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -55,6 +55,7 @@ public:
// Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
// when voice is available
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
+ void openFacebookWeb(LLFloaterWebContent::Params& p);
// internals
class Updater;
@@ -118,7 +119,6 @@ private:
void onLoginFbcButtonClicked();
void onFacebookAppRequestClicked();
void onFacebookAppSendClicked();
- void openFacebookWeb(LLFloaterWebContent::Params& p);
//returns false only if group is "none"
bool isRealGroup();