summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rw-r--r--indra/newview/llfacebookconnect.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 7f8e3afe89..39aa82dc7a 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -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");