summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/app_settings/commands.xml10
-rw-r--r--indra/newview/app_settings/toolbars.xml1
-rw-r--r--indra/newview/llfacebookconnect.cpp714
-rw-r--r--indra/newview/llfacebookconnect.h116
-rw-r--r--indra/newview/llfloaterfacebook.cpp1132
-rw-r--r--indra/newview/llfloaterfacebook.h185
-rw-r--r--indra/newview/llfloateroutfitsnapshot.cpp2
-rw-r--r--indra/newview/llfloatersnapshot.cpp5
-rw-r--r--indra/newview/llfloaterwebcontent.cpp22
-rw-r--r--indra/newview/llnotificationscripthandler.cpp1
-rw-r--r--indra/newview/llpanelpeople.cpp86
-rw-r--r--indra/newview/llpanelpeople.h7
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp33
-rw-r--r--indra/newview/llpanelpeoplemenus.h13
-rw-r--r--indra/newview/llpanelsnapshotoptions.cpp15
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp5
-rw-r--r--indra/newview/lltwitterconnect.cpp44
-rw-r--r--indra/newview/llviewerfloaterreg.cpp3
-rw-r--r--indra/newview/llviewermedia.cpp2
-rw-r--r--indra/newview/llviewermenu.cpp1
-rw-r--r--indra/newview/llviewerregion.cpp1
-rw-r--r--indra/newview/skins/default/textures/textures.xml4
-rw-r--r--indra/newview/skins/default/xui/en/floater_facebook.xml95
-rw-r--r--indra/newview/skins/default/xui/en/floater_snapshot.xml12
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml7
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml7
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_friends.xml73
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_photo.xml169
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_place.xml113
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_status.xml130
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml19
-rw-r--r--indra/newview/skins/default/xui/en/panel_snapshot_options.xml17
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml13
-rw-r--r--indra/newview/skins/default/xui/en/widgets/person_view.xml10
35 files changed, 53 insertions, 3018 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 2c52b400e4..46fd0f3fd1 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -201,7 +201,6 @@ set(viewer_SOURCE_FILES
llexperiencelog.cpp
llexternaleditor.cpp
llface.cpp
- llfacebookconnect.cpp
llfasttimerview.cpp
llfavoritesbar.cpp
llfeaturemanager.cpp
@@ -245,7 +244,6 @@ set(viewer_SOURCE_FILES
llfloaterexperiencepicker.cpp
llfloaterexperienceprofile.cpp
llfloaterexperiences.cpp
- llfloaterfacebook.cpp
llfloaterflickr.cpp
llfloaterfonttest.cpp
llfloatergesture.cpp
@@ -828,7 +826,6 @@ set(viewer_HEADER_FILES
llexperiencelog.h
llexternaleditor.h
llface.h
- llfacebookconnect.h
llfasttimerview.h
llfavoritesbar.h
llfeaturemanager.h
@@ -872,7 +869,6 @@ set(viewer_HEADER_FILES
llfloaterexperiencepicker.h
llfloaterexperienceprofile.h
llfloaterexperiences.h
- llfloaterfacebook.h
llfloaterflickr.h
llfloaterfonttest.h
llfloatergesture.h
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 412d3a53b3..cab0c523b2 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -228,16 +228,6 @@
is_running_function="Floater.IsOpen"
is_running_parameters="snapshot"
/>
- <command name="facebook"
- available_in_toybox="true"
- icon="Command_Facebook_Icon"
- label_ref="Command_Facebook_Label"
- tooltip_ref="Command_Facebook_Tooltip"
- execute_function="Floater.ToggleOrBringToFront"
- execute_parameters="facebook"
- is_running_function="Floater.IsOpen"
- is_running_parameters="facebook"
- />
<command name="flickr"
available_in_toybox="true"
icon="Command_Flickr_Icon"
diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index 36e4eb91fd..eec0d81e8b 100644
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -21,7 +21,6 @@
<command name="voice"/>
<command name="minimap"/>
<command name="snapshot"/>
- <command name="facebook"/>
</left_toolbar>
<right_toolbar
button_display_mode="icons_only">
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
deleted file mode 100644
index 43b01fa2f1..0000000000
--- a/indra/newview/llfacebookconnect.cpp
+++ /dev/null
@@ -1,714 +0,0 @@
-/**
- * @file llfacebookconnect.h
- * @author Merov, Cho, Gil
- * @brief Connection to Facebook Service
- *
- * $LicenseInfo:firstyear=2013&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2013, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfacebookconnect.h"
-#include "llflickrconnect.h"
-#include "lltwitterconnect.h"
-
-#include "llagent.h"
-#include "llcallingcard.h" // for LLAvatarTracker
-#include "llcommandhandler.h"
-#include "llnotificationsutil.h"
-#include "llurlaction.h"
-#include "llimagepng.h"
-#include "llimagejpeg.h"
-#include "lltrans.h"
-#include "llevents.h"
-#include "llviewerregion.h"
-#include "llviewercontrol.h"
-
-#include "llfloaterwebcontent.h"
-#include "llfloaterreg.h"
-#include "llcorehttputil.h"
-
-boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState"));
-boost::scoped_ptr<LLEventPump> LLFacebookConnect::sInfoWatcher(new LLEventStream("FacebookConnectInfo"));
-boost::scoped_ptr<LLEventPump> LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent"));
-
-// Local functions
-void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
-{
- // Note: 302 (redirect) is *not* an error that warrants logging
- if (status != 302)
- {
- LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL;
- }
-}
-
-void toast_user_for_facebook_success()
-{
- LLSD args;
- args["MESSAGE"] = LLTrans::getString("facebook_post_success");
- LLNotificationsUtil::add("FacebookConnect", args);
-}
-
-LLCore::HttpHeaders::ptr_t get_headers()
-{
- LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders);
- // The DebugSlshareLogTag mechanism is intended to trigger slshare-service
- // debug logging. slshare-service is coded to respond to an X-debug-tag
- // header by engaging debug logging for that request only. This way a
- // developer need not muck with the slshare-service image to engage debug
- // logging. Moreover, the value of X-debug-tag is embedded in each such
- // log line so the developer can quickly find the log lines pertinent to
- // THIS session.
- std::string logtag(gSavedSettings.getString("DebugSlshareLogTag"));
- if (! logtag.empty())
- {
- httpHeaders->append("X-debug-tag", logtag);
- }
- return httpHeaders;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-class LLFacebookConnectHandler : public LLCommandHandler
-{
-public:
- LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) { }
-
- bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
- {
- if (tokens.size() >= 1)
- {
- if (tokens[0].asString() == "connect")
- {
- if (tokens.size() >= 2 && tokens[1].asString() == "flickr")
- {
- // this command probably came from the flickr_web browser, so close it
- LLFloaterReg::hideInstance("flickr_web");
-
- // connect to flickr
- if (query_map.has("oauth_token"))
- {
- LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier"));
- }
- return true;
- }
- else if (tokens.size() >= 2 && tokens[1].asString() == "twitter")
- {
- // this command probably came from the twitter_web browser, so close it
- LLFloaterReg::hideInstance("twitter_web");
-
- // connect to twitter
- if (query_map.has("oauth_token"))
- {
- LLTwitterConnect::instance().connectToTwitter(query_map["oauth_token"], query_map.get("oauth_verifier"));
- }
- return true;
- }
- else //if (tokens.size() >= 2 && tokens[1].asString() == "facebook")
- {
- // this command probably came from the fbc_web browser, so close it
- LLFloaterReg::hideInstance("fbc_web");
-
- // connect to facebook
- if (query_map.has("code"))
- {
- LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
- }
- return true;
- }
- }
- }
- return false;
- }
-};
-LLFacebookConnectHandler gFacebookConnectHandler;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-void LLFacebookConnect::facebookConnectCoro(std::string authCode, std::string authState)
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- LLSD putData;
- if (!authCode.empty())
- {
- putData["code"] = authCode;
- }
- if (!authState.empty())
- {
- putData["state"] = authState;
- }
-
- httpOpts->setWantHeaders(true);
- httpOpts->setFollowRedirects(false);
-
- LLSD result = httpAdapter->putAndSuspend(httpRequest, getFacebookConnectURL("/connection"), putData, httpOpts, get_headers());
-
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
- if (!status)
- {
- if (status == LLCore::HttpStatus(HTTP_FOUND))
- {
- std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION];
- if (location.empty())
- {
- LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL;
- }
- else
- {
- openFacebookWeb(location);
- }
- }
- }
- else
- {
- LL_INFOS("FacebookConnect") << "Connect successful. " << LL_ENDL;
- setConnectionState(LLFacebookConnect::FB_CONNECTED);
- }
-
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-bool LLFacebookConnect::testShareStatus(LLSD &result)
-{
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
-
- if (status)
- return true;
-
- if (status == LLCore::HttpStatus(HTTP_FOUND))
- {
- std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION];
- if (location.empty())
- {
- LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL;
- }
- else
- {
- openFacebookWeb(location);
- }
- }
- if (status == LLCore::HttpStatus(HTTP_NOT_FOUND))
- {
- LL_DEBUGS("FacebookConnect") << "Not connected. " << LL_ENDL;
- connectToFacebook();
- }
- else
- {
- LL_WARNS("FacebookConnect") << "HTTP Status error " << status.toString() << LL_ENDL;
- setConnectionState(LLFacebookConnect::FB_POST_FAILED);
- log_facebook_connect_error("Share", status.getStatus(), status.toString(),
- result.get("error_code"), result.get("error_description"));
- }
- return false;
-}
-
-void LLFacebookConnect::facebookShareCoro(std::string route, LLSD share)
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- httpOpts->setWantHeaders(true);
- httpOpts->setFollowRedirects(false);
-
- LLSD result = httpAdapter->postAndSuspend(httpRequest, getFacebookConnectURL(route, true), share, httpOpts, get_headers());
-
- if (testShareStatus(result))
- {
- toast_user_for_facebook_success();
- LL_DEBUGS("FacebookConnect") << "Post successful. " << LL_ENDL;
- setConnectionState(LLFacebookConnect::FB_POSTED);
- }
-}
-
-void LLFacebookConnect::facebookShareImageCoro(std::string route, LLPointer<LLImageFormatted> image, std::string caption)
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpHeaders::ptr_t httpHeaders(get_headers());
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- httpOpts->setWantHeaders(true);
- httpOpts->setFollowRedirects(false);
-
- std::string imageFormat;
- if (dynamic_cast<LLImagePNG*>(image.get()))
- {
- imageFormat = "png";
- }
- else if (dynamic_cast<LLImageJPEG*>(image.get()))
- {
- imageFormat = "jpg";
- }
- else
- {
- LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL;
- return;
- }
-
- // All this code is mostly copied from LLWebProfile::post()
- static const std::string boundary = "----------------------------0123abcdefab";
-
- std::string contentType = "multipart/form-data; boundary=" + boundary;
- httpHeaders->append("Content-Type", contentType.c_str());
-
- LLCore::BufferArray::ptr_t raw = LLCore::BufferArray::ptr_t(new LLCore::BufferArray()); //
- LLCore::BufferArrayStream body(raw.get());
-
- // *NOTE: The order seems to matter.
- body << "--" << boundary << "\r\n"
- << "Content-Disposition: form-data; name=\"caption\"\r\n\r\n"
- << caption << "\r\n";
-
- body << "--" << boundary << "\r\n"
- << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n"
- << "Content-Type: image/" << imageFormat << "\r\n\r\n";
-
- // Insert the image data.
- // *FIX: Treating this as a string will probably screw it up ...
- U8* image_data = image->getData();
- for (S32 i = 0; i < image->getDataSize(); ++i)
- {
- body << image_data[i];
- }
-
- body << "\r\n--" << boundary << "--\r\n";
-
- setConnectionState(LLFacebookConnect::FB_POSTING);
-
- LLSD result = httpAdapter->postAndSuspend(httpRequest, getFacebookConnectURL(route, true), raw, httpOpts, httpHeaders);
-
- if (testShareStatus(result))
- {
- toast_user_for_facebook_success();
- LL_DEBUGS("FacebookConnect") << "Post successful. " << LL_ENDL;
- setConnectionState(LLFacebookConnect::FB_POSTED);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-void LLFacebookConnect::facebookDisconnectCoro()
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- httpOpts->setFollowRedirects(false);
-
- LLSD result = httpAdapter->deleteAndSuspend(httpRequest, getFacebookConnectURL("/connection"), httpOpts, get_headers());
-
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
- if (!status && (status != LLCore::HttpStatus(HTTP_FOUND)))
- {
- LL_WARNS("FacebookConnect") << "Failed to disconnect:" << status.toTerseString() << LL_ENDL;
- setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED);
- log_facebook_connect_error("Disconnect", status.getStatus(), status.toString(),
- result.get("error_code"), result.get("error_description"));
- }
- else
- {
- LL_DEBUGS("FacebookConnect") << "Facebook Disconnect successful. " << LL_ENDL;
- clearInfo();
- clearContent();
- //Notify state change
- setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
- }
-
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-void LLFacebookConnect::facebookConnectedCheckCoro(bool autoConnect)
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
-
- httpOpts->setFollowRedirects(false);
-
- LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/connection", true), httpOpts, get_headers());
-
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
-
- if (!status)
- {
- if ( status == LLCore::HttpStatus(HTTP_NOT_FOUND) )
- {
- LL_DEBUGS("FacebookConnect") << "Not connected. " << LL_ENDL;
- if (autoConnect)
- {
- connectToFacebook();
- }
- else
- {
- setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
- }
- }
- else
- {
- LL_WARNS("FacebookConnect") << "Failed to test connection:" << status.toTerseString() << LL_ENDL;
-
- setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED);
- log_facebook_connect_error("Connected", status.getStatus(), status.toString(),
- result.get("error_code"), result.get("error_description"));
- }
- }
- else
- {
- LL_DEBUGS("FacebookConnect") << "Connect successful. " << LL_ENDL;
- setConnectionState(LLFacebookConnect::FB_CONNECTED);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-void LLFacebookConnect::facebookConnectInfoCoro()
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- httpOpts->setWantHeaders(true);
- httpOpts->setFollowRedirects(false);
-
- LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/info", true), httpOpts, get_headers());
-
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
-
- if (status == LLCore::HttpStatus(HTTP_FOUND))
- {
- std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION];
- if (location.empty())
- {
- LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL;
- }
- else
- {
- openFacebookWeb(location);
- }
- }
- else if (!status)
- {
- LL_WARNS("FacebookConnect") << "Facebook Info failed: " << status.toString() << LL_ENDL;
- log_facebook_connect_error("Info", status.getStatus(), status.toString(),
- result.get("error_code"), result.get("error_description"));
- }
- else
- {
- LL_INFOS("FacebookConnect") << "Facebook: Info received" << LL_ENDL;
- result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
- storeInfo(result);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-void LLFacebookConnect::facebookConnectFriendsCoro()
-{
- LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
- LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FacebookConnect", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
-
- httpOpts->setFollowRedirects(false);
-
- LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/friends", true), httpOpts, get_headers());
-
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
-
- if (status == LLCore::HttpStatus(HTTP_FOUND))
- {
- std::string location = httpResults[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS][HTTP_IN_HEADER_LOCATION];
- if (location.empty())
- {
- LL_WARNS("FacebookConnect") << "Missing Location header " << LL_ENDL;
- }
- else
- {
- openFacebookWeb(location);
- }
- }
- else if (!status)
- {
- LL_WARNS("FacebookConnect") << "Facebook Friends failed: " << status.toString() << LL_ENDL;
- log_facebook_connect_error("Info", status.getStatus(), status.toString(),
- result.get("error_code"), result.get("error_description"));
- }
- else
- {
- LL_INFOS("FacebookConnect") << "Facebook: Friends received" << LL_ENDL;
- result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
- LLSD content = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT];
- storeContent(content);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-LLFacebookConnect::LLFacebookConnect()
-: mConnectionState(FB_NOT_CONNECTED),
- mConnected(false),
- mInfo(),
- mContent(),
- mRefreshInfo(false),
- mRefreshContent(false),
- mReadFromMaster(false)
-{
-}
-
-void LLFacebookConnect::openFacebookWeb(std::string url)
-{
- LLFloaterWebContent::Params p;
- p.url(url);
- p.show_chrome(true);
- p.allow_back_forward_navigation(false);
- p.clean_browser(true);
- LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p);
- //the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems).
- //So when showing the internal web browser, set focus to it's containing floater "fbc_web". When a mouse event
- //occurs on the "webbrowser" panel part of the floater, a mouse cursor will properly show and the "webbrowser" will gain focus.
- //fbc_web floater contains the "webbrowser" panel. JIRA: ACME-744
- gFocusMgr.setKeyboardFocus( floater );
-
- //LLUrlAction::openURLExternal(url);
-}
-
-std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master)
-{
- std::string url("");
- LLViewerRegion *regionp = gAgent.getRegion();
- if (regionp)
- {
- //url = "http://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY FOR TESTING - CHO
- url = regionp->getCapability("FacebookConnect");
- url += route;
-
- if (include_read_from_master && mReadFromMaster)
- {
- url += "?read_from_master=true";
- }
- }
- return url;
-}
-
-void LLFacebookConnect::connectToFacebook(const std::string& auth_code, const std::string& auth_state)
-{
- setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
-
- LLCoros::instance().launch("LLFacebookConnect::facebookConnectCoro",
- boost::bind(&LLFacebookConnect::facebookConnectCoro, this, auth_code, auth_state));
-}
-
-void LLFacebookConnect::disconnectFromFacebook()
-{
- LLCoros::instance().launch("LLFacebookConnect::facebookDisconnectCoro",
- boost::bind(&LLFacebookConnect::facebookDisconnectCoro, this));
-}
-
-void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
-{
- setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
-
- LLCoros::instance().launch("LLFacebookConnect::facebookConnectedCheckCoro",
- boost::bind(&LLFacebookConnect::facebookConnectedCheckCoro, this, auto_connect));
-}
-
-void LLFacebookConnect::loadFacebookInfo()
-{
- if(mRefreshInfo)
- {
- LLCoros::instance().launch("LLFacebookConnect::facebookConnectInfoCoro",
- boost::bind(&LLFacebookConnect::facebookConnectInfoCoro, this));
- }
-}
-
-void LLFacebookConnect::loadFacebookFriends()
-{
- if(mRefreshContent)
- {
- LLCoros::instance().launch("LLFacebookConnect::facebookConnectFriendsCoro",
- boost::bind(&LLFacebookConnect::facebookConnectFriendsCoro, this));
- }
-}
-
-void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name,
- const std::string& description, const std::string& image, const std::string& message)
-{
- setConnectionState(LLFacebookConnect::FB_POSTING);
-
- LLSD body;
- if (!location.empty())
- {
- body["location"] = location;
- }
- if (!name.empty())
- {
- body["name"] = name;
- }
- if (!description.empty())
- {
- body["description"] = description;
- }
- if (!image.empty())
- {
- body["image"] = image;
- }
- if (!message.empty())
- {
- body["message"] = message;
- }
-
- LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro",
- boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/checkin", body));
-}
-
-void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption)
-{
- setConnectionState(LLFacebookConnect::FB_POSTING);
-
- LLSD body;
- body["image"] = image_url;
- body["caption"] = caption;
-
- LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro",
- boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/photo", body));
-}
-
-void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption)
-{
- setConnectionState(LLFacebookConnect::FB_POSTING);
-
- LLCoros::instance().launch("LLFacebookConnect::facebookShareImageCoro",
- boost::bind(&LLFacebookConnect::facebookShareImageCoro, this, "/share/photo", image, caption));
-}
-
-void LLFacebookConnect::updateStatus(const std::string& message)
-{
- LLSD body;
- body["message"] = message;
-
- setConnectionState(LLFacebookConnect::FB_POSTING);
-
- LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro",
- boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/wall", body));
-}
-
-void LLFacebookConnect::storeInfo(const LLSD& info)
-{
- mInfo = info;
- mRefreshInfo = false;
-
- sInfoWatcher->post(info);
-}
-
-const LLSD& LLFacebookConnect::getInfo() const
-{
- return mInfo;
-}
-
-void LLFacebookConnect::clearInfo()
-{
- mInfo = LLSD();
-}
-
-void LLFacebookConnect::storeContent(const LLSD& content)
-{
- mContent = content;
- mRefreshContent = false;
-
- sContentWatcher->post(content);
-}
-
-const LLSD& LLFacebookConnect::getContent() const
-{
- return mContent;
-}
-
-void LLFacebookConnect::clearContent()
-{
- mContent = LLSD();
-}
-
-void LLFacebookConnect::setDataDirty()
-{
- mRefreshInfo = true;
- mRefreshContent = true;
-}
-
-void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state)
-{
- if(connection_state == FB_CONNECTED)
- {
- mReadFromMaster = true;
- setConnected(true);
- setDataDirty();
- }
- else if(connection_state == FB_NOT_CONNECTED)
- {
- setConnected(false);
- }
- else if(connection_state == FB_POSTED)
- {
- mReadFromMaster = false;
- }
-
- if (mConnectionState != connection_state)
- {
- // set the connection state before notifying watchers
- mConnectionState = connection_state;
-
- LLSD state_info;
- state_info["enum"] = connection_state;
- sStateWatcher->post(state_info);
- }
-}
-
-void LLFacebookConnect::setConnected(bool connected)
-{
- mConnected = connected;
-}
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
deleted file mode 100644
index 7fd4070f54..0000000000
--- a/indra/newview/llfacebookconnect.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * @file llfacebookconnect.h
- * @author Merov, Cho, Gil
- * @brief Connection to Facebook Service
- *
- * $LicenseInfo:firstyear=2013&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2013, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFACEBOOKCONNECT_H
-#define LL_LLFACEBOOKCONNECT_H
-
-#include "llsingleton.h"
-#include "llimage.h"
-#include "llcoros.h"
-#include "lleventcoro.h"
-
-class LLEventPump;
-
-/**
- * @class LLFacebookConnect
- *
- * Manages authentication to, and interaction with, a web service allowing the
- * the viewer to get Facebook OpenGraph data.
- */
-class LLFacebookConnect : public LLSingleton<LLFacebookConnect>
-{
- LLSINGLETON(LLFacebookConnect);
- ~LLFacebookConnect() {};
- LOG_CLASS(LLFacebookConnect);
-public:
- enum EConnectionState
- {
- FB_NOT_CONNECTED = 0,
- FB_CONNECTION_IN_PROGRESS = 1,
- FB_CONNECTED = 2,
- FB_CONNECTION_FAILED = 3,
- FB_POSTING = 4,
- FB_POSTED = 5,
- FB_POST_FAILED = 6,
- FB_DISCONNECTING = 7,
- FB_DISCONNECT_FAILED = 8
- };
-
- void connectToFacebook(const std::string& auth_code = "", const std::string& auth_state = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use.
- void disconnectFromFacebook(); // Disconnect from the FBC service.
- void checkConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook().
-
- void loadFacebookInfo();
- void loadFacebookFriends();
- void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
- void sharePhoto(const std::string& image_url, const std::string& caption);
- void sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption);
- void updateStatus(const std::string& message);
-
- void storeInfo(const LLSD& info);
- const LLSD& getInfo() const;
- void clearInfo();
- void storeContent(const LLSD& content);
- const LLSD& getContent() const;
- void clearContent();
- void setDataDirty();
-
- void setConnectionState(EConnectionState connection_state);
- void setConnected(bool connected);
- bool isConnected() { return mConnected; }
- bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_DISCONNECTING)); }
- EConnectionState getConnectionState() { return mConnectionState; }
-
- void openFacebookWeb(std::string url);
-
-private:
-
- std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false);
-
- EConnectionState mConnectionState;
- BOOL mConnected;
- LLSD mInfo;
- LLSD mContent;
- bool mRefreshInfo;
- bool mRefreshContent;
- bool mReadFromMaster;
-
- static boost::scoped_ptr<LLEventPump> sStateWatcher;
- static boost::scoped_ptr<LLEventPump> sInfoWatcher;
- static boost::scoped_ptr<LLEventPump> sContentWatcher;
-
- bool testShareStatus(LLSD &results);
- void facebookConnectCoro(std::string authCode, std::string authState);
- void facebookConnectedCheckCoro(bool autoConnect);
- void facebookDisconnectCoro();
- void facebookShareCoro(std::string route, LLSD share);
- void facebookShareImageCoro(std::string route, LLPointer<LLImageFormatted> image, std::string caption);
- void facebookConnectInfoCoro();
- void facebookConnectFriendsCoro();
-};
-
-#endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp
deleted file mode 100644
index e84cbc289f..0000000000
--- a/indra/newview/llfloaterfacebook.cpp
+++ /dev/null
@@ -1,1132 +0,0 @@
-/**
-* @file llfloaterfacebook.cpp
-* @brief Implementation of llfloaterfacebook
-* @author Gilbert@lindenlab.com
-*
-* $LicenseInfo:firstyear=2013&license=viewerlgpl$
-* Second Life Viewer Source Code
-* Copyright (C) 2013, Linden Research, Inc.
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation;
-* version 2.1 of the License only.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*
-* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
-* $/LicenseInfo$
-*/
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloaterfacebook.h"
-
-#include "llagent.h"
-#include "llagentui.h"
-#include "llcheckboxctrl.h"
-#include "llcombobox.h"
-#include "llfacebookconnect.h"
-#include "llfloaterbigpreview.h"
-#include "llfloaterreg.h"
-#include "lliconctrl.h"
-#include "llimagefiltersmanager.h"
-#include "llresmgr.h" // LLLocale
-#include "llsdserialize.h"
-#include "llloadingindicator.h"
-#include "llslurl.h"
-#include "lltrans.h"
-#include "llsnapshotlivepreview.h"
-#include "llviewerregion.h"
-#include "llviewercontrol.h"
-#include "llviewermedia.h"
-#include "lltabcontainer.h"
-#include "llavatarlist.h"
-#include "llpanelpeoplemenus.h"
-#include "llaccordionctrl.h"
-#include "llaccordionctrltab.h"
-
-static LLPanelInjector<LLFacebookStatusPanel> t_panel_status("llfacebookstatuspanel");
-static LLPanelInjector<LLFacebookPhotoPanel> t_panel_photo("llfacebookphotopanel");
-static LLPanelInjector<LLFacebookCheckinPanel> t_panel_checkin("llfacebookcheckinpanel");
-static LLPanelInjector<LLFacebookFriendsPanel> t_panel_friends("llfacebookfriendspanel");
-
-const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/";
-const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png";
-const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare";
-const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare";
-
-const S32 MAX_QUALITY = 100; // Max quality value for jpeg images
-const S32 MIN_QUALITY = 0; // Min quality value for jpeg images
-const S32 TARGET_DATA_SIZE = 950000; // Size of the image (compressed) we're trying to send to Facebook
-
-std::string get_map_url()
-{
- LLVector3d center_agent;
- LLViewerRegion *regionp = gAgent.getRegion();
- if (regionp)
- {
- center_agent = regionp->getCenterGlobal();
- }
- int x_pos = center_agent[0] / 256.0;
- int y_pos = center_agent[1] / 256.0;
- std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos);
- return map_url;
-}
-
-// Compute target jpeg quality : see https://wiki.lindenlab.com/wiki/Facebook_Image_Quality for details
-S32 compute_jpeg_quality(S32 width, S32 height)
-{
- F32 target_compression_ratio = (F32)(width * height * 3) / (F32)(TARGET_DATA_SIZE);
- S32 quality = (S32)(110.0f - (2.0f * target_compression_ratio));
- return llclamp(quality, MIN_QUALITY, MAX_QUALITY);
-}
-
-///////////////////////////
-//LLFacebookStatusPanel//////
-///////////////////////////
-
-LLFacebookStatusPanel::LLFacebookStatusPanel() :
- mMessageTextEditor(NULL),
- mPostButton(NULL),
- mCancelButton(NULL),
- mAccountCaptionLabel(NULL),
- mAccountNameLabel(NULL),
- mPanelButtons(NULL),
- mConnectButton(NULL),
- mDisconnectButton(NULL)
-{
- mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this));
- mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this));
-
- setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2));
-
- mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this));
-}
-
-BOOL LLFacebookStatusPanel::postBuild()
-{
- mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
- mAccountNameLabel = getChild<LLTextBox>("account_name_label");
- mPanelButtons = getChild<LLUICtrl>("panel_buttons");
- mConnectButton = getChild<LLUICtrl>("connect_btn");
- mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
-
- mMessageTextEditor = getChild<LLUICtrl>("status_message");
- mPostButton = getChild<LLUICtrl>("post_status_btn");
- mCancelButton = getChild<LLUICtrl>("cancel_status_btn");
-
- return LLPanel::postBuild();
-}
-
-void LLFacebookStatusPanel::draw()
-{
- LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
-
- //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
- bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING;
- mDisconnectButton->setEnabled(!disconnecting);
-
- //Disable the 'connect' button when a connection is in progress
- bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
- mConnectButton->setEnabled(!connecting);
-
- if (mMessageTextEditor && mPostButton && mCancelButton)
- {
- bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
- std::string message = mMessageTextEditor->getValue().asString();
- mMessageTextEditor->setEnabled(no_ongoing_connection);
- mCancelButton->setEnabled(no_ongoing_connection);
- mPostButton->setEnabled(no_ongoing_connection && !message.empty());
- }
-
- LLPanel::draw();
-}
-
-void LLFacebookStatusPanel::onSend()
-{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1));
-
- // Connect to Facebook if necessary and then post
- if (LLFacebookConnect::instance().isConnected())
- {
- sendStatus();
- }
- else
- {
- LLFacebookConnect::instance().checkConnectionToFacebook(true);
- }
-}
-
-bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data)
-{
- switch (data.get("enum").asInteger())
- {
- case LLFacebookConnect::FB_CONNECTED:
- sendStatus();
- break;
-
- case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel");
- clearAndClose();
- break;
- }
-
- return false;
-}
-
-bool LLFacebookStatusPanel::onFacebookConnectAccountStateChange(const LLSD& data)
-{
- if (LLFacebookConnect::instance().isConnected())
- {
- //In process of disconnecting so leave the layout as is
- if (data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING)
- {
- showConnectedLayout();
- }
- }
- else
- {
- showDisconnectedLayout();
- }
-
- return false;
-}
-
-void LLFacebookStatusPanel::sendStatus()
-{
- std::string message = mMessageTextEditor->getValue().asString();
- if (!message.empty())
- {
- LLFacebookConnect::instance().updateStatus(message);
- }
-}
-
-void LLFacebookStatusPanel::onVisibilityChange(BOOL visible)
-{
- if (visible)
- {
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectAccountStateChange, this, _1));
-
- LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this));
-
- //Connected
- if (LLFacebookConnect::instance().isConnected())
- {
- showConnectedLayout();
- }
- //Check if connected (show disconnected layout in meantime)
- else
- {
- showDisconnectedLayout();
- }
- if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
- (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
- {
- LLFacebookConnect::instance().checkConnectionToFacebook();
- }
- }
- else
- {
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
- }
-}
-
-bool LLFacebookStatusPanel::onFacebookConnectInfoChange()
-{
- LLSD info = LLFacebookConnect::instance().getInfo();
- std::string clickable_name;
-
- //Strings of format [http://www.somewebsite.com Click Me] become clickable text
- if (info.has("link") && info.has("name"))
- {
- clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
- }
-
- mAccountNameLabel->setText(clickable_name);
-
- return false;
-}
-
-void LLFacebookStatusPanel::showConnectButton()
-{
- if (!mConnectButton->getVisible())
- {
- mConnectButton->setVisible(TRUE);
- mDisconnectButton->setVisible(FALSE);
- }
-}
-
-void LLFacebookStatusPanel::hideConnectButton()
-{
- if (mConnectButton->getVisible())
- {
- mConnectButton->setVisible(FALSE);
- mDisconnectButton->setVisible(TRUE);
- }
-}
-
-void LLFacebookStatusPanel::showDisconnectedLayout()
-{
- mAccountCaptionLabel->setText(getString("facebook_disconnected"));
- mAccountNameLabel->setText(std::string(""));
- showConnectButton();
-}
-
-void LLFacebookStatusPanel::showConnectedLayout()
-{
- LLFacebookConnect::instance().loadFacebookInfo();
-
- mAccountCaptionLabel->setText(getString("facebook_connected"));
- hideConnectButton();
-}
-
-void LLFacebookStatusPanel::onConnect()
-{
- LLFacebookConnect::instance().checkConnectionToFacebook(true);
-}
-
-void LLFacebookStatusPanel::onDisconnect()
-{
- LLFacebookConnect::instance().disconnectFromFacebook();
-}
-
-void LLFacebookStatusPanel::clearAndClose()
-{
- mMessageTextEditor->setValue("");
-
- LLFloater* floater = getParentByType<LLFloater>();
- if (floater)
- {
- floater->closeFloater();
- }
-}
-
-///////////////////////////
-//LLFacebookPhotoPanel///////
-///////////////////////////
-
-LLFacebookPhotoPanel::LLFacebookPhotoPanel() :
- mResolutionComboBox(NULL),
- mRefreshBtn(NULL),
- mBtnPreview(NULL),
- mWorkingLabel(NULL),
- mThumbnailPlaceholder(NULL),
- mCaptionTextBox(NULL),
- mPostButton(NULL),
- mBigPreviewFloater(NULL),
- mQuality(MAX_QUALITY)
-{
- mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFacebookPhotoPanel::onSend, this));
- mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFacebookPhotoPanel::onClickNewSnapshot, this));
- mCommitCallbackRegistrar.add("SocialSharing.BigPreview", boost::bind(&LLFacebookPhotoPanel::onClickBigPreview, this));
-}
-
-LLFacebookPhotoPanel::~LLFacebookPhotoPanel()
-{
- if (mPreviewHandle.get())
- {
- mPreviewHandle.get()->die();
- }
-}
-
-BOOL LLFacebookPhotoPanel::postBuild()
-{
- setVisibleCallback(boost::bind(&LLFacebookPhotoPanel::onVisibilityChange, this, _2));
-
- mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
- mResolutionComboBox->setValue("[i1200,i630]"); // hardcoded defaults ftw!
- mResolutionComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE));
- mFilterComboBox = getChild<LLUICtrl>("filters_combobox");
- mFilterComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE));
- mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
- mBtnPreview = getChild<LLButton>("big_preview_btn");
- mWorkingLabel = getChild<LLUICtrl>("working_lbl");
- mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
- mCaptionTextBox = getChild<LLUICtrl>("photo_caption");
- mPostButton = getChild<LLUICtrl>("post_photo_btn");
- mCancelButton = getChild<LLUICtrl>("cancel_photo_btn");
- mBigPreviewFloater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
-
- // Update filter list
- std::vector<std::string> filter_list = LLImageFiltersManager::getInstance()->getFiltersList();
- LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
- for (U32 i = 0; i < filter_list.size(); i++)
- {
- filterbox->add(filter_list[i]);
- }
-
- return LLPanel::postBuild();
-}
-
-// virtual
-S32 LLFacebookPhotoPanel::notify(const LLSD& info)
-{
- if (info.has("snapshot-updating"))
- {
- // Disable the Post button and whatever else while the snapshot is not updated
- // updateControls();
- return 1;
- }
-
- if (info.has("snapshot-updated"))
- {
- // Enable the send/post/save buttons.
- updateControls();
-
- // The refresh button is initially hidden. We show it after the first update,
- // i.e. after snapshot is taken
- LLUICtrl * refresh_button = getRefreshBtn();
- if (!refresh_button->getVisible())
- {
- refresh_button->setVisible(true);
- }
- return 1;
- }
-
- return 0;
-}
-
-void LLFacebookPhotoPanel::draw()
-{
- LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
-
- // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts)
- bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
- mCancelButton->setEnabled(no_ongoing_connection);
- mCaptionTextBox->setEnabled(no_ongoing_connection);
- mResolutionComboBox->setEnabled(no_ongoing_connection);
- mFilterComboBox->setEnabled(no_ongoing_connection);
- mRefreshBtn->setEnabled(no_ongoing_connection);
- mBtnPreview->setEnabled(no_ongoing_connection);
-
- // Reassign the preview floater if we have the focus and the preview exists
- if (hasFocus() && isPreviewVisible())
- {
- attachPreview();
- }
-
- // Toggle the button state as appropriate
- bool preview_active = (isPreviewVisible() && mBigPreviewFloater->isFloaterOwner(getParentByType<LLFloater>()));
- mBtnPreview->setToggleState(preview_active);
-
- // Display the thumbnail if one is available
- if (previewp && previewp->getThumbnailImage())
- {
- const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
- const S32 thumbnail_w = previewp->getThumbnailWidth();
- const S32 thumbnail_h = previewp->getThumbnailHeight();
-
- // calc preview offset within the preview rect
- const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2;
- const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2;
- S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
- S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
-
- gGL.matrixMode(LLRender::MM_MODELVIEW);
- // Apply floater transparency to the texture unless the floater is focused.
- F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
- LLColor4 color = LLColor4::white;
- gl_draw_scaled_image(offset_x, offset_y,
- thumbnail_w, thumbnail_h,
- previewp->getThumbnailImage(), color % alpha);
- }
-
- // Update the visibility of the working (computing preview) label
- mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate()));
-
- // Enable Post if we have a preview to send and no on going connection being processed
- mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate()));
-
- // Draw the rest of the panel on top of it
- LLPanel::draw();
-}
-
-LLSnapshotLivePreview* LLFacebookPhotoPanel::getPreviewView()
-{
- LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
- return previewp;
-}
-
-void LLFacebookPhotoPanel::onVisibilityChange(BOOL visible)
-{
- if (visible)
- {
- if (mPreviewHandle.get())
- {
- LLSnapshotLivePreview* preview = getPreviewView();
- if (preview)
- {
- LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL;
- preview->updateSnapshot(TRUE);
- }
- }
- else
- {
- LLRect full_screen_rect = getRootView()->getRect();
- LLSnapshotLivePreview::Params p;
- p.rect(full_screen_rect);
- LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
- mPreviewHandle = previewp->getHandle();
- mQuality = MAX_QUALITY;
-
- previewp->setContainer(this);
- previewp->setSnapshotType(LLSnapshotModel::SNAPSHOT_WEB);
- previewp->setSnapshotFormat(LLSnapshotModel::SNAPSHOT_FORMAT_JPEG);
- previewp->setSnapshotQuality(mQuality, false);
- previewp->setThumbnailSubsampled(TRUE); // We want the preview to reflect the *saved* image
- previewp->setAllowRenderUI(FALSE); // We do not want the rendered UI in our snapshots
- previewp->setAllowFullScreenPreview(FALSE); // No full screen preview in SL Share mode
- previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
-
- updateControls();
- }
- }
-}
-
-void LLFacebookPhotoPanel::onClickNewSnapshot()
-{
- LLSnapshotLivePreview* previewp = getPreviewView();
- if (previewp)
- {
- previewp->updateSnapshot(TRUE);
- }
-}
-
-void LLFacebookPhotoPanel::onClickBigPreview()
-{
- // Toggle the preview
- if (isPreviewVisible())
- {
- LLFloaterReg::hideInstance("big_preview");
- }
- else
- {
- attachPreview();
- LLFloaterReg::showInstance("big_preview");
- }
-}
-
-bool LLFacebookPhotoPanel::isPreviewVisible()
-{
- return (mBigPreviewFloater && mBigPreviewFloater->getVisible());
-}
-
-void LLFacebookPhotoPanel::attachPreview()
-{
- if (mBigPreviewFloater)
- {
- LLSnapshotLivePreview* previewp = getPreviewView();
- mBigPreviewFloater->setPreview(previewp);
- mBigPreviewFloater->setFloaterOwner(getParentByType<LLFloater>());
- }
-}
-
-void LLFacebookPhotoPanel::onSend()
-{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookPhotoPanel", boost::bind(&LLFacebookPhotoPanel::onFacebookConnectStateChange, this, _1));
-
- // Connect to Facebook if necessary and then post
- if (LLFacebookConnect::instance().isConnected())
- {
- sendPhoto();
- }
- else
- {
- LLFacebookConnect::instance().checkConnectionToFacebook(true);
- }
-}
-
-bool LLFacebookPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
-{
- switch (data.get("enum").asInteger())
- {
- case LLFacebookConnect::FB_CONNECTED:
- sendPhoto();
- break;
-
- case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel");
- clearAndClose();
- break;
- }
-
- return false;
-}
-
-void LLFacebookPhotoPanel::sendPhoto()
-{
- // Get the caption
- std::string caption = mCaptionTextBox->getValue().asString();
-
- // Get the image
- LLSnapshotLivePreview* previewp = getPreviewView();
-
- // Post to Facebook
- LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
-
- updateControls();
-}
-
-void LLFacebookPhotoPanel::clearAndClose()
-{
- mCaptionTextBox->setValue("");
-
- LLFloater* floater = getParentByType<LLFloater>();
- if (floater)
- {
- floater->closeFloater();
- if (mBigPreviewFloater)
- {
- mBigPreviewFloater->closeOnFloaterOwnerClosing(floater);
- }
- }
-}
-
-void LLFacebookPhotoPanel::updateControls()
-{
- LLSnapshotLivePreview* previewp = getPreviewView();
- BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
-
- // *TODO: Separate maximum size for Web images from postcards
- LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
-
- updateResolution(FALSE);
-}
-
-void LLFacebookPhotoPanel::updateResolution(BOOL do_update)
-{
- LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
- LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
-
- std::string sdstring = combobox->getSelectedValue();
- LLSD sdres;
- std::stringstream sstream(sdstring);
- LLSDSerialize::fromNotation(sdres, sstream, sdstring.size());
-
- S32 width = sdres[0];
- S32 height = sdres[1];
-
- // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
- std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : "");
-
- LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
- if (previewp && combobox->getCurrentIndex() >= 0)
- {
- S32 original_width = 0, original_height = 0;
- previewp->getSize(original_width, original_height);
-
- if (width == 0 || height == 0)
- {
- // take resolution from current window size
- LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
- previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
- }
- else
- {
- // use the resolution from the selected pre-canned drop-down choice
- LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL;
- previewp->setSize(width, height);
- }
-
- checkAspectRatio(width);
-
- previewp->getSize(width, height);
-
- // Recompute quality setting
- mQuality = compute_jpeg_quality(width, height);
- previewp->setSnapshotQuality(mQuality, false);
-
- if (original_width != width || original_height != height)
- {
- previewp->setSize(width, height);
- if (do_update)
- {
- previewp->updateSnapshot(TRUE);
- updateControls();
- }
- }
- // Get the old filter, compare to the current one "filter_name" and set if changed
- std::string original_filter = previewp->getFilter();
- if (original_filter != filter_name)
- {
- previewp->setFilter(filter_name);
- if (do_update)
- {
- previewp->updateSnapshot(FALSE, TRUE);
- updateControls();
- }
- }
- }
-}
-
-void LLFacebookPhotoPanel::checkAspectRatio(S32 index)
-{
- LLSnapshotLivePreview *previewp = getPreviewView();
-
- BOOL keep_aspect = FALSE;
-
- if (0 == index) // current window size
- {
- keep_aspect = TRUE;
- }
- else // predefined resolution
- {
- keep_aspect = FALSE;
- }
-
- if (previewp)
- {
- previewp->mKeepAspectRatio = keep_aspect;
- }
-}
-
-LLUICtrl* LLFacebookPhotoPanel::getRefreshBtn()
-{
- return mRefreshBtn;
-}
-
-////////////////////////
-//LLFacebookCheckinPanel//
-////////////////////////
-
-LLFacebookCheckinPanel::LLFacebookCheckinPanel() :
- mMapUrl(""),
- mReloadingMapTexture(false)
-{
- mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLFacebookCheckinPanel::onSend, this));
-}
-
-BOOL LLFacebookCheckinPanel::postBuild()
-{
- // Keep pointers to widgets so we don't traverse the UI hierarchy too often
- mPostButton = getChild<LLUICtrl>("post_place_btn");
- mCancelButton = getChild<LLUICtrl>("cancel_place_btn");
- mMessageTextEditor = getChild<LLUICtrl>("place_caption");
- mMapLoadingIndicator = getChild<LLUICtrl>("map_loading_indicator");
- mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder");
- mMapDefault = getChild<LLIconCtrl>("map_default");
- mMapCheckBox = getChild<LLCheckBoxCtrl>("add_place_view_cb");
-
- return LLPanel::postBuild();
-}
-
-void LLFacebookCheckinPanel::draw()
-{
- bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
- mPostButton->setEnabled(no_ongoing_connection);
- mCancelButton->setEnabled(no_ongoing_connection);
- mMessageTextEditor->setEnabled(no_ongoing_connection);
- mMapCheckBox->setEnabled(no_ongoing_connection);
-
- std::string map_url = get_map_url();
- // Did we change location?
- if (map_url != mMapUrl)
- {
- mMapUrl = map_url;
- // Load the map tile
- mMapTexture = LLViewerTextureManager::getFetchedTextureFromUrl(mMapUrl, FTT_MAP_TILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
- mMapTexture->setBoostLevel(LLGLTexture::BOOST_MAP);
- mReloadingMapTexture = true;
- // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox
- mMapLoadingIndicator->setVisible(true);
- mMapPlaceholder->setVisible(false);
- }
- // Are we done loading the map tile?
- if (mReloadingMapTexture && mMapTexture->isFullyLoaded())
- {
- // Don't do it again next time around
- mReloadingMapTexture = false;
- // Convert the map texture to the appropriate image object
- LLPointer<LLUIImage> ui_image = new LLUIImage(mMapUrl, mMapTexture);
- // Load the map widget with the correct map tile image
- mMapPlaceholder->setImage(ui_image);
- // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value
- mMapLoadingIndicator->setVisible(false);
- mMapPlaceholder->setVisible(true);
- }
- // Show the default icon if that's the checkbox value (the real one...)
- // This will hide/show the loading indicator and/or tile underneath
- mMapDefault->setVisible(!(mMapCheckBox->get()));
-
- LLPanel::draw();
-}
-
-void LLFacebookCheckinPanel::onSend()
-{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookCheckinPanel", boost::bind(&LLFacebookCheckinPanel::onFacebookConnectStateChange, this, _1));
-
- // Connect to Facebook if necessary and then post
- if (LLFacebookConnect::instance().isConnected())
- {
- sendCheckin();
- }
- else
- {
- LLFacebookConnect::instance().checkConnectionToFacebook(true);
- }
-}
-
-bool LLFacebookCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
-{
- switch (data.get("enum").asInteger())
- {
- case LLFacebookConnect::FB_CONNECTED:
- sendCheckin();
- break;
-
- case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel");
- clearAndClose();
- break;
- }
-
- return false;
-}
-
-void LLFacebookCheckinPanel::sendCheckin()
-{
- // Get the location SLURL
- LLSLURL slurl;
- LLAgentUI::buildSLURL(slurl);
- std::string slurl_string = slurl.getSLURLString();
-
- // Use a valid http:// URL if the scheme is secondlife://
- LLURI slurl_uri(slurl_string);
- if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME)
- {
- slurl_string = DEFAULT_CHECKIN_LOCATION_URL;
- }
-
- // Add query parameters so Google Analytics can track incoming clicks!
- slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS;
-
- // Get the region name
- std::string region_name("");
- LLViewerRegion *regionp = gAgent.getRegion();
- if (regionp)
- {
- region_name = regionp->getName();
- }
-
- // Get the region description
- std::string description;
- LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
-
- // Optionally add the region map view
- bool add_map_view = mMapCheckBox->getValue().asBoolean();
- std::string map_url = (add_map_view ? get_map_url() : DEFAULT_CHECKIN_ICON_URL);
-
- // Get the caption
- std::string caption = mMessageTextEditor->getValue().asString();
-
- // Post to Facebook
- LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
-}
-
-void LLFacebookCheckinPanel::clearAndClose()
-{
- mMessageTextEditor->setValue("");
-
- LLFloater* floater = getParentByType<LLFloater>();
- if (floater)
- {
- floater->closeFloater();
- }
-}
-
-///////////////////////////
-//LLFacebookFriendsPanel//////
-///////////////////////////
-
-LLFacebookFriendsPanel::LLFacebookFriendsPanel() :
- mFriendsStatusCaption(NULL),
- mSecondLifeFriends(NULL),
- mSuggestedFriends(NULL)
-{
-}
-
-LLFacebookFriendsPanel::~LLFacebookFriendsPanel()
-{
- LLAvatarTracker::instance().removeObserver(this);
-}
-
-BOOL LLFacebookFriendsPanel::postBuild()
-{
- mFriendsStatusCaption = getChild<LLTextBox>("facebook_friends_status");
-
- mSecondLifeFriends = getChild<LLAvatarList>("second_life_friends");
- mSecondLifeFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
-
- mSuggestedFriends = getChild<LLAvatarList>("suggested_friends");
- mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
-
- setVisibleCallback(boost::bind(&LLFacebookFriendsPanel::updateFacebookList, this, _2));
-
- LLAvatarTracker::instance().addObserver(this);
-
- return LLPanel::postBuild();
-}
-
-bool LLFacebookFriendsPanel::updateSuggestedFriendList()
-{
- const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
- uuid_vec_t& second_life_friends = mSecondLifeFriends->getIDs();
- second_life_friends.clear();
- uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs();
- suggested_friends.clear();
-
- //Add suggested friends
- LLSD friends = LLFacebookConnect::instance().getContent();
- for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
- {
- LLUUID agent_id = (*i).asUUID();
- if (agent_id.notNull())
- {
- bool second_life_buddy = av_tracker.isBuddy(agent_id);
- if (second_life_buddy)
- {
- second_life_friends.push_back(agent_id);
- }
- else
- {
- //FB+SL but not SL friend
- suggested_friends.push_back(agent_id);
- }
- }
- }
-
- //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
- mSecondLifeFriends->setDirty(true, !mSecondLifeFriends->filterHasMatches());
- mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
- showFriendsAccordionsIfNeeded();
-
- return false;
-}
-
-void LLFacebookFriendsPanel::showFriendsAccordionsIfNeeded()
-{
- // Show / hide the status text : needs to be done *before* showing / hidding the accordions
- if (!mSecondLifeFriends->filterHasMatches() && !mSuggestedFriends->filterHasMatches())
- {
- // Show some explanation text if the lists are empty...
- mFriendsStatusCaption->setVisible(true);
- if (LLFacebookConnect::instance().isConnected())
- {
- //...you're connected to FB but have no friends :(
- mFriendsStatusCaption->setText(getString("facebook_friends_empty"));
- }
- else
- {
- //...you're not connected to FB
- mFriendsStatusCaption->setText(getString("facebook_friends_no_connected"));
- }
- // Hide the lists
- getChild<LLAccordionCtrl>("friends_accordion")->setVisible(false);
- getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(false);
- getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(false);
- }
- else
- {
- // We have something in the lists, hide the explanatory text
- mFriendsStatusCaption->setVisible(false);
-
- // Show the lists
- LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
- accordion->setVisible(true);
-
- // Expand and show accordions if needed, else - hide them
- getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(mSecondLifeFriends->filterHasMatches());
- getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(mSuggestedFriends->filterHasMatches());
-
- // Rearrange accordions
- accordion->arrange();
- }
-}
-
-void LLFacebookFriendsPanel::changed(U32 mask)
-{
- if (mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE))
- {
- LLFacebookConnect::instance().loadFacebookFriends();
- updateFacebookList(true);
- }
-}
-
-
-void LLFacebookFriendsPanel::updateFacebookList(bool visible)
-{
- if (visible)
- {
- // We want this to be called to fetch the friends list once a connection is established
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookFriendsPanel");
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookFriendsPanel", boost::bind(&LLFacebookFriendsPanel::onConnectedToFacebook, this, _1));
-
- // We then want this to be called to update the displayed lists once the list of friends is received
- LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLFacebookFriendsPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLFacebookFriendsPanel", boost::bind(&LLFacebookFriendsPanel::updateSuggestedFriendList, this));
-
- // Try to connect to Facebook
- if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
- (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
- {
- LLFacebookConnect::instance().checkConnectionToFacebook();
- }
- // Loads FB friends
- if (LLFacebookConnect::instance().isConnected())
- {
- LLFacebookConnect::instance().loadFacebookFriends();
- }
- // Sort the FB friends and update the lists
- updateSuggestedFriendList();
- }
-}
-
-bool LLFacebookFriendsPanel::onConnectedToFacebook(const LLSD& data)
-{
- LLSD::Integer connection_state = data.get("enum").asInteger();
-
- if (connection_state == LLFacebookConnect::FB_CONNECTED)
- {
- LLFacebookConnect::instance().loadFacebookFriends();
- }
- else if (connection_state == LLFacebookConnect::FB_NOT_CONNECTED)
- {
- updateSuggestedFriendList();
- }
-
- return false;
-}
-
-////////////////////////
-//LLFloaterFacebook///////
-////////////////////////
-
-LLFloaterFacebook::LLFloaterFacebook(const LLSD& key) : LLFloater(key),
- mFacebookPhotoPanel(NULL),
- mStatusErrorText(NULL),
- mStatusLoadingText(NULL),
- mStatusLoadingIndicator(NULL)
-{
- mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFacebook::onCancel, this));
-}
-
-void LLFloaterFacebook::onClose(bool app_quitting)
-{
- LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
- if (big_preview_floater)
- {
- big_preview_floater->closeOnFloaterOwnerClosing(this);
- }
- LLFloater::onClose(app_quitting);
-}
-
-void LLFloaterFacebook::onCancel()
-{
- LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
- if (big_preview_floater)
- {
- big_preview_floater->closeOnFloaterOwnerClosing(this);
- }
- closeFloater();
-}
-
-BOOL LLFloaterFacebook::postBuild()
-{
- // Keep tab of the Photo Panel
- mFacebookPhotoPanel = static_cast<LLFacebookPhotoPanel*>(getChild<LLUICtrl>("panel_facebook_photo"));
- // Connection status widgets
- mStatusErrorText = getChild<LLTextBox>("connection_error_text");
- mStatusLoadingText = getChild<LLTextBox>("connection_loading_text");
- mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator");
- return LLFloater::postBuild();
-}
-
-void LLFloaterFacebook::showPhotoPanel()
-{
- LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mFacebookPhotoPanel->getParent());
- if (!parent)
- {
- LL_WARNS() << "Cannot find panel container" << LL_ENDL;
- return;
- }
-
- parent->selectTabPanel(mFacebookPhotoPanel);
-}
-
-void LLFloaterFacebook::draw()
-{
- if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
- {
- mStatusErrorText->setVisible(false);
- mStatusLoadingText->setVisible(false);
- mStatusLoadingIndicator->setVisible(false);
- LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
- std::string status_text;
-
- switch (connection_state)
- {
- case LLFacebookConnect::FB_NOT_CONNECTED:
- // No status displayed when first opening the panel and no connection done
- case LLFacebookConnect::FB_CONNECTED:
- // When successfully connected, no message is displayed
- case LLFacebookConnect::FB_POSTED:
- // No success message to show since we actually close the floater after successful posting completion
- break;
- case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
- // Connection loading indicator
- mStatusLoadingText->setVisible(true);
- status_text = LLTrans::getString("SocialFacebookConnecting");
- mStatusLoadingText->setValue(status_text);
- mStatusLoadingIndicator->setVisible(true);
- break;
- case LLFacebookConnect::FB_POSTING:
- // Posting indicator
- mStatusLoadingText->setVisible(true);
- status_text = LLTrans::getString("SocialFacebookPosting");
- mStatusLoadingText->setValue(status_text);
- mStatusLoadingIndicator->setVisible(true);
- break;
- case LLFacebookConnect::FB_CONNECTION_FAILED:
- // Error connecting to the service
- mStatusErrorText->setVisible(true);
- status_text = LLTrans::getString("SocialFacebookErrorConnecting");
- mStatusErrorText->setValue(status_text);
- break;
- case LLFacebookConnect::FB_POST_FAILED:
- // Error posting to the service
- mStatusErrorText->setVisible(true);
- status_text = LLTrans::getString("SocialFacebookErrorPosting");
- mStatusErrorText->setValue(status_text);
- break;
- case LLFacebookConnect::FB_DISCONNECTING:
- // Disconnecting loading indicator
- mStatusLoadingText->setVisible(true);
- status_text = LLTrans::getString("SocialFacebookDisconnecting");
- mStatusLoadingText->setValue(status_text);
- mStatusLoadingIndicator->setVisible(true);
- break;
- case LLFacebookConnect::FB_DISCONNECT_FAILED:
- // Error disconnecting from the service
- mStatusErrorText->setVisible(true);
- status_text = LLTrans::getString("SocialFacebookErrorDisconnecting");
- mStatusErrorText->setValue(status_text);
- break;
- }
- }
- LLFloater::draw();
-}
-
diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h
deleted file mode 100644
index a4ca666b20..0000000000
--- a/indra/newview/llfloaterfacebook.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/**
-* @file llfloaterfacebook.h
-* @brief Header file for llfloaterfacebook
-* @author Gilbert@lindenlab.com
-*
-* $LicenseInfo:firstyear=2013&license=viewerlgpl$
-* Second Life Viewer Source Code
-* Copyright (C) 2013, Linden Research, Inc.
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation;
-* version 2.1 of the License only.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*
-* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
-* $/LicenseInfo$
-*/
-#ifndef LL_LLFLOATERFACEBOOK_H
-#define LL_LLFLOATERFACEBOOK_H
-
-#include "llcallingcard.h"
-#include "llfloater.h"
-#include "lltextbox.h"
-#include "llviewertexture.h"
-
-class LLIconCtrl;
-class LLCheckBoxCtrl;
-class LLSnapshotLivePreview;
-class LLAvatarList;
-class LLFloaterBigPreview;
-
-class LLFacebookStatusPanel : public LLPanel
-{
-public:
- LLFacebookStatusPanel();
- BOOL postBuild();
- void draw();
- void onSend();
- bool onFacebookConnectStateChange(const LLSD& data);
- bool onFacebookConnectAccountStateChange(const LLSD& data);
-
- void sendStatus();
- void clearAndClose();
-
-private:
- void onVisibilityChange(BOOL new_visibility);
- bool onFacebookConnectInfoChange();
- void onConnect();
- void onUseAnotherAccount();
- void onDisconnect();
-
- void showConnectButton();
- void hideConnectButton();
- void showDisconnectedLayout();
- void showConnectedLayout();
-
- LLTextBox * mAccountCaptionLabel;
- LLTextBox * mAccountNameLabel;
- LLUICtrl * mPanelButtons;
- LLUICtrl * mConnectButton;
- LLUICtrl * mDisconnectButton;
- LLUICtrl* mMessageTextEditor;
- LLUICtrl* mPostButton;
- LLUICtrl* mCancelButton;
-};
-
-class LLFacebookPhotoPanel : public LLPanel
-{
-public:
- LLFacebookPhotoPanel();
- ~LLFacebookPhotoPanel();
-
- BOOL postBuild();
- void draw();
-
- LLSnapshotLivePreview* getPreviewView();
- void onVisibilityChange(BOOL new_visibility);
- void onClickBigPreview();
- void onClickNewSnapshot();
- void onSend();
- S32 notify(const LLSD& info);
- bool onFacebookConnectStateChange(const LLSD& data);
-
- void sendPhoto();
- void clearAndClose();
-
- void updateControls();
- void updateResolution(BOOL do_update);
- void checkAspectRatio(S32 index);
- LLUICtrl* getRefreshBtn();
-
-private:
- bool isPreviewVisible();
- void attachPreview();
-
- LLHandle<LLView> mPreviewHandle;
-
- LLUICtrl * mResolutionComboBox;
- LLUICtrl * mFilterComboBox;
- LLUICtrl * mRefreshBtn;
- LLUICtrl * mWorkingLabel;
- LLUICtrl * mThumbnailPlaceholder;
- LLUICtrl * mCaptionTextBox;
- LLUICtrl * mPostButton;
- LLUICtrl * mCancelButton;
- LLButton * mBtnPreview;
-
- LLFloaterBigPreview * mBigPreviewFloater;
-
- S32 mQuality; // Compression quality
-};
-
-class LLFacebookCheckinPanel : public LLPanel
-{
-public:
- LLFacebookCheckinPanel();
- BOOL postBuild();
- void draw();
- void onSend();
- bool onFacebookConnectStateChange(const LLSD& data);
-
- void sendCheckin();
- void clearAndClose();
-
-private:
- std::string mMapUrl;
- LLPointer<LLViewerFetchedTexture> mMapTexture;
- LLUICtrl* mPostButton;
- LLUICtrl* mCancelButton;
- LLUICtrl* mMessageTextEditor;
- LLUICtrl* mMapLoadingIndicator;
- LLIconCtrl* mMapPlaceholder;
- LLIconCtrl* mMapDefault;
- LLCheckBoxCtrl* mMapCheckBox;
- bool mReloadingMapTexture;
-};
-
-class LLFacebookFriendsPanel : public LLPanel, public LLFriendObserver
-{
-public:
- LLFacebookFriendsPanel();
- ~LLFacebookFriendsPanel();
- BOOL postBuild();
- virtual void changed(U32 mask);
-
-private:
- bool updateSuggestedFriendList();
- void showFriendsAccordionsIfNeeded();
- void updateFacebookList(bool visible);
- bool onConnectedToFacebook(const LLSD& data);
-
- LLTextBox * mFriendsStatusCaption;
- LLAvatarList* mSecondLifeFriends;
- LLAvatarList* mSuggestedFriends;
-};
-
-class LLFloaterFacebook : public LLFloater
-{
-public:
- LLFloaterFacebook(const LLSD& key);
- BOOL postBuild();
- void draw();
- void onClose(bool app_quitting);
- void onCancel();
-
- void showPhotoPanel();
-
-private:
- LLFacebookPhotoPanel* mFacebookPhotoPanel;
- LLTextBox* mStatusErrorText;
- LLTextBox* mStatusLoadingText;
- LLUICtrl* mStatusLoadingIndicator;
-};
-
-#endif // LL_LLFLOATERFACEBOOK_H
-
diff --git a/indra/newview/llfloateroutfitsnapshot.cpp b/indra/newview/llfloateroutfitsnapshot.cpp
index d80793f9e4..bfcd1b8b47 100644
--- a/indra/newview/llfloateroutfitsnapshot.cpp
+++ b/indra/newview/llfloateroutfitsnapshot.cpp
@@ -30,9 +30,7 @@
#include "llfloateroutfitsnapshot.h"
#include "llagent.h"
-#include "llfacebookconnect.h"
#include "llfloaterreg.h"
-#include "llfloaterfacebook.h"
#include "llfloaterflickr.h"
#include "llfloatertwitter.h"
#include "llimagefiltersmanager.h"
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index c08aaf3f50..8e0f6f312d 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -28,9 +28,7 @@
#include "llfloatersnapshot.h"
-#include "llfacebookconnect.h"
#include "llfloaterreg.h"
-#include "llfloaterfacebook.h"
#include "llfloaterflickr.h"
#include "llfloatertwitter.h"
#include "llimagefiltersmanager.h"
@@ -1241,11 +1239,10 @@ BOOL LLFloaterSnapshot::isWaitingState()
BOOL LLFloaterSnapshotBase::ImplBase::updatePreviewList(bool initialized)
{
- LLFloaterFacebook* floater_facebook = LLFloaterReg::findTypedInstance<LLFloaterFacebook>("facebook");
LLFloaterFlickr* floater_flickr = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr");
LLFloaterTwitter* floater_twitter = LLFloaterReg::findTypedInstance<LLFloaterTwitter>("twitter");
- if (!initialized && !floater_facebook && !floater_flickr && !floater_twitter)
+ if (!initialized && !floater_flickr && !floater_twitter)
return FALSE;
BOOL changed = FALSE;
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 3b17368445..13953d6be5 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -30,7 +30,6 @@
#include "lliconctrl.h"
#include "llfloaterreg.h"
#include "llhttpconstants.h"
-#include "llfacebookconnect.h"
#include "llflickrconnect.h"
#include "lltwitterconnect.h"
#include "lllayoutstack.h"
@@ -289,17 +288,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key)
//virtual
void LLFloaterWebContent::onClose(bool app_quitting)
{
- // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen
- // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
- LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web");
- if (fbc_web == this)
- {
- if (!LLFacebookConnect::instance().isConnected())
- {
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
- }
- }
- // Same with Flickr
+ // If we close the web browsing window showing the Flickr login, we need to signal to this object that the connection will not happen
// MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
LLFloater* flickr_web = LLFloaterReg::findInstance("flickr_web");
if (flickr_web == this)
@@ -309,7 +298,7 @@ void LLFloaterWebContent::onClose(bool app_quitting)
LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_FAILED);
}
}
- // And Twitter
+ // Same with Twitter
// MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
LLFloater* twitter_web = LLFloaterReg::findInstance("twitter_web");
if (twitter_web == this)
@@ -380,13 +369,6 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
// The browser instance wants its window closed.
closeFloater();
}
- else if(event == MEDIA_EVENT_GEOMETRY_CHANGE)
- {
- if (mCurrentURL.find("facebook.com/dialog/oauth") == std::string::npos) // HACK to fix ACME-1317 - Cho
- {
- geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
- }
- }
else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED )
{
const std::string text = self->getStatusText();
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index fef0631fa6..ba831ab2ed 100644
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -35,7 +35,6 @@
#include "llnotificationmanager.h"
#include "llnotifications.h"
#include "llscriptfloater.h"
-#include "llfacebookconnect.h"
#include "llavatarname.h"
#include "llavatarnamecache.h"
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 1cbff37287..82feadd4ed 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -54,7 +54,6 @@
#include "llcallingcard.h" // for LLAvatarTracker
#include "llcallbacklist.h"
#include "llerror.h"
-#include "llfacebookconnect.h"
#include "llfloateravatarpicker.h"
#include "llfriendcard.h"
#include "llgroupactions.h"
@@ -536,7 +535,6 @@ public:
LLPanelPeople::LLPanelPeople()
: LLPanel(),
- mTryToConnectToFacebook(true),
mTabContainer(NULL),
mOnlineFriendList(NULL),
mAllFriendList(NULL),
@@ -633,11 +631,9 @@ BOOL LLPanelPeople::postBuild()
// updater is active only if panel is visible to user.
friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2));
friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this));
- friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2));
mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online");
mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all");
- mSuggestedFriends = friends_tab->getChild<LLAvatarList>("suggested_friends");
mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online"));
mOnlineFriendList->setShowIcons("FriendsListShowIcons");
mOnlineFriendList->showPermissions("FriendsListShowPermissions");
@@ -673,7 +669,6 @@ BOOL LLPanelPeople::postBuild()
mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
- mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false);
setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false);
@@ -752,7 +747,7 @@ void LLPanelPeople::updateFriendListHelpText()
// Seems sometimes all_friends can be empty because of issue with Inventory loading (clear cache, slow connection...)
// So, lets check all lists to avoid overlapping the text with online list. See EXT-6448.
- bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches() || mSuggestedFriends->filterHasMatches();
+ bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches();
no_friends_text->setVisible(!any_friend_exists);
if (no_friends_text->getVisible())
{
@@ -819,40 +814,9 @@ void LLPanelPeople::updateFriendList()
mAllFriendList->setDirty(true, !mAllFriendList->filterHasMatches());
//update trash and other buttons according to a selected item
updateButtons();
- updateSuggestedFriendList();
showFriendsAccordionsIfNeeded();
}
-bool LLPanelPeople::updateSuggestedFriendList()
-{
- const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
- uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs();
- suggested_friends.clear();
-
- //Add suggested friends
- LLSD friends = LLFacebookConnect::instance().getContent();
- for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
- {
- LLUUID agent_id = (*i).asUUID();
- bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false;
-
- if(!second_life_buddy)
- {
- //FB+SL but not SL friend
- if (agent_id.notNull())
- {
- suggested_friends.push_back(agent_id);
- }
- }
- }
-
- //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
- mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
- showFriendsAccordionsIfNeeded();
-
- return false;
-}
-
void LLPanelPeople::updateNearbyList()
{
if (!mNearbyList)
@@ -876,51 +840,6 @@ void LLPanelPeople::updateRecentList()
mRecentList->setDirty();
}
-bool LLPanelPeople::onConnectedToFacebook(const LLSD& data)
-{
- LLSD::Integer connection_state = data.get("enum").asInteger();
-
- if (connection_state == LLFacebookConnect::FB_CONNECTED)
- {
- LLFacebookConnect::instance().loadFacebookFriends();
- }
- else if(connection_state == LLFacebookConnect::FB_NOT_CONNECTED)
- {
- updateSuggestedFriendList();
- };
-
- return false;
-}
-
-void LLPanelPeople::updateFacebookList(bool visible)
-{
- if (visible)
- {
- LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this));
-
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1));
-
- if (LLFacebookConnect::instance().isConnected())
- {
- LLFacebookConnect::instance().loadFacebookFriends();
- }
- else if(mTryToConnectToFacebook)
- {
- LLFacebookConnect::instance().checkConnectionToFacebook();
- mTryToConnectToFacebook = false;
- }
-
- updateSuggestedFriendList();
- }
- else
- {
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople");
- LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople");
- }
-}
-
void LLPanelPeople::updateButtons()
{
std::string cur_tab = getActiveTabName();
@@ -1139,11 +1058,9 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
mOnlineFriendList->setNameFilter(filter);
mAllFriendList->setNameFilter(filter);
- mSuggestedFriends->setNameFilter(filter);
setAccordionCollapsedByUser("tab_online", false);
setAccordionCollapsedByUser("tab_all", false);
- setAccordionCollapsedByUser("tab_suggested_friends", false);
showFriendsAccordionsIfNeeded();
// restore accordion tabs state _after_ all manipulations
@@ -1571,7 +1488,6 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded()
// Expand and show accordions if needed, else - hide them
showAccordion("tab_online", mOnlineFriendList->filterHasMatches());
showAccordion("tab_all", mAllFriendList->filterHasMatches());
- showAccordion("tab_suggested_friends", mSuggestedFriends->filterHasMatches());
// Rearrange accordions
LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index c72c4fc08a..14205cebe2 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -57,8 +57,6 @@ public:
// when voice is available
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
- bool mTryToConnectToFacebook;
-
// internals
class Updater;
@@ -80,10 +78,8 @@ private:
// methods indirectly called by the updaters
void updateFriendListHelpText();
void updateFriendList();
- bool updateSuggestedFriendList();
void updateNearbyList();
void updateRecentList();
- void updateFacebookList(bool visible);
bool isItemsFreeOfFriends(const uuid_vec_t& uuids);
@@ -131,8 +127,6 @@ private:
void onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param);
- bool onConnectedToFacebook(const LLSD& data);
-
void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed);
void setAccordionCollapsedByUser(const std::string& name, bool collapsed);
bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
@@ -141,7 +135,6 @@ private:
LLTabContainer* mTabContainer;
LLAvatarList* mOnlineFriendList;
LLAvatarList* mAllFriendList;
- LLAvatarList* mSuggestedFriends;
LLAvatarList* mNearbyList;
LLAvatarList* mRecentList;
LLGroupList* mGroupList;
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 65769ff526..42cecc9986 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -52,7 +52,6 @@ namespace LLPanelPeopleMenus
PeopleContextMenu gPeopleContextMenu;
NearbyPeopleContextMenu gNearbyPeopleContextMenu;
-SuggestedFriendsContextMenu gSuggestedFriendsContextMenu;
//== PeopleContextMenu ===============================================================
@@ -413,36 +412,4 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
-//== SuggestedFriendsContextMenu ===============================================================
-
-LLContextMenu* SuggestedFriendsContextMenu::createMenu()
-{
- // set up the callbacks for all of the avatar menu items
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
- LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
- LLContextMenu* menu;
-
- // Set up for one person selected menu
- const LLUUID& id = mUUIDs.front();
- registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id));
- registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id));
-
- // create the context menu from the XUI
- menu = createFromFile("menu_people_nearby.xml");
- buildContextMenu(*menu, 0x0);
-
- return menu;
-}
-
-void SuggestedFriendsContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
-{
- menuentry_vec_t items;
- menuentry_vec_t disabled_items;
-
- items.push_back(std::string("view_profile"));
- items.push_back(std::string("add_friend"));
-
- hide_context_entries(menu, items, disabled_items);
-}
-
} // namespace LLPanelPeopleMenus
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index 5ed20e0064..3bc1f8caf7 100644
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -62,21 +62,8 @@ protected:
/*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
};
-/**
- * Menu used in the suggested friends list.
- */
-class SuggestedFriendsContextMenu : public PeopleContextMenu
-{
-public:
- /*virtual*/ LLContextMenu * createMenu();
-
-protected:
- /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
-};
-
extern PeopleContextMenu gPeopleContextMenu;
extern NearbyPeopleContextMenu gNearbyPeopleContextMenu;
-extern SuggestedFriendsContextMenu gSuggestedFriendsContextMenu;
} // namespace LLPanelPeopleMenus
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 95c14e4226..23747a8efd 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -32,7 +32,6 @@
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
#include "llfloaterreg.h"
-#include "llfloaterfacebook.h"
#include "llfloaterflickr.h"
#include "llfloatertwitter.h"
@@ -59,7 +58,6 @@ private:
void onSaveToEmail();
void onSaveToInventory();
void onSaveToComputer();
- void onSendToFacebook();
void onSendToTwitter();
void onSendToFlickr();
@@ -74,7 +72,6 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions()
mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
- mCommitCallbackRegistrar.add("Snapshot.SendToFacebook", boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this));
mCommitCallbackRegistrar.add("Snapshot.SendToTwitter", boost::bind(&LLPanelSnapshotOptions::onSendToTwitter, this));
mCommitCallbackRegistrar.add("Snapshot.SendToFlickr", boost::bind(&LLPanelSnapshotOptions::onSendToFlickr, this));
LLGlobalEconomy::getInstance()->addObserver(this);
@@ -138,18 +135,6 @@ void LLPanelSnapshotOptions::onSaveToComputer()
openPanel("panel_snapshot_local");
}
-void LLPanelSnapshotOptions::onSendToFacebook()
-{
- LLFloaterReg::hideInstance("snapshot");
-
- LLFloaterFacebook* facebook_floater = dynamic_cast<LLFloaterFacebook*>(LLFloaterReg::getInstance("facebook"));
- if (facebook_floater)
- {
- facebook_floater->showPhotoPanel();
- }
- LLFloaterReg::showInstance("facebook");
-}
-
void LLPanelSnapshotOptions::onSendToTwitter()
{
LLFloaterReg::hideInstance("snapshot");
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 5a40af14a3..f5fea9dece 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -34,7 +34,6 @@
#include "lleconomy.h"
#include "llfloaterperms.h"
#include "llfloaterreg.h"
-#include "llfloaterfacebook.h"
#include "llfloaterflickr.h"
#include "llfloatertwitter.h"
#include "llimagefilter.h"
@@ -572,7 +571,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
if (mThumbnailSubsampled)
{
- // The thumbnail is be a subsampled version of the preview (used in SL Share previews, i.e. Flickr, Twitter, Facebook)
+ // The thumbnail is be a subsampled version of the preview (used in SL Share previews, i.e. Flickr, Twitter)
raw->resize( mPreviewImage->getWidth(),
mPreviewImage->getHeight(),
mPreviewImage->getComponents());
@@ -638,7 +637,7 @@ LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage()
if (raw)
{
- // The big thumbnail is a new filtered version of the preview (used in SL Share previews, i.e. Flickr, Twitter, Facebook)
+ // The big thumbnail is a new filtered version of the preview (used in SL Share previews, i.e. Flickr, Twitter)
mBigThumbnailWidth = mPreviewImage->getWidth();
mBigThumbnailHeight = mPreviewImage->getHeight();
raw->resize( mBigThumbnailWidth,
diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp
index 5d598aaebe..b2d2fa9d77 100644
--- a/indra/newview/lltwitterconnect.cpp
+++ b/indra/newview/lltwitterconnect.cpp
@@ -28,6 +28,7 @@
#include "llviewerprecompiledheaders.h"
#include "lltwitterconnect.h"
+#include "llflickrconnect.h"
#include "llagent.h"
#include "llcallingcard.h" // for LLAvatarTracker
@@ -65,6 +66,49 @@ void toast_user_for_twitter_success()
LLNotificationsUtil::add("TwitterConnect", args);
}
+class LLTwitterConnectHandler : public LLCommandHandler
+{
+public:
+ LLTwitterConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) {}
+
+ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ if (tokens.size() >= 1)
+ {
+ if (tokens[0].asString() == "connect")
+ {
+ if (tokens.size() >= 2 && tokens[1].asString() == "twitter")
+ {
+ // this command probably came from the twitter_web browser, so close it
+ LLFloaterReg::hideInstance("twitter_web");
+
+ // connect to twitter
+ if (query_map.has("oauth_token"))
+ {
+ LLTwitterConnect::instance().connectToTwitter(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
+ }
+ else if (tokens.size() >= 2 && tokens[1].asString() == "flickr")
+ {
+ // this command probably came from the flickr_web browser, so close it
+ LLFloaterReg::hideInstance("flickr_web");
+
+ // connect to flickr
+ if (query_map.has("oauth_token"))
+ {
+ LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+};
+LLTwitterConnectHandler gTwitterConnectHandler;
+
+
///////////////////////////////////////////////////////////////////////////////
//
void LLTwitterConnect::twitterConnectCoro(std::string requestToken, std::string oauthVerifier)
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 2a61c26b30..f475ab7d66 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -67,7 +67,6 @@
#include "llfloaterexperiences.h"
#include "llfloaterexperiencepicker.h"
#include "llfloaterevent.h"
-#include "llfloaterfacebook.h"
#include "llfloaterflickr.h"
#include "llfloaterfonttest.h"
#include "llfloatergesture.h"
@@ -353,11 +352,9 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
- LLFloaterReg::add("fbc_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
LLFloaterReg::add("flickr_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
LLFloaterReg::add("twitter_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
- LLFloaterReg::add("facebook", "floater_facebook.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFacebook>);
LLFloaterReg::add("flickr", "floater_flickr.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFlickr>);
LLFloaterReg::add("twitter", "floater_twitter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTwitter>);
LLFloaterReg::add("big_preview", "floater_big_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBigPreview>);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 9f02c4b17c..a27a083a2a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1707,7 +1707,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
// HACK: we always try to keep a spare running webkit plugin around to improve launch times.
// If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it.
- // Do not use a spare if launching with full viewer control (e.g. Facebook, Twitter and few others)
+ // Do not use a spare if launching with full viewer control (e.g. Twitter and few others)
if ((plugin_basename == "media_plugin_cef") &&
!gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins") && !clean_browser)
{
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8f7c0ee012..2b9f0f642e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -54,7 +54,6 @@
#include "lldaycyclemanager.h"
#include "lldebugview.h"
#include "llenvmanager.h"
-#include "llfacebookconnect.h"
#include "llfilepicker.h"
#include "llfirstuse.h"
#include "llfloaterabout.h"
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 4d9288f152..90b6510c1f 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -2895,7 +2895,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("EstateAccess");
capabilityNames.append("EstateChangeInfo");
capabilityNames.append("EventQueueGet");
- capabilityNames.append("FacebookConnect");
capabilityNames.append("FlickrConnect");
capabilityNames.append("TwitterConnect");
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 2540ee148d..d45df0d630 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -133,7 +133,6 @@ with the same filename but different name
<texture name="Command_Chat_Icon" file_name="toolbar_icons/chat.png" preload="true" />
<texture name="Command_Compass_Icon" file_name="toolbar_icons/land.png" preload="true" />
<texture name="Command_Destinations_Icon" file_name="toolbar_icons/destinations.png" preload="true" />
- <texture name="Command_Facebook_Icon" file_name="toolbar_icons/facebook.png" preload="true" />
<texture name="Command_Flickr_Icon" file_name="toolbar_icons/flickr.png" preload="true" />
<texture name="Command_Gestures_Icon" file_name="toolbar_icons/gestures.png" preload="true" />
<texture name="Command_Grid_Status_Icon" file_name="toolbar_icons/grid_status.png" preload="true" />
@@ -205,8 +204,6 @@ with the same filename but different name
<texture name="ExternalBrowser_Off" file_name="icons/ExternalBrowser_Off.png" preload="false" />
<texture name="Edit_Wrench" file_name="icons/Edit_Wrench.png" preload="false" />
- <texture name="Facebook_Icon" file_name="icons/Facebook.png" preload="false" />
-
<texture name="Presets_Icon" file_name="icons/Presets_Icon.png" preload="true" />
<texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" />
@@ -592,7 +589,6 @@ with the same filename but different name
<texture name="Snapshot_Email" file_name="snapshot_email.png" preload="false" />
<texture name="Snapshot_Inventory" file_name="toolbar_icons/inventory.png" preload="false" />
<texture name="Snapshot_Profile" file_name="toolbar_icons/profile.png" preload="false" />
- <texture name="Snapshot_Facebook" file_name="toolbar_icons/facebook.png" preload="false" />
<texture name="startup_logo" file_name="windows/startup_logo.png" preload="true" />
diff --git a/indra/newview/skins/default/xui/en/floater_facebook.xml b/indra/newview/skins/default/xui/en/floater_facebook.xml
deleted file mode 100644
index b34d70516a..0000000000
--- a/indra/newview/skins/default/xui/en/floater_facebook.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<floater
- positioning="cascading"
- can_close="true"
- help_topic="floater_facebook"
- layout="topleft"
- name="floater_facebook"
- save_rect="true"
- single_instance="true"
- reuse_instance="true"
- title="POST TO FACEBOOK"
- min_height="462"
- min_width="304"
- height="462"
- width="272">
- <tab_container
- name="tabs"
- tab_group="1"
- tab_min_width="64"
- tab_height="21"
- tab_position="top"
- top="7"
- height="437"
- follows="all"
- halign="center">
- <panel
- filename="panel_facebook_status.xml"
- class="llfacebookstatuspanel"
- follows="all"
- label="STATUS"
- name="panel_facebook_status"/>
- <panel
- filename="panel_facebook_photo.xml"
- class="llfacebookphotopanel"
- follows="all"
- label="PHOTO"
- name="panel_facebook_photo"/>
- <panel
- filename="panel_facebook_place.xml"
- class="llfacebookcheckinpanel"
- follows="all"
- label="CHECK IN"
- name="panel_facebook_place"/>
- <panel
- filename="panel_facebook_friends.xml"
- class="llfacebookfriendspanel"
- follows="all"
- label="FRIENDS"
- name="panel_facebook_friends"/>
- <!--<panel
- filename="panel_facebook_account.xml"
- class="llfacebookaccountpanel"
- follows="all"
- label="ACCOUNT"
- name="panel_facebook_account"/>-->
- </tab_container>
- <text
- name="connection_error_text"
- type="string"
- follows="left|bottom|right"
- bottom="-5"
- left="10"
- width="250"
- height="20"
- wrap="true"
- halign="left"
- valign="center"
- text_color="DrYellow"
- font="SansSerif">
- Error
- </text>
- <loading_indicator
- follows="left|bottom"
- height="24"
- width="24"
- name="connection_loading_indicator"
- top_delta="-2"
- left="10"
- visible="true"/>
- <text
- name="connection_loading_text"
- type="string"
- follows="left|bottom|right"
- top_delta="2"
- left_pad="5"
- width="250"
- height="20"
- wrap="true"
- halign="left"
- valign="center"
- text_color="EmphasisColor"
- font="SansSerif">
- Loading...
- </text>
-</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index e50747cb5f..832c2ee7da 100644
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -24,10 +24,6 @@
Sending Email
</string>
<string
- name="facebook_progress_str">
- Posting to Facebook
- </string>
- <string
name="profile_progress_str">
Posting
</string>
@@ -40,10 +36,6 @@
Saving to Computer
</string>
<string
- name="facebook_succeeded_str">
- Image uploaded
- </string>
- <string
name="profile_succeeded_str">
Image uploaded
</string>
@@ -60,10 +52,6 @@
Saved to Computer!
</string>
<string
- name="facebook_failed_str">
- Failed to upload image to your Facebook timeline.
- </string>
- <string
name="profile_failed_str">
Failed to upload image to your Profile Feed.
</string>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 9998f33c52..87a0bb7d70 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -307,13 +307,6 @@
</menu_item_check>
<menu_item_separator/>
<menu_item_call
- label="Facebook..."
- name="Facebook">
- <menu_item_call.on_click
- function="Floater.Toggle"
- parameter="facebook"/>
- </menu_item_call>
- <menu_item_call
label="Twitter..."
name="Twitter">
<menu_item_call.on_click
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index b7cd6517ea..77db71d536 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6705,13 +6705,6 @@ Please select at least one type of content to search (General, Moderate, or Adul
[MESSAGE]
</notification>
- <notification
- icon="notify.tga"
- name="FacebookConnect"
- type="notifytip">
-[MESSAGE]
- </notification>
-
<notification
icon="notify.tga"
name="FlickrConnect"
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
deleted file mode 100644
index 97994fb08b..0000000000
--- a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<panel
- height="400"
- width="272"
- layout="topleft"
- follows="all"
- name="panel_facebook_friends">
- <string
- name="facebook_friends_empty"
- value="You currently do not have any Facebook friends who are also Second Life residents. Ask your Facebook friends to join Second Life today!" />
- <string
- name="facebook_friends_no_connected"
- value="You're currently not connected to Facebook. Please go to the Status tab to connect and enable this feature." />
- <accordion
- background_visible="false"
- bg_alpha_color="DkGray2"
- bg_opaque_color="DkGray2"
- follows="all"
- height="383"
- layout="topleft"
- left="10"
- name="friends_accordion"
- right="-10"
- top_pad="2">
- <accordion_tab
- layout="topleft"
- height="173"
- name="tab_second_life_friends"
- title="SL friends">
- <avatar_list
- ignore_online_status="true"
- allow_select="true"
- follows="all"
- height="173"
- layout="topleft"
- left="0"
- name="second_life_friends"
- show_permissions_granted="true"
- top="0"
- width="272" />
- </accordion_tab>
- <accordion_tab
- layout="topleft"
- height="173"
- name="tab_suggested_friends"
- title="Add these people as SL friends">
- <avatar_list
- ignore_online_status="true"
- allow_select="true"
- follows="all"
- height="173"
- layout="topleft"
- left="0"
- name="suggested_friends"
- show_permissions_granted="true"
- top="0"
- width="272" />
- </accordion_tab>
- </accordion>
- <text
- layout="topleft"
- word_wrap="true"
- height="64"
- width="250"
- follows="top|left|right"
- font="SansSerif"
- left="10"
- right="-10"
- name="facebook_friends_status"
- top="5"
- type="string">
- Not connected to Facebook.
- </text>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml
deleted file mode 100644
index 97355f4689..0000000000
--- a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml
+++ /dev/null
@@ -1,169 +0,0 @@
- <panel
- height="400"
- width="272"
- layout="topleft"
- follows="all"
- name="panel_facebook_photo">
- <combo_box
- control_name="FacebookPhotoResolution"
- follows="left|top"
- layout="topleft"
- top="7"
- left="10"
- name="resolution_combobox"
- tool_tip="Image resolution"
- height="21"
- width="124">
- <combo_box.item
- label="Current Window"
- name="CurrentWindow"
- value="[i0,i0]" />
- <combo_box.item
- label="640x480"
- name="640x480"
- value="[i640,i480]" />
- <combo_box.item
- label="800x600"
- name="800x600"
- value="[i800,i600]" />
- <combo_box.item
- label="1024x768"
- name="1024x768"
- value="[i1024,i768]" />
- <combo_box.item
- label="1200x630"
- name="1200x630"
- value="[i1200,i630]" />
- </combo_box>
- <combo_box
- control_name="FacebookPhotoFilters"
- follows="left|top"
- layout="topleft"
- name="filters_combobox"
- tool_tip="Image filters"
- top="7"
- left_pad="4"
- height="21"
- width="124">
- <combo_box.item
- label="No Filter"
- name="NoFilter"
- value="NoFilter" />
- </combo_box>
- <panel
- height="150"
- width="252"
- visible="true"
- layout="topleft"
- name="thumbnail_placeholder"
- top_pad="5"
- follows="left|top|rith"
- right="-10"
- left="10">
- </panel>
- <text
- follows="left|top"
- layout="topleft"
- font="SansSerif"
- text_color="EmphasisColor"
- height="14"
- top_pad="2"
- left="10"
- length="1"
- halign="center"
- name="working_lbl"
- translate="false"
- type="string"
- visible="true"
- width="251">
- Refreshing...
- </text>
- <view_border
- bevel_style="in"
- follows="left|top"
- layout="topleft"
- height="1"
- left="10"
- name="refresh_border"
- width="250"
- top_pad="0"/>
- <button
- follows="left|top"
- layout="topleft"
- height="23"
- label="Refresh"
- left="10"
- top_pad="5"
- name="new_snapshot_btn"
- tool_tip="Click to refresh"
- visible="true"
- width="100" >
- <button.commit_callback
- function="SocialSharing.RefreshPhoto" />
- </button>
- <button
- follows="right|top"
- layout="topleft"
- height="23"
- label="Preview"
- right="-10"
- top_delta="0"
- name="big_preview_btn"
- tool_tip="Click to toggle preview"
- is_toggle="true"
- visible="true"
- width="100" >
- <button.commit_callback
- function="SocialSharing.BigPreview" />
- </button>
- <text
- length="1"
- follows="top|left|right"
- layout="topleft"
- font="SansSerif"
- height="16"
- left="10"
- name="caption_label"
- top_pad="20"
- type="string">
- Comment (optional):
- </text>
- <text_editor
- follows="left|top|right|bottom"
- layout="topleft"
- height="87"
- width="250"
- left="10"
- right="-10"
- length="1"
- max_length="700"
- name="photo_caption"
- spellcheck="true"
- type="string"
- word_wrap="true">
- </text_editor>
- <button
- follows="left|top"
- layout="topleft"
- top_pad="22"
- left="10"
- height="23"
- label="Post"
- name="post_photo_btn"
- width="100">
- <button.commit_callback
- function="SocialSharing.SendPhoto" />
- </button>
- <button
- follows="right|top"
- layout="topleft"
- height="23"
- label="Cancel"
- name="cancel_photo_btn"
- right="-10"
- top_delta="0"
- width="100">
- <button.commit_callback
- function="SocialSharing.Cancel" />
- </button>
- </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_place.xml b/indra/newview/skins/default/xui/en/panel_facebook_place.xml
deleted file mode 100644
index f87b008c4e..0000000000
--- a/indra/newview/skins/default/xui/en/panel_facebook_place.xml
+++ /dev/null
@@ -1,113 +0,0 @@
- <panel
- height="400"
- width="272"
- layout="topleft"
- follows="all"
- name="panel_facebook_place">
- <text
- length="1"
- follows="top|left|right"
- layout="topleft"
- font="SansSerif"
- height="16"
- left="10"
- name="place_caption_label"
- top="5"
- type="string">
- Say something about where you are:
- </text>
- <text_editor
- follows="top|left|right"
- layout="topleft"
- height="70"
- width="250"
- left="10"
- right="-10"
- length="1"
- max_length="700"
- name="place_caption"
- type="string"
- word_wrap="true">
- </text_editor>
- <check_box
- follows="left|top"
- layout="topleft"
- initial_value="false"
- height="16"
- top_pad="8"
- width="8"
- label="Include overhead view of location"
- name="add_place_view_cb"
- left="10"/>
- <panel
- follows="left|top"
- layout="topleft"
- height="243"
- width="250"
- background_visible="true"
- bg_opaque_color="Black"
- bg_alpha_color="Black"
- top_pad="8"
- left="10"
- right="-12"
- visible="true"
- name="map_border">
- </panel>
- <icon
- follows="left|top"
- layout="topleft"
- height="243"
- width="250"
- image_name="Map_Placeholder_Icon"
- top_delta="0"
- right="-12"
- left="10"
- visible="true"
- name="map_placeholder">
- </icon>
- <icon
- follows="left|top"
- layout="topleft"
- height="243"
- width="250"
- image_name="Map_Placeholder_Icon"
- top_delta="0"
- left="10"
- right="-12"
- visible="true"
- name="map_default">
- </icon>
- <loading_indicator
- follows="left|top"
- layout="topleft"
- height="24"
- width="24"
- name="map_loading_indicator"
- top_delta="116"
- left="126"
- visible="false"/>
- <button
- follows="left|bottom"
- layout="topleft"
- top_pad="95"
- left="10"
- height="23"
- label="Post"
- name="post_place_btn"
- width="100">
- <button.commit_callback
- function="SocialSharing.SendCheckin" />
- </button>
- <button
- follows="right|bottom"
- layout="topleft"
- height="23"
- label="Cancel"
- name="cancel_place_btn"
- right="-10"
- top_delta="0"
- width="100">
- <button.commit_callback
- function="SocialSharing.Cancel" />
- </button>
- </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_status.xml b/indra/newview/skins/default/xui/en/panel_facebook_status.xml
deleted file mode 100644
index fe0f3c9279..0000000000
--- a/indra/newview/skins/default/xui/en/panel_facebook_status.xml
+++ /dev/null
@@ -1,130 +0,0 @@
- <panel
- height="400"
- width="272"
- follows="all"
- layout="topleft"
- name="panel_facebook_status">
- <string
- name="facebook_connected"
- value="You are connected to Facebook as:" />
- <string
- name="facebook_disconnected"
- value="Not connected to Facebook" />
- <text
- layout="topleft"
- length="1"
- follows="top|left"
- font="SansSerif"
- height="16"
- left="10"
- name="account_caption_label"
- top="5"
- type="string">
- Not connected to Facebook.
- </text>
- <text
- layout="topleft"
- top_pad="2"
- length="1"
- follows="top|left"
- font="SansSerif"
- height="16"
- left="10"
- name="account_name_label"
- parse_urls="true"
- type="string"/>
- <panel
- layout="topleft"
- follows="left|top"
- name="panel_buttons"
- height="60"
- left="0">
- <button
- layout="topleft"
- follows="left|top"
- top_pad="9"
- left="10"
- visible="true"
- height="23"
- label="Connect..."
- name="connect_btn"
- width="251">
- <commit_callback function="SocialSharing.Connect"/>
- </button>
-
- <button
- layout="topleft"
- follows="left|top|right"
- top_delta="0"
- left="10"
- right="-10"
- height="23"
- label="Disconnect"
- name="disconnect_btn"
- width="210"
- visible="false">
- <commit_callback function="SocialSharing.Disconnect"/>
- </button>
- <text
- layout="topleft"
- length="1"
- follows="top|left|right"
- left="10"
- right="-10"
- height="16"
- name="account_learn_more_label"
- top_pad="5"
- type="string">
- [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Learn about posting to Facebook]
- </text>
- </panel>
-
- <text
- length="1"
- layout="topleft"
- follows="top|left|right"
- font="SansSerif"
- height="16"
- left="10"
- name="status_caption_label"
- top_pad="5"
- type="string">
- What's on your mind?
- </text>
- <text_editor
- follows="left|top|right"
- layout="topleft"
- height="150"
- width="252"
- left="10"
- length="1"
- max_length="700"
- name="status_message"
- type="string"
- word_wrap="true">
- </text_editor>
- <button
- follows="left|top"
- layout="topleft"
- top_pad="6"
- left="10"
- height="23"
- label="Post"
- name="post_status_btn"
- width="100">
- <button.commit_callback
- function="SocialSharing.SendStatus" />
- </button>
- <button
- follows="right|top"
- layout="topleft"
- height="23"
- label="Cancel"
- name="cancel_status_btn"
- right="-10"
- top_delta="0"
- width="100">
- <button.commit_callback
- function="SocialSharing.Cancel" />
- </button>
- </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 8fc0f6f642..a47121ae99 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -367,24 +367,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
show_permissions_granted="true"
top="0"
width="307" />
- </accordion_tab>
- <accordion_tab
- layout="topleft"
- height="173"
- name="tab_suggested_friends"
- title="People you may want to friend">
- <avatar_list
- ignore_online_status="true"
- allow_select="true"
- follows="all"
- height="173"
- layout="topleft"
- left="0"
- name="suggested_friends"
- show_permissions_granted="true"
- top="0"
- width="307" />
- </accordion_tab>
+ </accordion_tab>
</accordion>
<text
follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 305cce1cbe..981b9ab881 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -61,23 +61,6 @@
font="SansSerif"
halign="left"
height="22"
- image_overlay="Snapshot_Facebook"
- image_overlay_alignment="left"
- image_top_pad="0"
- imgoverlay_label_space="10"
- label="Share to Facebook"
- layout="topleft"
- left_delta="0"
- name="send_to_facebook_btn"
- top_pad="5">
- <button.commit_callback
- function="Snapshot.SendToFacebook"/>
- </button>
- <button
- follows="left|top"
- font="SansSerif"
- halign="left"
- height="22"
image_overlay="Command_Twitter_Icon"
image_overlay_alignment="left"
image_top_pad="0"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index e567e410bc..1e4ab75d66 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -202,13 +202,7 @@ Please try logging in again in a minute.</string>
<string name="SentToInvalidRegion">You were sent to an invalid region.</string>
<string name="TestingDisconnect">Testing viewer disconnect</string>
- <!-- SLShare: Facebook, Flickr, and Twitter -->
- <string name="SocialFacebookConnecting">Connecting to Facebook...</string>
- <string name="SocialFacebookPosting">Posting...</string>
- <string name="SocialFacebookDisconnecting">Disconnecting from Facebook...</string>
- <string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string>
- <string name="SocialFacebookErrorPosting">Problem posting to Facebook</string>
- <string name="SocialFacebookErrorDisconnecting">Problem disconnecting from Facebook</string>
+ <!-- SLShare: Flickr and Twitter -->
<string name="SocialFlickrConnecting">Connecting to Flickr...</string>
<string name="SocialFlickrPosting">Posting...</string>
<string name="SocialFlickrDisconnecting">Disconnecting from Flickr...</string>
@@ -3656,9 +3650,6 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
Drag items from inventory here
</string>
- <string name="facebook_post_success">
- You posted to Facebook.
- </string>
<string name="flickr_post_success">
You posted to Flickr.
</string>
@@ -4090,7 +4081,6 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Conversations_Label">Conversations</string>
<string name="Command_Compass_Label">Compass</string>
<string name="Command_Destinations_Label">Destinations</string>
- <string name="Command_Facebook_Label">Facebook</string>
<string name="Command_Flickr_Label">Flickr</string>
<string name="Command_Gestures_Label">Gestures</string>
<string name="Command_Grid_Status_Label">Grid status</string>
@@ -4123,7 +4113,6 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Conversations_Tooltip">Converse with everyone</string>
<string name="Command_Compass_Tooltip">Compass</string>
<string name="Command_Destinations_Tooltip">Destinations of interest</string>
- <string name="Command_Facebook_Tooltip">Post to Facebook</string>
<string name="Command_Flickr_Tooltip">Upload to Flickr</string>
<string name="Command_Gestures_Tooltip">Gestures for your avatar</string>
<string name="Command_Grid_Status_Tooltip">Show current Grid status</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml
index 46c1b7ff75..bfe6941a8a 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -13,16 +13,6 @@
text_pad_right="4"
arrow_size="10"
max_folder_item_overlap="2">
- <facebook_icon
- follows="left"
- height="14"
- image_name="Facebook_Icon"
- left="5"
- bottom="6"
- name="facebook_icon"
- tool_tip="Facebook User"
- visible="false"
- width="14" />
<avatar_icon
follows="left"
layout="topleft"