From 207db356c21246ca9eb1b255b71623b0a5a4d470 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 03:06:24 +0100 Subject: got it working --- indra/newview/llpanelpeople.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ebf7002fc1..4b4dd27bf2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -893,7 +893,10 @@ void LLPanelPeople::updateFbcTestList() if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) { // get the auth code - std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6); + std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7); + auth_code = auth_code.substr(0, auth_code.length() - 4); + + llinfos << "extracted code " << auth_code << " from url " << url << llendl; // finish authenticating on the server connectToFacebook(auth_code); @@ -1765,7 +1768,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/"); mPanelPeople->openFacebookWeb(p); } } @@ -1814,6 +1817,7 @@ void LLPanelPeople::loadFacebookFriends() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { + llinfos << "attempting to connect to facebook with code " << auth_code << llendl; LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); } @@ -1837,14 +1841,14 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF -- cgit v1.2.3