diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfacebookconnect.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llfacebookconnect.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewermenu.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 2 |
7 files changed, 50 insertions, 13 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"); diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 691aaa9131..8036c9ce3e 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -55,6 +55,7 @@ public: bool getConnected() { return mConnectedToFbc; } S32 generation() { return mGeneration; } + void openFacebookWeb(std::string url); private: friend class LLSingleton<LLFacebookConnect>; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 542597f98b..ba7015faf5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -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"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 6b5514deaf..be780bec5e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -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); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index beca08203f..bb9ad8c606 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -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)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 143420e227..b916d95b7a 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -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 * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 9ce360415c..b34816fb14 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -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 |