From 409a401ebb59fcf28ba25aaeab44ca8d00960c84 Mon Sep 17 00:00:00 2001
From: Kadah_Coba <kadah.coba@gmail.com>
Date: Mon, 5 Dec 2011 14:56:33 -0800
Subject: VWR-17587: Added "Fly/Land on holding up/down" option under Move
 preferences

---
 indra/newview/skins/default/xui/en/panel_preferences_move.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index d9067b41c7..198fcf9355 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -129,6 +129,16 @@
    name="tap_tap_hold_to_run"
    width="237"
    top_pad="0"/>
+  <check_box
+   control_name="AutomaticFly"
+   follows="left|top"
+   height="20"
+   label="Fly/land on holding up/down"
+   layout="topleft"
+   left_delta="0"
+   name="automatic_fly"
+   width="237"
+   top_pad="0"/>
   <text
    follows="left|top"
    type="string"
-- 
cgit v1.2.3


From 47044de069c2c1442a33d719846cdbf1e3450124 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 4 Jun 2012 11:23:38 -0400
Subject: STORM-1838 Add "Request Teleport" option to the menu when
 right-clicking on avatars in the Nearby list

---
 doc/contributions.txt                              |  1 +
 indra/llmessage/message_prehash.cpp                |  1 +
 indra/llmessage/message_prehash.h                  |  1 +
 indra/newview/llavataractions.cpp                  | 13 ++++++
 indra/newview/llavataractions.h                    |  5 +++
 indra/newview/llpanelpeoplemenus.cpp               |  1 +
 indra/newview/llviewermessage.cpp                  | 48 ++++++++++++++++++++++
 .../skins/default/xui/en/menu_people_nearby.xml    |  7 ++++
 .../newview/skins/default/xui/en/notifications.xml | 23 +++++++++++
 9 files changed, 100 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 04edfb4bea..cc5fb53b57 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -629,6 +629,7 @@ Jonathan Yap
 	STORM-1809
 	STORM-1793
 	STORM-1810
+	STORM-1838
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index e71fb96540..64fb6a78a2 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1379,3 +1379,4 @@ char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->get
 char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs");
 char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds");
 char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds");
+char const* const _PREHASH_RequestTeleport = LLMessageStringTable::getInstance()->getString("RequestTeleport");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index dd2c2dbd64..4da1fa7a95 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1379,4 +1379,5 @@ extern char const* const _PREHASH_ProductSKU;
 extern char const* const _PREHASH_SeeAVs;
 extern char const* const _PREHASH_AnyAVSounds;
 extern char const* const _PREHASH_GroupAVSounds;
+extern char const* const _PREHASH_RequestTeleport;
 #endif
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index f618af9536..8df30da68a 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -71,6 +71,7 @@
 #include "llcallingcard.h"
 #include "llslurl.h"			// IDEVO
 #include "llsidepanelinventory.h"
+#include "llavatarname.h"
 
 // static
 void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@@ -395,6 +396,18 @@ void LLAvatarActions::pay(const LLUUID& id)
 	}
 }
 
+// static
+void LLAvatarActions::requestTeleport(const LLUUID& id)
+{
+	LLMessageSystem* msg = gMessageSystem;
+
+	msg->newMessageFast(_PREHASH_RequestTeleport);
+	msg->nextBlockFast(_PREHASH_AgentData);
+	msg->addUUIDFast(_PREHASH_AgentID, id);
+	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+	gAgent.sendReliableMessage();
+}
+
 // static
 void LLAvatarActions::kick(const LLUUID& id)
 {
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 748b7cb3d1..1eee9ea81f 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -108,6 +108,11 @@ public:
 	 */
 	static void pay(const LLUUID& id);
 
+	/**
+	 * Request teleport from other avatar
+	 */
+	static void requestTeleport(const LLUUID& id);
+
 	/**
 	 * Share items with the avatar.
 	 */
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index f12c4de2f7..c703ae8768 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -67,6 +67,7 @@ LLContextMenu* NearbyMenu::createMenu()
 		registrar.add("Avatar.Share",			boost::bind(&LLAvatarActions::share,					id));
 		registrar.add("Avatar.Pay",				boost::bind(&LLAvatarActions::pay,						id));
 		registrar.add("Avatar.BlockUnblock",	boost::bind(&LLAvatarActions::toggleBlock,				id));
+		registrar.add("Avatar.RequestTeleport",	boost::bind(&LLAvatarActions::requestTeleport,			id));
 
 		enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem,	this, _2));
 		enable_registrar.add("Avatar.CheckItem",  boost::bind(&NearbyMenu::checkContextMenuItem,	this, _2));
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 854e2bea52..f4f7148340 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1992,6 +1992,54 @@ bool lure_callback(const LLSD& notification, const LLSD& response)
 }
 static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lure_callback);
 
+bool teleport_requested_callback(const LLSD& notification, const LLSD& response)
+{
+	LLUUID from_id = notification["payload"]["from_id"].asUUID();
+	std::string from_name;
+	gCacheName->getFullName(from_id, from_name);
+
+	if(from_id.isNull() || (LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name)))
+	{
+		return false;
+	}
+
+	S32 option = 0;
+	if (response.isInteger()) 
+	{
+		option = response.asInteger();
+	}
+	else
+	{
+		option = LLNotificationsUtil::getSelectedOption(notification, response);
+	}
+
+	switch(option)
+	{
+	// Yes
+	case 0:
+		{
+			LLAvatarActions::offerTeleport(from_id);
+		}
+		break;
+
+	// No
+	case 1:
+	default:
+		break;
+
+	// Block
+	case 2:
+		{
+			LLMute mute(from_id, from_name, LLMute::AGENT);
+			LLPanelBlockedList::showPanelAndSelect(mute.mID);
+		}
+		break;
+	}
+	return false;
+}
+
+static LLNotificationFunctorRegistration teleport_requested_callback_reg("TeleportRequested", teleport_requested_callback);
+
 bool goto_url_callback(const LLSD& notification, const LLSD& response)
 {
 	std::string url = notification["payload"]["url"].asString();
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index d2e35e4cc0..cff383cab1 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -70,6 +70,13 @@
         <menu_item_call.on_click
          function="Avatar.Pay" />
     </menu_item_call>
+    <menu_item_call
+     label="Request Teleport"
+     layout="topleft"
+     name="Request Teleport">
+        <menu_item_call.on_click
+         function="Avatar.RequestTeleport" />
+    </menu_item_call>
     <menu_item_check
      label="Block/Unblock"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index afc5b916e7..54ba03ad59 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6149,6 +6149,29 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
 	Teleport offer sent to [TO_NAME]
   </notification>
 
+  <notification
+   icon="notify.tga"
+   name="TeleportRequest"
+   type="notify">
+[NAME] is requesting to be teleported your to your location.
+
+Will you permit this?
+    <tag>confirm</tag>
+    <form name="form">
+      <button
+       index="0"
+       name="Yes"
+       text="Yes"/>
+      <button
+       index="1"
+       name="No"
+       text="No"/>
+      <button
+       index="2"
+       name="Mute"
+       text="Block"/>
+    </form>
+  </notification>
 
   <notification
    icon="notify.tga"
-- 
cgit v1.2.3


From 6e44b8342a37e0fe8c9795c69b1d36a60b30fdcb Mon Sep 17 00:00:00 2001
From: Whirly <none@none>
Date: Tue, 21 Aug 2012 12:30:00 +0100
Subject: VWR-29543 In merchant outbox "create a Marketplace store" link opens
 wrong article in KB.

---
 doc/contributions.txt                          | 2 ++
 indra/newview/skins/default/xui/de/strings.xml | 2 +-
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 indra/newview/skins/default/xui/es/strings.xml | 2 +-
 indra/newview/skins/default/xui/fr/strings.xml | 2 +-
 indra/newview/skins/default/xui/it/strings.xml | 2 +-
 indra/newview/skins/default/xui/ja/strings.xml | 2 +-
 indra/newview/skins/default/xui/pt/strings.xml | 2 +-
 indra/newview/skins/default/xui/ru/strings.xml | 2 +-
 indra/newview/skins/default/xui/tr/strings.xml | 2 +-
 indra/newview/skins/steam/xui/de/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/en/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/es/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/fr/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/it/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/ja/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/pt/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/ru/strings.xml   | 2 +-
 indra/newview/skins/steam/xui/tr/strings.xml   | 2 +-
 19 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index df504e4a8a..3d9a9d08ab 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1228,6 +1228,8 @@ Watty Berkson
 Westley Schridde
 Westley Streeter
 Whimsy Winx
+Whirly Fizzle
+	VWR-29543
 Whoops Babii
 	VWR-631
 	VWR-1640
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 668a7b35bf..a171965dc9 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -1250,7 +1250,7 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index d5186e4c1b..e3f6e93df6 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2176,7 +2176,7 @@ For AI Character: Get the closest navigable point to the point provided.
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
 	<string name="InventoryInboxNoItems">Your Marketplace purchases will appear here. You may then drag them into your inventory to use them.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
-	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
+	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
 	<string name="MarketplaceURL_Imports">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports</string>
 	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index adc32ba168..35ad5eaebd 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -1232,7 +1232,7 @@ Intenta iniciar sesión de nuevo en unos instantes.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 0987952c28..7ed0fdffe7 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -1250,7 +1250,7 @@ Veuillez réessayer de vous connecter dans une minute.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 11accb5f08..80d047f1c9 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -1241,7 +1241,7 @@ Prova ad accedere nuovamente tra un minuto.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index f6b3edc57f..1d29e3defc 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -1250,7 +1250,7 @@ support@secondlife.com にお問い合わせください。
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index fd8f22f331..82d1e6ae75 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -1196,7 +1196,7 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 78e4b134fb..9ba1ea4745 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -1247,7 +1247,7 @@ support@secondlife.com.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index 1be0970e4e..04c0223fae 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -1247,7 +1247,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/de/strings.xml b/indra/newview/skins/steam/xui/de/strings.xml
index b15cecb146..fa540faf7f 100644
--- a/indra/newview/skins/steam/xui/de/strings.xml
+++ b/indra/newview/skins/steam/xui/de/strings.xml
@@ -1244,7 +1244,7 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/en/strings.xml b/indra/newview/skins/steam/xui/en/strings.xml
index c29b80e21c..aad4fe9a75 100644
--- a/indra/newview/skins/steam/xui/en/strings.xml
+++ b/indra/newview/skins/steam/xui/en/strings.xml
@@ -2044,7 +2044,7 @@ Returns a string with the requested data about the region
 	<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
 	<string name="InventoryInboxNoItems">Your Marketplace purchases will appear here. You may then drag them into your inventory to use them.</string>
 	<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
-	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4</string>
+	<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3</string>
 	<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
 	<string name="MarketplaceURL_Imports">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/imports</string>
 	<string name="MarketplaceURL_LearnMore">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/learn_more</string>
diff --git a/indra/newview/skins/steam/xui/es/strings.xml b/indra/newview/skins/steam/xui/es/strings.xml
index 2b36c39e7e..b31e63064d 100644
--- a/indra/newview/skins/steam/xui/es/strings.xml
+++ b/indra/newview/skins/steam/xui/es/strings.xml
@@ -1226,7 +1226,7 @@ Intenta iniciar sesión de nuevo en unos instantes.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/fr/strings.xml b/indra/newview/skins/steam/xui/fr/strings.xml
index ac34dd67c8..77d91c8ff4 100644
--- a/indra/newview/skins/steam/xui/fr/strings.xml
+++ b/indra/newview/skins/steam/xui/fr/strings.xml
@@ -1244,7 +1244,7 @@ Veuillez réessayer de vous connecter dans une minute.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/it/strings.xml b/indra/newview/skins/steam/xui/it/strings.xml
index 0fcc4e0820..07f995dee3 100644
--- a/indra/newview/skins/steam/xui/it/strings.xml
+++ b/indra/newview/skins/steam/xui/it/strings.xml
@@ -1235,7 +1235,7 @@ Prova ad accedere nuovamente tra un minuto.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/ja/strings.xml b/indra/newview/skins/steam/xui/ja/strings.xml
index 29ef13109c..00cd2b9827 100644
--- a/indra/newview/skins/steam/xui/ja/strings.xml
+++ b/indra/newview/skins/steam/xui/ja/strings.xml
@@ -1244,7 +1244,7 @@ support@secondlife.com にお問い合わせください。
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/pt/strings.xml b/indra/newview/skins/steam/xui/pt/strings.xml
index 07fd95c907..f6b6e15a02 100644
--- a/indra/newview/skins/steam/xui/pt/strings.xml
+++ b/indra/newview/skins/steam/xui/pt/strings.xml
@@ -1190,7 +1190,7 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/ru/strings.xml b/indra/newview/skins/steam/xui/ru/strings.xml
index 2b4c6e6f48..a532a5e374 100644
--- a/indra/newview/skins/steam/xui/ru/strings.xml
+++ b/indra/newview/skins/steam/xui/ru/strings.xml
@@ -1241,7 +1241,7 @@ support@secondlife.com.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
diff --git a/indra/newview/skins/steam/xui/tr/strings.xml b/indra/newview/skins/steam/xui/tr/strings.xml
index 74bb33a5c5..d4416f9b96 100644
--- a/indra/newview/skins/steam/xui/tr/strings.xml
+++ b/indra/newview/skins/steam/xui/tr/strings.xml
@@ -1241,7 +1241,7 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/
 	</string>
 	<string name="MarketplaceURL_CreateStore">
-		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4
+		http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3
 	</string>
 	<string name="MarketplaceURL_Dashboard">
 		https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard
-- 
cgit v1.2.3


From e386aa73b7af5ca326f66fa3fb0482e42b3af33f Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 11 Jan 2013 11:13:44 -0500
Subject: STORM-1838

---
 indra/llmessage/llinstantmessage.h                 |  2 +-
 indra/llmessage/message_prehash.cpp                |  1 -
 indra/llmessage/message_prehash.h                  |  1 -
 indra/newview/llavataractions.cpp                  | 36 ++++++++++++++--
 indra/newview/llavataractions.h                    |  2 +-
 indra/newview/llpanelpeoplemenus.cpp               |  2 +-
 indra/newview/llviewermessage.cpp                  | 48 ++++++++++++++++++----
 .../skins/default/xui/en/menu_inventory.xml        |  6 +++
 .../skins/default/xui/en/menu_people_nearby.xml    |  2 +-
 .../newview/skins/default/xui/en/notifications.xml |  6 +--
 10 files changed, 87 insertions(+), 19 deletions(-)

diff --git a/indra/llmessage/llinstantmessage.h b/indra/llmessage/llinstantmessage.h
index e0dae376b4..febc59c4bc 100644
--- a/indra/llmessage/llinstantmessage.h
+++ b/indra/llmessage/llinstantmessage.h
@@ -126,7 +126,7 @@ enum EInstantMessage
 	IM_LURE_ACCEPTED = 23,
 	IM_LURE_DECLINED = 24,
 	IM_GODLIKE_LURE_USER = 25,
-	IM_YET_TO_BE_USED = 26,
+	IM_TELEPORT_REQUEST = 26,
 
 	// IM that notifie of a new group election.
 	// Name is name of person who called vote.
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index 64fb6a78a2..e71fb96540 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1379,4 +1379,3 @@ char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->get
 char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs");
 char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds");
 char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds");
-char const* const _PREHASH_RequestTeleport = LLMessageStringTable::getInstance()->getString("RequestTeleport");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index 4da1fa7a95..dd2c2dbd64 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1379,5 +1379,4 @@ extern char const* const _PREHASH_ProductSKU;
 extern char const* const _PREHASH_SeeAVs;
 extern char const* const _PREHASH_AnyAVSounds;
 extern char const* const _PREHASH_GroupAVSounds;
-extern char const* const _PREHASH_RequestTeleport;
 #endif
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 8df30da68a..0d00232c2f 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -72,6 +72,7 @@
 #include "llslurl.h"			// IDEVO
 #include "llsidepanelinventory.h"
 #include "llavatarname.h"
+#include "llagentui.h"
 
 // static
 void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@@ -397,15 +398,44 @@ void LLAvatarActions::pay(const LLUUID& id)
 }
 
 // static
-void LLAvatarActions::requestTeleport(const LLUUID& id)
+void LLAvatarActions::teleportRequest(const LLUUID& id)
 {
 	LLMessageSystem* msg = gMessageSystem;
 
-	msg->newMessageFast(_PREHASH_RequestTeleport);
+	msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
 	msg->nextBlockFast(_PREHASH_AgentData);
-	msg->addUUIDFast(_PREHASH_AgentID, id);
+	msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
 	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+
+	msg->nextBlockFast(_PREHASH_MessageBlock);
+	msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
+	msg->addUUIDFast(_PREHASH_ToAgentID, id);
+	msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
+	msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
+	msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
+	msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
+
+	std::string name;
+	LLAgentUI::buildFullname(name);
+
+	msg->addStringFast(_PREHASH_FromAgentName, name);
+	msg->addStringFast(_PREHASH_Message, LLStringUtil::null);
+	msg->addU32Fast(_PREHASH_ParentEstateID, 0);
+	msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
+	msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
+
+	gMessageSystem->addBinaryDataFast(
+			_PREHASH_BinaryBucket,
+			EMPTY_BINARY_BUCKET,
+			EMPTY_BINARY_BUCKET_SIZE);
+
+/*	msg->newMessageFast(_PREHASH_TeleportRequest);
+	msg->nextBlockFast(_PREHASH_AgentData);
+	msg->addUUIDFast(_PREHASH_AgentID, id);
+	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); */
+
 	gAgent.sendReliableMessage();
+llwarns << "DBG REQUEST_TELEPORT sent" << llendl;
 }
 
 // static
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 1eee9ea81f..f3df953e98 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -111,7 +111,7 @@ public:
 	/**
 	 * Request teleport from other avatar
 	 */
-	static void requestTeleport(const LLUUID& id);
+	static void teleportRequest(const LLUUID& id);
 
 	/**
 	 * Share items with the avatar.
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index c703ae8768..499dfd36fc 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -67,7 +67,7 @@ LLContextMenu* NearbyMenu::createMenu()
 		registrar.add("Avatar.Share",			boost::bind(&LLAvatarActions::share,					id));
 		registrar.add("Avatar.Pay",				boost::bind(&LLAvatarActions::pay,						id));
 		registrar.add("Avatar.BlockUnblock",	boost::bind(&LLAvatarActions::toggleBlock,				id));
-		registrar.add("Avatar.RequestTeleport",	boost::bind(&LLAvatarActions::requestTeleport,			id));
+		registrar.add("Avatar.TeleportRequest",	boost::bind(&LLAvatarActions::teleportRequest,			id));
 
 		enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem,	this, _2));
 		enable_registrar.add("Avatar.CheckItem",  boost::bind(&NearbyMenu::checkContextMenuItem,	this, _2));
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index f4f7148340..25b3563807 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1992,13 +1992,20 @@ bool lure_callback(const LLSD& notification, const LLSD& response)
 }
 static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lure_callback);
 
-bool teleport_requested_callback(const LLSD& notification, const LLSD& response)
+bool teleport_request_callback(const LLSD& notification, const LLSD& response)
 {
 	LLUUID from_id = notification["payload"]["from_id"].asUUID();
+	if(from_id.isNull())
+	{
+		llwarns << "from_id is NULL" << llendl;
+		return false;
+	}
+
 	std::string from_name;
 	gCacheName->getFullName(from_id, from_name);
+llwarns << "DBG " << from_name << " " << from_id << llendl;
 
-	if(from_id.isNull() || (LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name)))
+	if(LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name))
 	{
 		return false;
 	}
@@ -2027,18 +2034,27 @@ bool teleport_requested_callback(const LLSD& notification, const LLSD& response)
 	default:
 		break;
 
-	// Block
+	// IM
 	case 2:
 		{
+llwarns << "DBG start IM" << llendl;
+			LLAvatarActions::startIM(from_id);
+		}
+		break;
+
+/*	// Block
+	case 3:
+		{
 			LLMute mute(from_id, from_name, LLMute::AGENT);
+			LLMuteList::getInstance()->add(mute);
 			LLPanelBlockedList::showPanelAndSelect(mute.mID);
 		}
-		break;
+		break; */
 	}
 	return false;
 }
 
-static LLNotificationFunctorRegistration teleport_requested_callback_reg("TeleportRequested", teleport_requested_callback);
+static LLNotificationFunctorRegistration teleport_request_callback_reg("TeleportRequest", teleport_request_callback);
 
 bool goto_url_callback(const LLSD& notification, const LLSD& response)
 {
@@ -2163,7 +2179,7 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t
 	case IM_LURE_ACCEPTED:
 	case IM_LURE_DECLINED:
 	case IM_GODLIKE_LURE_USER:
-	case IM_YET_TO_BE_USED:
+	case IM_TELEPORT_REQUEST:
 	case IM_GROUP_ELECTION_DEPRECATED:
 	//IM_GOTO_URL
 	//IM_FROM_TASK_AS_ALERT
@@ -2914,7 +2930,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 		break;
 		
 	case IM_LURE_USER:
+	case IM_TELEPORT_REQUEST:
 		{
+llwarns << "DBG teleport processing" << llendl;
 			if (is_muted)
 			{ 
 				return;
@@ -2949,7 +2967,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 				payload["lure_id"] = session_id;
 				payload["godlike"] = FALSE;
 
-			    LLNotification::Params params("TeleportOffered");
+				LLNotification::Params params;
+				if (IM_LURE_USER == dialog)
+				{
+llwarns << "DBG LURE_USER received (treating as TELPORT_REQUEST" << llendl;
+//					params.name = "TeleportOffered";
+//					params.functor.name = "TeleportOffered";
+					params.name = "TeleportRequest";
+					params.functor.name = "TeleportRequest";
+				}
+
+				if (IM_TELEPORT_REQUEST == dialog)
+				{
+llwarns << "DBG TELEPORT_REQUEST received" << llendl;
+					params.name = "TeleportRequest";
+					params.functor.name = "TeleportRequest";
+				}
+
 			    params.substitutions = args;
 			    params.payload = payload;
 			    LLPostponedNotification::add<LLPostponedOfferNotification>(	params, from_id, false);
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index b13bf5b508..051bb800e7 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -590,6 +590,12 @@
          function="Inventory.BeginIMSession"
          parameter="selected" />
     </menu_item_call>
+    <menu_item_call
+     label="Request Teleport"
+     name="Request Teleport">
+        <menu_item_call.on_click
+        function="Avatar.TeleportRequest" />
+    </menu_item_call>
     <menu_item_separator
      layout="topleft" 
      name="Gesture Separator" />
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index cff383cab1..951f43f325 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -75,7 +75,7 @@
      layout="topleft"
      name="Request Teleport">
         <menu_item_call.on_click
-         function="Avatar.RequestTeleport" />
+         function="Avatar.TeleportRequest" />
     </menu_item_call>
     <menu_item_check
      label="Block/Unblock"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 54ba03ad59..f85b62c944 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6153,7 +6153,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    icon="notify.tga"
    name="TeleportRequest"
    type="notify">
-[NAME] is requesting to be teleported your to your location.
+[NAME_SLURL] is requesting to be teleported your to your location.
 
 Will you permit this?
     <tag>confirm</tag>
@@ -6168,8 +6168,8 @@ Will you permit this?
        text="No"/>
       <button
        index="2"
-       name="Mute"
-       text="Block"/>
+       name="IM"
+       text="IM"/>
     </form>
   </notification>
 
-- 
cgit v1.2.3


From 184f07fbc8acbc9bb509588ff532fe587fa24a22 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 18 Jan 2013 05:14:01 -0500
Subject: STORM-1838 Remove some debugging code

---
 indra/newview/llviewermessage.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 25b3563807..1d6139a732 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2970,11 +2970,8 @@ llwarns << "DBG teleport processing" << llendl;
 				LLNotification::Params params;
 				if (IM_LURE_USER == dialog)
 				{
-llwarns << "DBG LURE_USER received (treating as TELPORT_REQUEST" << llendl;
-//					params.name = "TeleportOffered";
-//					params.functor.name = "TeleportOffered";
-					params.name = "TeleportRequest";
-					params.functor.name = "TeleportRequest";
+					params.name = "TeleportOffered";
+					params.functor.name = "TeleportOffered";
 				}
 
 				if (IM_TELEPORT_REQUEST == dialog)
-- 
cgit v1.2.3


From 70722454f6650438c9b659ff08b4d7bc6dfc2e7e Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 18 Jan 2013 05:40:17 -0500
Subject: STORM-1838 Removed block of commented out code

---
 indra/newview/llavataractions.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 0d00232c2f..b2fb691a85 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -429,11 +429,6 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
 			EMPTY_BINARY_BUCKET,
 			EMPTY_BINARY_BUCKET_SIZE);
 
-/*	msg->newMessageFast(_PREHASH_TeleportRequest);
-	msg->nextBlockFast(_PREHASH_AgentData);
-	msg->addUUIDFast(_PREHASH_AgentID, id);
-	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); */
-
 	gAgent.sendReliableMessage();
 llwarns << "DBG REQUEST_TELEPORT sent" << llendl;
 }
-- 
cgit v1.2.3


From 146f3e639c3576a0113857b7c5f2c51644683851 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 23 Jan 2013 11:59:46 -0500
Subject: STORM-1838 Do not display unwanted notification.

---
 indra/newview/llviewermessage.cpp | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a2a9b13eb5..69d53e74ab 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2068,7 +2068,40 @@ llwarns << "DBG " << from_name << " " << from_id << llendl;
 	// Yes
 	case 0:
 		{
-			LLAvatarActions::offerTeleport(from_id);
+			std::string text = "Join me in ";
+			LLSLURL slurl;
+			LLAgentUI::buildSLURL(slurl);
+			text.append("\r\n").append(slurl.getSLURLString());
+
+			LLMessageSystem* msg = gMessageSystem;
+			msg->newMessageFast(_PREHASH_StartLure);
+			msg->nextBlockFast(_PREHASH_AgentData);
+			msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+			msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+			msg->nextBlockFast(_PREHASH_Info);
+			msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in.
+			msg->addStringFast(_PREHASH_Message, text);
+
+			msg->nextBlockFast(_PREHASH_TargetData);
+			msg->addUUIDFast(_PREHASH_TargetID, from_id);
+
+			// Record the offer.
+			std::string target_name;
+			gCacheName->getFullName(from_id, target_name);  // for im log filenames
+			LLSD args;
+			args["TO_NAME"] = LLSLURL("agent", from_id, "displayname").getSLURLString();;
+	
+			LLSD payload;
+
+			//*TODO please rewrite all keys to the same case, lower or upper
+			payload["from_id"] = from_id;
+			payload["SUPPRESS_TOAST"] = true;
+			LLNotificationsUtil::add("TeleportOfferSent", args, payload);
+
+			// Add the recepient to the recent people list.
+			LLRecentPeople::instance().add(from_id);
+
+			gAgent.sendReliableMessage();
 		}
 		break;
 
-- 
cgit v1.2.3


From d66c0ee8e9dc21b1887be496b484f1529ee23764 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 23 Jan 2013 13:17:51 -0500
Subject: STORM-1838 First pass at calling handle_lure_callback from within
 teleport_request_callback

---
 indra/newview/llviewermessage.cpp | 176 +++++++++++++++++---------------------
 1 file changed, 77 insertions(+), 99 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 69d53e74ab..8a955377da 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2035,103 +2035,6 @@ bool mature_lure_callback(const LLSD& notification, const LLSD& response)
 }
 static LLNotificationFunctorRegistration mature_lure_callback_reg("TeleportOffered_MaturityExceeded", mature_lure_callback);
 
-bool teleport_request_callback(const LLSD& notification, const LLSD& response)
-{
-	LLUUID from_id = notification["payload"]["from_id"].asUUID();
-	if(from_id.isNull())
-	{
-		llwarns << "from_id is NULL" << llendl;
-		return false;
-	}
-
-	std::string from_name;
-	gCacheName->getFullName(from_id, from_name);
-llwarns << "DBG " << from_name << " " << from_id << llendl;
-
-	if(LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name))
-	{
-		return false;
-	}
-
-	S32 option = 0;
-	if (response.isInteger()) 
-	{
-		option = response.asInteger();
-	}
-	else
-	{
-		option = LLNotificationsUtil::getSelectedOption(notification, response);
-	}
-
-	switch(option)
-	{
-	// Yes
-	case 0:
-		{
-			std::string text = "Join me in ";
-			LLSLURL slurl;
-			LLAgentUI::buildSLURL(slurl);
-			text.append("\r\n").append(slurl.getSLURLString());
-
-			LLMessageSystem* msg = gMessageSystem;
-			msg->newMessageFast(_PREHASH_StartLure);
-			msg->nextBlockFast(_PREHASH_AgentData);
-			msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
-			msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-			msg->nextBlockFast(_PREHASH_Info);
-			msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in.
-			msg->addStringFast(_PREHASH_Message, text);
-
-			msg->nextBlockFast(_PREHASH_TargetData);
-			msg->addUUIDFast(_PREHASH_TargetID, from_id);
-
-			// Record the offer.
-			std::string target_name;
-			gCacheName->getFullName(from_id, target_name);  // for im log filenames
-			LLSD args;
-			args["TO_NAME"] = LLSLURL("agent", from_id, "displayname").getSLURLString();;
-	
-			LLSD payload;
-
-			//*TODO please rewrite all keys to the same case, lower or upper
-			payload["from_id"] = from_id;
-			payload["SUPPRESS_TOAST"] = true;
-			LLNotificationsUtil::add("TeleportOfferSent", args, payload);
-
-			// Add the recepient to the recent people list.
-			LLRecentPeople::instance().add(from_id);
-
-			gAgent.sendReliableMessage();
-		}
-		break;
-
-	// No
-	case 1:
-	default:
-		break;
-
-	// IM
-	case 2:
-		{
-llwarns << "DBG start IM" << llendl;
-			LLAvatarActions::startIM(from_id);
-		}
-		break;
-
-/*	// Block
-	case 3:
-		{
-			LLMute mute(from_id, from_name, LLMute::AGENT);
-			LLMuteList::getInstance()->add(mute);
-			LLPanelBlockedList::showPanelAndSelect(mute.mID);
-		}
-		break; */
-	}
-	return false;
-}
-
-static LLNotificationFunctorRegistration teleport_request_callback_reg("TeleportRequest", teleport_request_callback);
-
 bool goto_url_callback(const LLSD& notification, const LLSD& response)
 {
 	std::string url = notification["payload"]["url"].asString();
@@ -3012,7 +2915,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 	case IM_LURE_USER:
 	case IM_TELEPORT_REQUEST:
 		{
-llwarns << "DBG teleport processing" << llendl;
 			if (is_muted)
 			{ 
 				return;
@@ -3114,7 +3016,7 @@ llwarns << "DBG teleport processing" << llendl;
 					}
 					else if (IM_TELEPORT_REQUEST == dialog)
 					{
-						llwarns << "DBG TELEPORT_REQUEST received" << llendl;
+llwarns << "DBG TELEPORT_REQUEST received" << llendl;
 						params.name = "TeleportRequest";
 						params.functor.name = "TeleportRequest";
 					}
@@ -6860,6 +6762,10 @@ void send_group_notice(const LLUUID& group_id,
 
 bool handle_lure_callback(const LLSD& notification, const LLSD& response)
 {
+// Caution: this function is also called directly by teleport_request_callback using dummied-up parameters.
+// If you make a change here that uses additional fields in notification or response
+// make sure to add appropriate dummy values in teleport_request_callback.
+ 
 	static const unsigned OFFER_RECIPIENT_LIMIT = 250;
 	if(notification["payload"]["ids"].size() > OFFER_RECIPIENT_LIMIT) 
 	{
@@ -6955,6 +6861,78 @@ void handle_lure(const uuid_vec_t& ids)
 	}
 }
 
+bool teleport_request_callback(const LLSD& notification, const LLSD& response)
+{
+	LLUUID from_id = notification["payload"]["from_id"].asUUID();
+	if(from_id.isNull())
+	{
+		llwarns << "from_id is NULL" << llendl;
+		return false;
+	}
+
+	std::string from_name;
+	gCacheName->getFullName(from_id, from_name);
+
+	if(LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name))
+	{
+		return false;
+	}
+
+	S32 option = 0;
+	if (response.isInteger()) 
+	{
+		option = response.asInteger();
+	}
+	else
+	{
+		option = LLNotificationsUtil::getSelectedOption(notification, response);
+	}
+
+	switch(option)
+	{
+	// Yes
+	case 0:
+		{
+			LLSD notification;
+			notification["payload"]["ids"] = from_id;
+			notification["form"][0]["type"] = "button";
+			notification["form"][0]["index"] = 0;
+
+			LLSD response;
+			response["message"] = "Join me in ";
+			response["name"][0] = 1;
+
+			// Calling handle_lure_callback directly is a bit of a hack to avoid having to copy most of
+			// the code from this routine.
+			handle_lure_callback(notification, response);
+		}
+		break;
+
+	// No
+	case 1:
+	default:
+		break;
+
+	// IM
+	case 2:
+		{
+			LLAvatarActions::startIM(from_id);
+		}
+		break;
+
+/*	// Block
+	case 3:
+		{
+			LLMute mute(from_id, from_name, LLMute::AGENT);
+			LLMuteList::getInstance()->add(mute);
+			LLPanelBlockedList::showPanelAndSelect(mute.mID);
+		}
+		break; */
+	}
+	return false;
+}
+
+static LLNotificationFunctorRegistration teleport_request_callback_reg("TeleportRequest", teleport_request_callback);
 
 void send_improved_im(const LLUUID& to_id,
 							const std::string& name,
-- 
cgit v1.2.3


From f64e11dfe1490c1a89e00cf5dc368dd1dc25b866 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 24 Jan 2013 14:27:10 -0500
Subject: STORM-1838 Add optional message processing

---
 indra/newview/llavataractions.cpp                  | 17 +++++++++++++----
 indra/newview/llavataractions.h                    |  1 +
 indra/newview/llviewermessage.cpp                  | 21 ++++++++++++---------
 .../newview/skins/default/xui/en/notifications.xml | 22 ++++++++++++++++++++++
 4 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 51313f29c4..d8449570a7 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -397,8 +397,7 @@ void LLAvatarActions::pay(const LLUUID& id)
 	}
 }
 
-// static
-void LLAvatarActions::teleportRequest(const LLUUID& id)
+void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response)
 {
 	LLMessageSystem* msg = gMessageSystem;
 
@@ -409,7 +408,7 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
 
 	msg->nextBlockFast(_PREHASH_MessageBlock);
 	msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
-	msg->addUUIDFast(_PREHASH_ToAgentID, id);
+	msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] );
 	msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
 	msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
 	msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
@@ -419,7 +418,7 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
 	LLAgentUI::buildFullname(name);
 
 	msg->addStringFast(_PREHASH_FromAgentName, name);
-	msg->addStringFast(_PREHASH_Message, LLStringUtil::null);
+	msg->addStringFast(_PREHASH_Message, response["message"]);
 	msg->addU32Fast(_PREHASH_ParentEstateID, 0);
 	msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
 	msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
@@ -433,6 +432,16 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
 llwarns << "DBG REQUEST_TELEPORT sent" << llendl;
 }
 
+// static
+void LLAvatarActions::teleportRequest(const LLUUID& id)
+{
+	LLSD notification;
+	notification["uuid"] = id;
+	LLSD payload;
+
+	LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback);
+}
+
 // static
 void LLAvatarActions::kick(const LLUUID& id)
 {
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index f3df953e98..afd8060ee3 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -112,6 +112,7 @@ public:
 	 * Request teleport from other avatar
 	 */
 	static void teleportRequest(const LLUUID& id);
+	static void teleport_request_callback(const LLSD& notification, const LLSD& response);
 
 	/**
 	 * Share items with the avatar.
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 8a955377da..7247dfcd65 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6765,7 +6765,8 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response)
 // Caution: this function is also called directly by teleport_request_callback using dummied-up parameters.
 // If you make a change here that uses additional fields in notification or response
 // make sure to add appropriate dummy values in teleport_request_callback.
- 
+llwarns << "DBB notification=" << notification << llendl;
+llwarns << "DBG response=" << response << llendl; 
 	static const unsigned OFFER_RECIPIENT_LIMIT = 250;
 	if(notification["payload"]["ids"].size() > OFFER_RECIPIENT_LIMIT) 
 	{
@@ -6893,18 +6894,20 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response)
 	// Yes
 	case 0:
 		{
-			LLSD notification;
-			notification["payload"]["ids"] = from_id;
-			notification["form"][0]["type"] = "button";
-			notification["form"][0]["index"] = 0;
+			LLSD dummy_notification;
+			dummy_notification["payload"]["ids"][0] = from_id;
+			dummy_notification["form"]["name"][0] = "OK";
+			dummy_notification["form"]["text"][0] = "OK";
+			dummy_notification["form"]["type"][0] = "button";
 
-			LLSD response;
-			response["message"] = "Join me in ";
-			response["name"][0] = 1;
+
+			LLSD dummy_response;
+			dummy_response["message"] = response["message"];
+			dummy_response["OK"] = 1;
 
 			// Calling handle_lure_callback directly is a bit of a hack to avoid having to copy most of
 			// the code from this routine.
-			handle_lure_callback(notification, response);
+			handle_lure_callback(dummy_notification, dummy_response);
 		}
 		break;
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 0628e54902..3baf223172 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3927,6 +3927,27 @@ Join me in [REGION]
     </form>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="TeleportRequestPrompt"
+   type="alertmodal">
+Request a teleport to their location with the following message
+    <tag>confirm</tag>
+    <form name="form">
+      <input name="message" type="text">
+
+      </input>
+      <button
+       default="true"
+       index="0"
+       name="OK"
+       text="OK"/>
+      <button
+       index="1"
+       name="Cancel"
+       text="Cancel"/>
+    </form>
+  </notification>
   <notification
    icon="alertmodal.tga"
    name="TooManyTeleportOffers"
@@ -6520,6 +6541,7 @@ However, this region contains content accessible to adults only.
    name="TeleportRequest"
    type="notify">
 [NAME_SLURL] is requesting to be teleported your to your location.
+[MESSAGE]
 
 Will you permit this?
     <tag>confirm</tag>
-- 
cgit v1.2.3


From 12182d7cc3fbc3462e7dbacd09c975dc76b8f75f Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 24 Jan 2013 15:29:36 -0500
Subject: STORM-1838 Break out a large block of code from handle_lure_callback
 so it can be called directly by teleport_request_callback.

---
 indra/newview/llavataractions.cpp |   1 -
 indra/newview/llviewermessage.cpp | 103 ++++++++++++++++++--------------------
 2 files changed, 48 insertions(+), 56 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index d8449570a7..b65810d357 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -429,7 +429,6 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
 			EMPTY_BINARY_BUCKET_SIZE);
 
 	gAgent.sendReliableMessage();
-llwarns << "DBG REQUEST_TELEPORT sent" << llendl;
 }
 
 // static
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 7247dfcd65..2dc5fcff85 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3016,7 +3016,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 					}
 					else if (IM_TELEPORT_REQUEST == dialog)
 					{
-llwarns << "DBG TELEPORT_REQUEST received" << llendl;
 						params.name = "TeleportRequest";
 						params.functor.name = "TeleportRequest";
 					}
@@ -6760,13 +6759,53 @@ void send_group_notice(const LLUUID& group_id,
 			bin_bucket_size);
 }
 
+void send_lures(const LLSD& notification, const LLSD& response)
+{
+	std::string text = response["message"].asString();
+	LLSLURL slurl;
+	LLAgentUI::buildSLURL(slurl);
+	text.append("\r\n").append(slurl.getSLURLString());
+
+	LLMessageSystem* msg = gMessageSystem;
+	msg->newMessageFast(_PREHASH_StartLure);
+	msg->nextBlockFast(_PREHASH_AgentData);
+	msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+	msg->nextBlockFast(_PREHASH_Info);
+	msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in.
+	msg->addStringFast(_PREHASH_Message, text);
+	for(LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
+		it != notification["payload"]["ids"].endArray();
+		++it)
+	{
+		LLUUID target_id = it->asUUID();
+
+		msg->nextBlockFast(_PREHASH_TargetData);
+		msg->addUUIDFast(_PREHASH_TargetID, target_id);
+
+		// Record the offer.
+		{
+			std::string target_name;
+			gCacheName->getFullName(target_id, target_name);  // for im log filenames
+			LLSD args;
+			args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
+	
+			LLSD payload;
+				
+			//*TODO please rewrite all keys to the same case, lower or upper
+			payload["from_id"] = target_id;
+			payload["SUPPRESS_TOAST"] = true;
+			LLNotificationsUtil::add("TeleportOfferSent", args, payload);
+
+			// Add the recepient to the recent people list.
+			LLRecentPeople::instance().add(target_id);
+		}
+	}
+	gAgent.sendReliableMessage();
+}
+
 bool handle_lure_callback(const LLSD& notification, const LLSD& response)
 {
-// Caution: this function is also called directly by teleport_request_callback using dummied-up parameters.
-// If you make a change here that uses additional fields in notification or response
-// make sure to add appropriate dummy values in teleport_request_callback.
-llwarns << "DBB notification=" << notification << llendl;
-llwarns << "DBG response=" << response << llendl; 
 	static const unsigned OFFER_RECIPIENT_LIMIT = 250;
 	if(notification["payload"]["ids"].size() > OFFER_RECIPIENT_LIMIT) 
 	{
@@ -6778,51 +6817,12 @@ llwarns << "DBG response=" << response << llendl;
 		LLNotificationsUtil::add("TooManyTeleportOffers", args);
 		return false;
 	}
-	
-	std::string text = response["message"].asString();
-	LLSLURL slurl;
-	LLAgentUI::buildSLURL(slurl);
-	text.append("\r\n").append(slurl.getSLURLString());
+
 	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
 
 	if(0 == option)
 	{
-		LLMessageSystem* msg = gMessageSystem;
-		msg->newMessageFast(_PREHASH_StartLure);
-		msg->nextBlockFast(_PREHASH_AgentData);
-		msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
-		msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-		msg->nextBlockFast(_PREHASH_Info);
-		msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in.
-		msg->addStringFast(_PREHASH_Message, text);
-		for(LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
-			it != notification["payload"]["ids"].endArray();
-			++it)
-		{
-			LLUUID target_id = it->asUUID();
-
-			msg->nextBlockFast(_PREHASH_TargetData);
-			msg->addUUIDFast(_PREHASH_TargetID, target_id);
-
-			// Record the offer.
-			{
-				std::string target_name;
-				gCacheName->getFullName(target_id, target_name);  // for im log filenames
-				LLSD args;
-				args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
-	
-				LLSD payload;
-				
-				//*TODO please rewrite all keys to the same case, lower or upper
-				payload["from_id"] = target_id;
-				payload["SUPPRESS_TOAST"] = true;
-				LLNotificationsUtil::add("TeleportOfferSent", args, payload);
-
-				// Add the recepient to the recent people list.
-				LLRecentPeople::instance().add(target_id);
-			}
-		}
-		gAgent.sendReliableMessage();
+		send_lures(notification, response);
 	}
 
 	return false;
@@ -6896,18 +6896,11 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response)
 		{
 			LLSD dummy_notification;
 			dummy_notification["payload"]["ids"][0] = from_id;
-			dummy_notification["form"]["name"][0] = "OK";
-			dummy_notification["form"]["text"][0] = "OK";
-			dummy_notification["form"]["type"][0] = "button";
-
 
 			LLSD dummy_response;
 			dummy_response["message"] = response["message"];
-			dummy_response["OK"] = 1;
 
-			// Calling handle_lure_callback directly is a bit of a hack to avoid having to copy most of
-			// the code from this routine.
-			handle_lure_callback(dummy_notification, dummy_response);
+			send_lures(dummy_notification, dummy_response);
 		}
 		break;
 
-- 
cgit v1.2.3


From 0afbc85efadfb3e3e825a5cade9f76876fbdf1a4 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 25 Jan 2013 06:23:56 -0500
Subject: STORM-1838 Minor UI improvements and code changes

---
 indra/newview/llavataractions.cpp                  | 73 ++++++++++++++--------
 indra/newview/llviewermessage.cpp                  | 12 +---
 .../newview/skins/default/xui/en/notifications.xml |  6 +-
 3 files changed, 51 insertions(+), 40 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index b65810d357..92e25e1a8b 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -399,43 +399,62 @@ void LLAvatarActions::pay(const LLUUID& id)
 
 void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response)
 {
-	LLMessageSystem* msg = gMessageSystem;
-
-	msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
-	msg->nextBlockFast(_PREHASH_AgentData);
-	msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
-	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-
-	msg->nextBlockFast(_PREHASH_MessageBlock);
-	msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
-	msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] );
-	msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
-	msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
-	msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
-	msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
-
-	std::string name;
-	LLAgentUI::buildFullname(name);
+	S32 option;
+	if (response.isInteger()) 
+	{
+		option = response.asInteger();
+	}
+	else
+	{
+		option = LLNotificationsUtil::getSelectedOption(notification, response);
+	}
 
-	msg->addStringFast(_PREHASH_FromAgentName, name);
-	msg->addStringFast(_PREHASH_Message, response["message"]);
-	msg->addU32Fast(_PREHASH_ParentEstateID, 0);
-	msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
-	msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
+	if (0 == option)
+	{
+		LLMessageSystem* msg = gMessageSystem;
 
-	gMessageSystem->addBinaryDataFast(
-			_PREHASH_BinaryBucket,
-			EMPTY_BINARY_BUCKET,
-			EMPTY_BINARY_BUCKET_SIZE);
+		msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
+		msg->nextBlockFast(_PREHASH_AgentData);
+		msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+		msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+
+		msg->nextBlockFast(_PREHASH_MessageBlock);
+		msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
+		msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] );
+		msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
+		msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
+		msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
+		msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
+
+		std::string name;
+		LLAgentUI::buildFullname(name);
+
+		msg->addStringFast(_PREHASH_FromAgentName, name);
+		msg->addStringFast(_PREHASH_Message, response["message"]);
+		msg->addU32Fast(_PREHASH_ParentEstateID, 0);
+		msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
+		msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
+
+		gMessageSystem->addBinaryDataFast(
+				_PREHASH_BinaryBucket,
+				EMPTY_BINARY_BUCKET,
+				EMPTY_BINARY_BUCKET_SIZE);
 
-	gAgent.sendReliableMessage();
+		gAgent.sendReliableMessage();
+	}
 }
 
 // static
 void LLAvatarActions::teleportRequest(const LLUUID& id)
 {
+	std::string name;
+	gCacheName->getFullName(id, name);
+	gCacheName->cleanFullName(name);
+
 	LLSD notification;
 	notification["uuid"] = id;
+	notification["NAME"] = name + "'s";
+
 	LLSD payload;
 
 	LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback);
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 2dc5fcff85..8d4fab4e9f 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2936,7 +2936,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 				bool canUserAccessDstRegion = true;
 				bool doesUserRequireMaturityIncrease = false;
 
-				if (parse_lure_bucket(region_info, region_handle, pos, look_at, region_access))
+				// Do not parse the (empty) lure bucket for TELEPORT_REQUEST
+				if (IM_TELEPORT_REQUEST != dialog && parse_lure_bucket(region_info, region_handle, pos, look_at, region_access))
 				{
 					region_access_str = LLViewerRegion::accessToString(region_access);
 					region_access_icn = LLViewerRegion::getAccessIcon(region_access);
@@ -6915,15 +6916,6 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response)
 			LLAvatarActions::startIM(from_id);
 		}
 		break;
-
-/*	// Block
-	case 3:
-		{
-			LLMute mute(from_id, from_name, LLMute::AGENT);
-			LLMuteList::getInstance()->add(mute);
-			LLPanelBlockedList::showPanelAndSelect(mute.mID);
-		}
-		break; */
 	}
 	return false;
 }
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 3baf223172..e41f8c8e8c 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3931,7 +3931,7 @@ Join me in [REGION]
    icon="alertmodal.tga"
    name="TeleportRequestPrompt"
    type="alertmodal">
-Request a teleport to their location with the following message
+Request a teleport to [NAME] location with the following message
     <tag>confirm</tag>
     <form name="form">
       <input name="message" type="text">
@@ -6478,7 +6478,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    type="offer">
 [NAME_SLURL] has offered to teleport you to their location:
 
-“[MESSAGE]”
+"[MESSAGE]”
 &lt;icon&gt;[MATURITY_ICON]&lt;/icon&gt; - [MATURITY_STR]
     <tag>confirm</tag>
     <form name="form">
@@ -6543,7 +6543,7 @@ However, this region contains content accessible to adults only.
 [NAME_SLURL] is requesting to be teleported your to your location.
 [MESSAGE]
 
-Will you permit this?
+Offer a teleport?
     <tag>confirm</tag>
     <form name="form">
       <button
-- 
cgit v1.2.3


From 3882945fb9cfbe2710b8f05c7bf8b8c079272191 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sat, 26 Jan 2013 07:00:44 -0500
Subject: STORM-1838 Add code for right click menu on inventory calling cards.
 Add initial support to insert teleport request into existing IM window.

---
 indra/newview/llinventorybridge.cpp                | 12 ++++++++
 indra/newview/llnotificationhandlerutil.cpp        | 32 +++++++++++++---------
 indra/newview/lltoastnotifypanel.cpp               | 21 ++++++++++++++
 .../skins/default/xui/en/menu_inventory.xml        | 14 ++++++----
 .../skins/default/xui/en/menu_people_nearby.xml    | 17 +++++++-----
 5 files changed, 70 insertions(+), 26 deletions(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 14a228df1c..8a57e00252 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4602,6 +4602,16 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act
 			LLAvatarActions::offerTeleport(item->getCreatorUUID());
 		}
 	}
+	else if ("request_lure" == action)
+	{
+		LLViewerInventoryItem *item = getItem();
+		if (item && (item->getCreatorUUID() != gAgent.getID()) &&
+			(!item->getCreatorUUID().isNull()))
+		{
+			LLAvatarActions::teleportRequest(item->getCreatorUUID());
+		}
+	}
+
 	else LLItemBridge::performAction(model, action);
 }
 
@@ -4684,6 +4694,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		items.push_back(std::string("Send Instant Message Separator"));
 		items.push_back(std::string("Send Instant Message"));
 		items.push_back(std::string("Offer Teleport..."));
+		items.push_back(std::string("Request Teleport..."));
 		items.push_back(std::string("Conference Chat"));
 
 		if (!good_card)
@@ -4693,6 +4704,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
 		if (!good_card || !user_online)
 		{
 			disabled_items.push_back(std::string("Offer Teleport..."));
+			disabled_items.push_back(std::string("Request Teleport..."));
 			disabled_items.push_back(std::string("Conference Chat"));
 		}
 	}
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 16c51138a9..7efc231a66 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -111,9 +111,9 @@ void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif)
 }
 
 const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"),
-		REVOKED_MODIFY_RIGHTS("RevokedModifyRights"),
-		OBJECT_GIVE_ITEM("ObjectGiveItem"),
-		OBJECT_GIVE_ITEM_UNKNOWN_USER("ObjectGiveItemUnknownUser"),
+						REVOKED_MODIFY_RIGHTS("RevokedModifyRights"),
+						OBJECT_GIVE_ITEM("ObjectGiveItem"),
+						OBJECT_GIVE_ITEM_UNKNOWN_USER("ObjectGiveItemUnknownUser"),
 						PAYMENT_RECEIVED("PaymentReceived"),
 						PAYMENT_SENT("PaymentSent"),
 						ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"),
@@ -131,6 +131,7 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"),
 						TELEPORT_OFFERED_MATURITY_EXCEEDED("TeleportOffered_MaturityExceeded"),
 						TELEPORT_OFFERED_MATURITY_BLOCKED("TeleportOffered_MaturityBlocked"),
 						TELEPORT_OFFER_SENT("TeleportOfferSent"),
+						TELEPORT_REQUEST("TeleportRequest"),
 						IM_SYSTEM_MESSAGE_TIP("IMSystemMessageTip");
 
 
@@ -154,6 +155,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
 			|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
 			|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()
 			|| TELEPORT_OFFER_SENT == notification->getName()
+			|| TELEPORT_REQUEST == notification->getName()
 			|| IM_SYSTEM_MESSAGE_TIP == notification->getName();
 }
 
@@ -175,27 +177,30 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification)
 			|| USER_GIVE_ITEM == notification->getName()
 			|| TELEPORT_OFFERED == notification->getName()
 			|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
-			|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName();
+			|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()
+			|| TELEPORT_REQUEST == notification->getName();
 }
 
 // static
 bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification)
 {
 	return OFFER_FRIENDSHIP == notification->getName()
-					|| USER_GIVE_ITEM == notification->getName()
-					|| TELEPORT_OFFERED == notification->getName()
-					|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
-					|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName();
+			|| USER_GIVE_ITEM == notification->getName()
+			|| TELEPORT_OFFERED == notification->getName()
+			|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
+			|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()
+			|| TELEPORT_REQUEST == notification->getName();
 }
 
 // static
 bool LLHandlerUtil::isNotificationReusable(const LLNotificationPtr& notification)
 {
 	return OFFER_FRIENDSHIP == notification->getName()
-		|| USER_GIVE_ITEM == notification->getName()
-		|| TELEPORT_OFFERED == notification->getName()
-		|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
-		|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName();
+			|| USER_GIVE_ITEM == notification->getName()
+			|| TELEPORT_OFFERED == notification->getName()
+			|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
+			|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()
+			|| TELEPORT_REQUEST == notification->getName();
 }
 
 // static
@@ -224,7 +229,8 @@ bool LLHandlerUtil::canSpawnToast(const LLNotificationPtr& notification)
 		|| USER_GIVE_ITEM == notification->getName()
 		|| TELEPORT_OFFERED == notification->getName()
 		|| TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName()
-		|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName())
+		|| TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()
+		|| TELEPORT_REQUEST == notification->getName())
 	{
 		// When ANY offer arrives, show toast, unless IM window is already open - EXT-5904
 		return ! isIMFloaterOpened(notification);
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 602b924398..bf2559afaf 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -435,11 +435,28 @@ disable_button_map_t initFriendshipOfferedDisableButtonMap()
 	return disable_map;
 }
 
+disable_button_map_t initTeleportRequestDisableButtonMap()
+{
+	disable_button_map_t disable_map;
+	button_name_set_t buttons;
+
+	buttons.insert("Yes");
+	buttons.insert("No");
+	buttons.insert("IM");
+
+	disable_map.insert(std::make_pair("Yes", buttons));
+	disable_map.insert(std::make_pair("No", buttons));
+	disable_map.insert(std::make_pair("IM", buttons));
+
+	return disable_map;
+}
+
 button_name_set_t getButtonDisableList(const std::string& notification_name, const std::string& button_name)
 {
 	static disable_button_map_t user_give_item_disable_map = initUserGiveItemDisableButtonMap();
 	static disable_button_map_t teleport_offered_disable_map = initTeleportOfferedDisableButtonMap();
 	static disable_button_map_t friendship_offered_disable_map = initFriendshipOfferedDisableButtonMap();
+	static disable_button_map_t teleport_request_disable_map = initTeleportRequestDisableButtonMap();
 
 	disable_button_map_t::const_iterator it;
 	disable_button_map_t::const_iterator it_end;
@@ -457,6 +474,10 @@ button_name_set_t getButtonDisableList(const std::string& notification_name, con
 	{
 		search_map = friendship_offered_disable_map;
 	}
+	else if("TeleportRequest" == notification_name)
+	{
+		search_map = teleport_request_disable_map;
+	}
 
 	it = search_map.find(button_name);
 	it_end = search_map.end();
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index ef315e1a8d..512205ba43 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -590,6 +590,14 @@
          function="Inventory.DoToSelected"
          parameter="lure" />
     </menu_item_call>
+    <menu_item_call
+     label="Request Teleport..."
+     layout="topleft"
+     name="Request Teleport...">
+        <menu_item_call.on_click
+        function="Inventory.DoToSelected"
+        parameter="request_lure" />
+    </menu_item_call>
     <menu_item_call
      label="Start Conference Chat"
      layout="topleft"
@@ -598,12 +606,6 @@
          function="Inventory.BeginIMSession"
          parameter="selected" />
     </menu_item_call>
-    <menu_item_call
-     label="Request Teleport"
-     name="Request Teleport">
-        <menu_item_call.on_click
-        function="Avatar.TeleportRequest" />
-    </menu_item_call>
     <menu_item_separator
      layout="topleft" 
      name="Gesture Separator" />
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index 951f43f325..e7a27c39fa 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -70,13 +70,6 @@
         <menu_item_call.on_click
          function="Avatar.Pay" />
     </menu_item_call>
-    <menu_item_call
-     label="Request Teleport"
-     layout="topleft"
-     name="Request Teleport">
-        <menu_item_call.on_click
-         function="Avatar.TeleportRequest" />
-    </menu_item_call>
     <menu_item_check
      label="Block/Unblock"
      layout="topleft"
@@ -99,4 +92,14 @@
       function="Avatar.EnableItem"
       parameter="can_offer_teleport"/>
     </menu_item_call>
+    <menu_item_call
+     label="Request Teleport"
+     layout="topleft"
+     name="Request Teleport">
+        <menu_item_call.on_click
+         function="Avatar.TeleportRequest"/>
+        <menu_item_call.on_enable
+         function="Avatar.EnableItem"
+         parameter="can_offer_teleport" />
+    </menu_item_call>
 </context_menu>
-- 
cgit v1.2.3


From 71f4f5e4a1534fcf88deae07a7021b02f2ca14f7 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sat, 26 Jan 2013 10:36:05 -0500
Subject: STORM-1838 Added SUPPRESS_TOAST to notification payload

---
 indra/newview/llviewermessage.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 8d4fab4e9f..05b68b7323 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3017,6 +3017,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 					}
 					else if (IM_TELEPORT_REQUEST == dialog)
 					{
+						payload["SUPPRESS_TOAST"] = true;
 						params.name = "TeleportRequest";
 						params.functor.name = "TeleportRequest";
 					}
-- 
cgit v1.2.3


From 0092ec9bd96410f54a82040647f9c361550cde51 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 28 Jan 2013 16:37:03 -0500
Subject: STORM-1929 Top bar: speaker icon clipped, overlapping UI elements

---
 doc/contributions.txt                                   | 1 +
 indra/newview/skins/default/xui/en/panel_status_bar.xml | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index f53d9f5cfd..a4ca4e54c0 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -646,6 +646,7 @@ Jonathan Yap
 	STORM-1872
 	STORM-1858
 	STORM-1862
+	STORM-1929
 Kadah Coba
 	STORM-1060
     STORM-1843
diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml
index dd2a0c6627..064ece6e4b 100644
--- a/indra/newview/skins/default/xui/en/panel_status_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml
@@ -113,7 +113,7 @@
      image_pressed="Pause_Press"
      image_pressed_selected="Play_Press"
      is_toggle="true"
-     left_pad="15"
+     left_pad="5"
      top="1"
      name="media_toggle_btn"
      tool_tip="Start/Stop All Media (Music, Video, Web pages)"
-- 
cgit v1.2.3


From 9de2371f157fa7f62b1c91949fb05b45f18c9812 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 1 Feb 2013 17:04:53 -0500
Subject: make teleport requests appear correctly with respect to open im
 sessions

---
 indra/newview/llviewermessage.cpp                    | 1 -
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 05b68b7323..8d4fab4e9f 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3017,7 +3017,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 					}
 					else if (IM_TELEPORT_REQUEST == dialog)
 					{
-						payload["SUPPRESS_TOAST"] = true;
 						params.name = "TeleportRequest";
 						params.functor.name = "TeleportRequest";
 					}
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e41f8c8e8c..0026555781 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6539,7 +6539,7 @@ However, this region contains content accessible to adults only.
   <notification
    icon="notify.tga"
    name="TeleportRequest"
-   type="notify">
+   type="offer">
 [NAME_SLURL] is requesting to be teleported your to your location.
 [MESSAGE]
 
-- 
cgit v1.2.3


From c8533650b4779040c5e196f9ff156e3454edc9c8 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 1 Feb 2013 17:30:37 -0500
Subject: STORM-1838 Remove IM button

---
 indra/newview/llviewermessage.cpp                    | 8 +-------
 indra/newview/skins/default/xui/en/notifications.xml | 4 ----
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 8d4fab4e9f..69b278ee8d 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6909,14 +6909,8 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response)
 	case 1:
 	default:
 		break;
-
-	// IM
-	case 2:
-		{
-			LLAvatarActions::startIM(from_id);
-		}
-		break;
 	}
+
 	return false;
 }
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 0026555781..dba84b6c6b 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6554,10 +6554,6 @@ Offer a teleport?
        index="1"
        name="No"
        text="No"/>
-      <button
-       index="2"
-       name="IM"
-       text="IM"/>
     </form>
   </notification>
 
-- 
cgit v1.2.3


From a7f1abded200a6099076242370abdb967c801b60 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 21 Feb 2013 00:41:55 +0000
Subject: added llfbconnecttest thanks to callum

---
 indra/CMakeLists.txt                               |    1 +
 indra/test_apps/llfbconnecttest/CMakeLists.txt     |  304 +++
 indra/test_apps/llfbconnecttest/bookmarks.txt      |    4 +
 .../test_apps/llfbconnecttest/llfbconnecttest.cpp  | 2391 ++++++++++++++++++++
 indra/test_apps/llfbconnecttest/llfbconnecttest.h  |  207 ++
 5 files changed, 2907 insertions(+)
 create mode 100644 indra/test_apps/llfbconnecttest/CMakeLists.txt
 create mode 100644 indra/test_apps/llfbconnecttest/bookmarks.txt
 create mode 100644 indra/test_apps/llfbconnecttest/llfbconnecttest.cpp
 create mode 100644 indra/test_apps/llfbconnecttest/llfbconnecttest.h

diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 24c98bfada..61970fa851 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -78,6 +78,7 @@ if (VIEWER)
   # llplugin testbed code (is this the right way to include it?)
   if (LL_TESTS AND NOT LINUX)
     add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
+    add_subdirectory(${VIEWER_PREFIX}test_apps/llfbconnecttest)
   endif (LL_TESTS AND NOT LINUX)
 
   if (LINUX)
diff --git a/indra/test_apps/llfbconnecttest/CMakeLists.txt b/indra/test_apps/llfbconnecttest/CMakeLists.txt
new file mode 100644
index 0000000000..f56329a010
--- /dev/null
+++ b/indra/test_apps/llfbconnecttest/CMakeLists.txt
@@ -0,0 +1,304 @@
+# -*- cmake -*-
+project(llfbconnecttest)
+
+include(00-Common)
+include(FindOpenGL)
+include(LLCommon)
+include(LLPlugin)
+include(Linking)
+include(LLSharedLibs)
+include(PluginAPI)
+include(LLImage)
+include(LLMath)
+include(LLMessage)
+include(LLRender)
+include(LLWindow)
+include(Glut)
+include(Glui)
+
+include_directories(
+    ${LLPLUGIN_INCLUDE_DIRS}
+    ${LLCOMMON_INCLUDE_DIRS}
+    ${LLIMAGE_INCLUDE_DIRS}
+    ${LLMATH_INCLUDE_DIRS}
+    ${LLMESSAGE_INCLUDE_DIRS}
+    ${LLRENDER_INCLUDE_DIRS}
+    ${LLWINDOW_INCLUDE_DIRS}
+)
+
+if (DARWIN)
+    include(CMakeFindFrameworks)
+    find_library(COREFOUNDATION_LIBRARY CoreFoundation)
+endif (DARWIN)
+
+### llfbconnecttest
+
+set(llfbconnecttest_SOURCE_FILES
+    llfbconnecttest.cpp
+    llfbconnecttest.h
+    bookmarks.txt
+    )
+
+add_executable(llfbconnecttest
+    WIN32
+    MACOSX_BUNDLE
+    ${llfbconnecttest_SOURCE_FILES}
+)
+
+set_target_properties(llfbconnecttest
+    PROPERTIES
+    WIN32_EXECUTABLE
+    FALSE
+)
+
+target_link_libraries(llfbconnecttest
+  ${GLUT_LIBRARY}
+  ${GLUI_LIBRARY}
+  ${OPENGL_LIBRARIES}
+  ${LLPLUGIN_LIBRARIES}
+  ${LLMESSAGE_LIBRARIES}
+  ${LLCOMMON_LIBRARIES}
+  ${PLUGIN_API_WINDOWS_LIBRARIES}
+)
+
+if (DARWIN)
+  # The testbed needs to use a couple of CoreFoundation calls now, to deal with being a bundled app.
+  target_link_libraries(llfbconnecttest
+    ${COREFOUNDATION_LIBRARY}
+  )
+endif (DARWIN)
+
+add_dependencies(llfbconnecttest
+  stage_third_party_libs
+  SLPlugin
+  media_plugin_webkit
+  ${LLPLUGIN_LIBRARIES}
+  ${LLMESSAGE_LIBRARIES}
+  ${LLCOMMON_LIBRARIES}
+)
+
+# turn off weird GLUI pragma 
+add_definitions(-DGLUI_NO_LIB_PRAGMA)
+
+if (DARWIN OR LINUX)
+  # glui.h contains code that triggers the "overloaded-virtual" warning in gcc.  
+  set_source_files_properties(llfbconnecttest.cpp PROPERTIES COMPILE_FLAGS "-Wno-overloaded-virtual")
+endif (DARWIN OR LINUX)
+
+# Gather build products of the various dependencies into the build directory for the testbed.
+
+if (DARWIN)
+  # path inside the app bundle where we'll need to copy plugins and other related files
+  set(PLUGINS_DESTINATION_DIR
+    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llfbconnecttest.app/Contents/Resources
+  )
+  
+  # create the Contents/Resources directory
+  add_custom_command(
+    TARGET llfbconnecttest POST_BUILD
+    COMMAND ${CMAKE_COMMAND}
+    ARGS
+      -E
+      make_directory
+      ${PLUGINS_DESTINATION_DIR}
+    COMMENT "Creating Resources directory in app bundle."
+  ) 
+else (DARWIN)
+  set(PLUGINS_DESTINATION_DIR
+    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
+  )
+endif (DARWIN)
+
+get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
+add_custom_command(TARGET llfbconnecttest POST_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN}  ${PLUGINS_DESTINATION_DIR}
+  DEPENDS ${BUILT_SLPLUGIN}
+)
+
+get_target_property(BUILT_LLCOMMON llcommon LOCATION)
+add_custom_command(TARGET llfbconnecttest POST_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON}  ${PLUGINS_DESTINATION_DIR}
+  DEPENDS ${BUILT_LLCOMMON}
+)
+
+
+if (DARWIN OR WINDOWS)
+  get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
+  add_custom_command(TARGET llfbconnecttest POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN}  ${PLUGINS_DESTINATION_DIR}
+    DEPENDS ${BUILT_WEBKIT_PLUGIN}
+  )
+  
+  # copy over bookmarks file if llfbconnecttest gets built
+  get_target_property(BUILT_LLFBCONNECTTEST llfbconnecttest LOCATION)
+  add_custom_command(TARGET llfbconnecttest POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
+    DEPENDS ${BUILT_LLFBCONNECTTEST}
+  )
+  # also copy it to the same place as SLPlugin, which is what the mac wants...
+  add_custom_command(TARGET llfbconnecttest POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
+    DEPENDS ${BUILT_LLFBCONNECTTEST}
+  )
+endif (DARWIN OR WINDOWS)
+
+if (DARWIN)
+  add_custom_command(TARGET llfbconnecttest POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR}
+    DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
+  )
+endif (DARWIN)
+
+if(WINDOWS)
+  #********************
+  # Plugin test library deploy
+  #
+  # Debug config runtime files required for the FB connect test
+  set(fbconnecttest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
+  set(fbconnecttest_debug_files
+    libeay32.dll
+    libglib-2.0-0.dll
+    libgmodule-2.0-0.dll
+    libgobject-2.0-0.dll
+    libgthread-2.0-0.dll
+    qtcored4.dll
+    qtguid4.dll
+    qtnetworkd4.dll
+    qtopengld4.dll
+    qtwebkitd4.dll
+    ssleay32.dll
+    )
+  copy_if_different(
+    ${fbconnecttest_debug_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/Debug"
+    out_targets
+    ${fbconnecttest_debug_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+  
+  # Debug config runtime files required for the FB connect test (Qt image format plugins)
+  set(fbconecttest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}/imageformats")
+  set(fbconecttest_debug_files
+    qgifd4.dll
+    qicod4.dll
+    qjpegd4.dll
+    qmngd4.dll
+    qsvgd4.dll
+    qtiffd4.dll
+    )
+  copy_if_different(
+    ${fbconecttest_debug_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/Debug/imageformats"
+    out_targets
+    ${fbconecttest_debug_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+  # Debug config runtime files required for the FB connect test (Qt codec plugins)
+  set(fbconnecttest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}/codecs")
+  set(fbconnecttest_debug_files
+    qcncodecsd4.dll
+    qjpcodecsd4.dll
+    qkrcodecsd4.dll
+    qtwcodecsd4.dll
+    )
+  copy_if_different(
+    ${fbconnecttest_debug_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/Debug/codecs"
+    out_targets
+    ${fbconnecttest_debug_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+ 
+  # Release & ReleaseDebInfo config runtime files required for the FB connect test
+  set(fbconnecttest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+  set(fbconnecttest_release_files
+    libeay32.dll
+    libglib-2.0-0.dll
+    libgmodule-2.0-0.dll
+    libgobject-2.0-0.dll
+    libgthread-2.0-0.dll
+    qtcore4.dll
+    qtgui4.dll
+    qtnetwork4.dll
+    qtopengl4.dll
+    qtwebkit4.dll
+    qtxmlpatterns4.dll
+    ssleay32.dll
+    )
+  copy_if_different(
+    ${fbconnecttest_release_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/Release"
+    out_targets
+    ${fbconnecttest_release_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+  copy_if_different(
+    ${fbconnecttest_release_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
+    out_targets
+    ${fbconnecttest_release_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+  # Release & ReleaseDebInfo config runtime files required for the FB connect test (Qt image format plugins)
+  set(fbconnecttest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}/imageformats")
+  set(fbconnecttest_release_files
+    qgif4.dll
+    qico4.dll
+    qjpeg4.dll
+    qmng4.dll
+    qsvg4.dll
+    qtiff4.dll
+    )
+  copy_if_different(
+    ${fbconnecttest_release_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/Release/imageformats"
+    out_targets
+    ${fbconnecttest_release_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+  copy_if_different(
+    ${fbconnecttest_release_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/imageformats"
+    out_targets
+    ${fbconnecttest_release_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+  # Release & ReleaseDebInfo config runtime files required for the FB connect test (Qt codec plugins)
+  set(fbconnecttest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}/codecs")
+  set(fbconnecttest_release_files
+    qcncodecs4.dll  
+    qjpcodecs4.dll  
+    qkrcodecs4.dll  
+    qtwcodecs4.dll  
+    )
+  copy_if_different(
+    ${fbconnecttest_release_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/Release/codecs"
+    out_targets
+    ${fbconnecttest_release_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+  copy_if_different(
+    ${fbconnecttest_release_src_dir}
+    "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/codecs"
+    out_targets
+    ${fbconnecttest_release_files}
+    )
+  set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+ 
+   add_custom_target(copy_fbconnecttest_libs ALL
+     DEPENDS 
+     ${fbconnect_test_targets}
+     )
+
+  add_dependencies(llfbconnecttest copy_fbconnecttest_libs)
+
+endif(WINDOWS)
+
+ll_deploy_sharedlibs_command(llfbconnecttest) 
diff --git a/indra/test_apps/llfbconnecttest/bookmarks.txt b/indra/test_apps/llfbconnecttest/bookmarks.txt
new file mode 100644
index 0000000000..3995627ea9
--- /dev/null
+++ b/indra/test_apps/llfbconnecttest/bookmarks.txt
@@ -0,0 +1,4 @@
+# format is description, url (don't put ',' chars in description :)
+# if no ',' found, whole line is used for both description and url
+Google Home Page,http://www.google.com
+Facebook Home Page,http://www.facebook.com
diff --git a/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp b/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp
new file mode 100644
index 0000000000..1a0c783376
--- /dev/null
+++ b/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp
@@ -0,0 +1,2391 @@
+/**
+ * @file LLFBConnectTest.cpp
+ * @brief Facebook Connect Test App
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, 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 "linden_common.h"
+#include "indra_constants.h"
+
+#include "llapr.h"
+#include "llerrorcontrol.h"
+
+#include <math.h>
+#include <iomanip>
+#include <sstream>
+#include <ctime>
+
+#include "llfbconnecttest.h"
+
+#if __APPLE__
+	#include <GLUT/glut.h>
+	#include <CoreFoundation/CoreFoundation.h>
+#else
+	#define FREEGLUT_STATIC
+	#include "GL/freeglut.h"
+	#define GLUI_FREEGLUT
+#endif
+
+#if LL_WINDOWS
+#pragma warning(disable: 4263)
+#pragma warning(disable: 4264)
+#endif
+#include "glui.h"
+
+
+LLFBConnectTest* gApplication = 0;
+static void gluiCallbackWrapper( int control_id );
+
+////////////////////////////////////////////////////////////////////////////////
+//
+static bool isTexture( GLuint texture )
+{
+	bool result = false;
+
+	// glIsTexture will sometimes return false for real textures... do this instead.
+	if(texture != 0)
+		result = true;
+
+	return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel::mediaPanel()
+{
+	mMediaTextureHandle = 0;
+	mPickTextureHandle = 0;
+	mMediaSource = NULL;
+	mPickTexturePixels = NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel::~mediaPanel()
+{
+	// delete OpenGL texture handles
+	if ( isTexture( mPickTextureHandle ) )
+	{
+		std::cerr << "remMediaPanel: deleting pick texture " << mPickTextureHandle << std::endl;
+		glDeleteTextures( 1, &mPickTextureHandle );
+		mPickTextureHandle = 0;
+	}
+
+	if ( isTexture( mMediaTextureHandle ) )
+	{
+		std::cerr << "remMediaPanel: deleting media texture " << mMediaTextureHandle << std::endl;
+		glDeleteTextures( 1, &mMediaTextureHandle );
+		mMediaTextureHandle = 0;
+	}
+
+	if(mPickTexturePixels)
+	{
+		delete mPickTexturePixels;
+	}
+
+	if(mMediaSource)
+	{
+		delete mMediaSource;
+	}
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+LLFBConnectTest::LLFBConnectTest( int app_window, int window_width, int window_height ) :
+	mVersionMajor( 2 ),
+	mVersionMinor( 0 ),
+	mVersionPatch( 0 ),
+	mMaxPanels( 25 ),
+	mViewportAspect( 0 ),
+	mAppWindow( app_window ),
+	mCurMouseX( 0 ),
+	mCurMouseY( 0 ),
+	mFuzzyMedia( true ),
+	mSelectedPanel( 0 ),
+	mDistanceCameraToSelectedGeometry( 0.0f ),
+	//mMediaBrowserControlEnableCookies( 0 ),
+	mMediaBrowserControlBackButton( 0 ),
+	mMediaBrowserControlForwardButton( 0 ),
+	//mMediaTimeControlVolume( 100 ),
+	//mMediaTimeControlSeekSeconds( 0 ),
+	//mGluiMediaTimeControlWindowFlag( true ),
+	mGluiMediaBrowserControlWindowFlag( true ),
+	mMediaBrowserControlBackButtonFlag( true ),
+	mMediaBrowserControlForwardButtonFlag( true ),
+	mHomeWebUrl( "http://www.facebook.com/" )
+{
+	// debugging spam
+	std::cout << std::endl << "             GLUT version: " << "3.7.6" << std::endl;	// no way to get real version from GLUT
+	std::cout << std::endl << "             GLUI version: " << GLUI_Master.get_version() << std::endl;
+	std::cout << std::endl << "Media Plugin Test version: " << mVersionMajor << "." << mVersionMinor << "." << mVersionPatch << std::endl;
+
+	// bookmark title
+	mBookmarks.push_back( std::pair< std::string, std::string >( "--- Bookmarks ---", "" ) );
+
+	// insert hardcoded URLs here as required for testing
+	//mBookmarks.push_back( std::pair< std::string, std::string >( "description", "url" ) );
+
+	// read bookmarks from file.
+	// note: uses command in ./CmakeLists.txt which copies bookmmarks file from source directory
+	//       to app directory (WITHOUT build configuration dir) (this is cwd in Windows within MSVC)
+	//		 For example, test_apps\llplugintest and not test_apps\llplugintest\Release
+	//		 This may need to be changed for Mac/Linux builds.
+	// See https://jira.lindenlab.com/browse/DEV-31350 for large list of media URLs from AGNI
+	const std::string bookmarks_filename( "bookmarks.txt" );
+	std::ifstream file_handle( bookmarks_filename.c_str() );
+	if ( file_handle.is_open() )
+	{
+		std::cout << "Reading bookmarks for test" << std::endl;
+		while( ! file_handle.eof() )
+		{
+			std::string line;
+			std::getline( file_handle, line );
+			if ( file_handle.eof() )
+				break;
+
+			if ( line.substr( 0, 1 ) != "#" )
+			{
+				size_t comma_pos = line.find_first_of( ',' );
+				if ( comma_pos != std::string::npos )
+				{
+					std::string description = line.substr( 0, comma_pos );
+					std::string url = line.substr( comma_pos + 1 );
+					mBookmarks.push_back( std::pair< std::string, std::string >( description, url ) );
+				}
+				else
+				{
+					mBookmarks.push_back( std::pair< std::string, std::string >( line, line ) );
+				};
+			};
+		};
+		std::cout << "Read " << mBookmarks.size() << " bookmarks" << std::endl;
+	}
+	else
+	{
+		std::cout << "Unable to read bookmarks from file: " << bookmarks_filename << std::endl;
+	};
+
+	// initialize linden lab APR module
+	ll_init_apr();
+
+	// Set up llerror logging
+	{
+		LLError::initForApplication(".");
+		LLError::setDefaultLevel(LLError::LEVEL_INFO);
+		//LLError::setTagLevel("Plugin", LLError::LEVEL_DEBUG);
+	}
+
+	// lots of randomness in this app
+	srand( ( unsigned int )time( 0 ) );
+
+	// build GUI
+	makeChrome();
+
+	// OpenGL initialilzation
+	glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
+	glClearDepth( 1.0f );
+	glEnable( GL_DEPTH_TEST );
+	glEnable( GL_COLOR_MATERIAL );
+	glColorMaterial( GL_FRONT, GL_AMBIENT_AND_DIFFUSE );
+	glDepthFunc( GL_LEQUAL );
+	glEnable( GL_TEXTURE_2D );
+	glDisable( GL_BLEND );
+	glColor3f( 1.0f, 1.0f, 1.0f );
+	glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
+	glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
+
+	// start with a sane view
+	resetView();
+
+	// initial media panel
+	const int num_initial_panels = 1;
+	for( int i = 0; i < num_initial_panels; ++i )
+	{
+		//addMediaPanel( mBookmarks[ rand() % ( mBookmarks.size() - 1 ) + 1 ].second );
+		addMediaPanel( mHomeWebUrl );
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+LLFBConnectTest::~LLFBConnectTest()
+{
+	// delete all media panels
+	for( int i = 0; i < (int)mMediaPanels.size(); ++i )
+	{
+		remMediaPanel( mMediaPanels[ i ] );
+	};
+	
+	// Stop the plugin read thread if it's running.
+	LLPluginProcessParent::setUseReadThread(false);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::reshape( int width, int height )
+{
+	// update viewport (the active window inside the chrome)
+	int viewport_x, viewport_y;
+	int viewport_height, viewport_width;
+	GLUI_Master.get_viewport_area( &viewport_x, &viewport_y, &viewport_width, &viewport_height );
+	mViewportAspect = (float)( viewport_width ) / (float)( viewport_height );
+	glViewport( viewport_x, viewport_y, viewport_width, viewport_height );
+
+	// save these as we'll need them later
+	mWindowWidth = width;
+	mWindowHeight = height;
+
+	// adjust size of URL bar so it doesn't get clipped
+	mUrlEdit->set_w( mWindowWidth - 360 );
+
+	// GLUI requires this
+	if ( glutGetWindow() != mAppWindow )
+		glutSetWindow( mAppWindow );
+
+	// trigger re-display
+	glutPostRedisplay();
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::bindTexture(GLuint texture, GLint row_length, GLint alignment)
+{
+	glEnable( GL_TEXTURE_2D );
+
+	glBindTexture( GL_TEXTURE_2D, texture );
+	glPixelStorei( GL_UNPACK_ROW_LENGTH, row_length );
+	glPixelStorei( GL_UNPACK_ALIGNMENT, alignment );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+bool LLFBConnectTest::checkGLError(const char *name)
+{
+	bool result = false;
+	GLenum error = glGetError();
+
+	if(error != GL_NO_ERROR)
+	{
+		// For some reason, glGenTextures is returning GL_INVALID_VALUE...
+		std::cout << name << " ERROR 0x" << std::hex << error << std::dec << std::endl;
+		result = true;
+	}
+
+	return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+GLfloat LLFBConnectTest::distanceToCamera( GLfloat point_x, GLfloat point_y, GLfloat point_z )
+{
+	GLdouble camera_pos_x = 0.0f;
+	GLdouble camera_pos_y = 0.0f;
+	GLdouble camera_pos_z = 0.0f;
+
+	GLdouble modelMatrix[16];
+	GLdouble projMatrix[16];
+	GLint viewport[4];
+
+	glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix);
+	glGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
+	glGetIntegerv(GL_VIEWPORT, viewport);
+
+	gluUnProject(
+		(viewport[2]-viewport[0])/2 , (viewport[3]-viewport[1])/2,
+		0.0,
+		modelMatrix, projMatrix, viewport,
+		&camera_pos_x, &camera_pos_y, &camera_pos_z );
+
+	GLfloat distance =
+		sqrt( ( camera_pos_x - point_x ) * ( camera_pos_x - point_x ) +
+			  ( camera_pos_y - point_y ) * ( camera_pos_y - point_y ) +
+			  ( camera_pos_z - point_z ) * ( camera_pos_z - point_z ) );
+
+	return distance;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::drawGeometry( int panel, bool selected )
+{
+	// texture coordinates for each panel
+	GLfloat non_opengl_texture_coords[ 8 ] = { 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f };
+	GLfloat opengl_texture_coords[ 8 ] =     { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f };
+
+	GLfloat *texture_coords = mMediaPanels[ panel ]->mAppTextureCoordsOpenGL?opengl_texture_coords:non_opengl_texture_coords;
+
+	// base coordinates for each panel
+	GLfloat base_vertex_pos[ 8 ] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f };
+
+	// calculate posiitons
+	const int num_panels = (int)mMediaPanels.size();
+	const int num_rows = (int)sqrt( (float)num_panels );
+	const int num_cols = num_panels / num_rows;
+	const int panel_x = ( panel / num_rows );
+	const int panel_y = ( panel % num_rows );
+
+	// default spacing is small - make it larger if checkbox set - for testing positional audio
+	float spacing = 0.1f;
+	//if ( mLargePanelSpacing )
+	//	spacing = 2.0f;
+
+	const GLfloat offset_x = num_cols * ( 1.0 + spacing ) / 2;
+	const GLfloat offset_y = num_rows * ( 1.0 + spacing ) / 2;
+
+	// Adjust for media aspect ratios
+	{
+		float aspect = 1.0f;
+
+		if(mMediaPanels[ panel ]->mMediaHeight != 0)
+		{
+			aspect = (float)mMediaPanels[ panel ]->mMediaWidth / (float)mMediaPanels[ panel ]->mMediaHeight;
+		}
+
+		if(aspect > 1.0f)
+		{
+			// media is wider than it is high -- adjust the top and bottom in
+			for( int corner = 0; corner < 4; ++corner )
+			{
+				float temp = base_vertex_pos[corner * 2 + 1];
+
+				if(temp < 0.5f)
+					temp += 0.5 - (0.5f / aspect);
+				else
+					temp -= 0.5 - (0.5f / aspect);
+
+				base_vertex_pos[corner * 2 + 1] = temp;
+			}
+		}
+		else if(aspect < 1.0f)
+		{
+			// media is higher than it is wide -- adjust the left and right sides in
+			for( int corner = 0; corner < 4; ++corner )
+			{
+				float temp = base_vertex_pos[corner * 2];
+
+				if(temp < 0.5f)
+					temp += 0.5f - (0.5f * aspect);
+				else
+					temp -= 0.5f - (0.5f * aspect);
+
+				base_vertex_pos[corner * 2] = temp;
+			}
+		}
+	}
+
+	glBegin( GL_QUADS );
+	for( int corner = 0; corner < 4; ++corner )
+	{
+		glTexCoord2f( texture_coords[ corner * 2 ], texture_coords[ corner * 2 + 1 ] );
+		GLfloat x = base_vertex_pos[ corner * 2 ] + panel_x * ( 1.0 + spacing ) - offset_x + spacing / 2.0f;
+		GLfloat y = base_vertex_pos[ corner * 2 + 1 ] + panel_y * ( 1.0 + spacing ) - offset_y + spacing / 2.0f;
+
+		glVertex3f( x, y, 0.0f );
+	};
+	glEnd();
+
+	// calculate distance to this panel if it's selected
+	if ( selected )
+	{
+		GLfloat point_x = base_vertex_pos[ 0 ] + panel_x * ( 1.0 + spacing ) - offset_x + spacing / 2.0f;
+		GLfloat point_y = base_vertex_pos[ 0 + 1 ] + panel_y * ( 1.0 + spacing ) - offset_y + spacing / 2.0f;
+		GLfloat point_z = 0.0f;
+		mDistanceCameraToSelectedGeometry = distanceToCamera( point_x, point_y, point_z );
+	};
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::startPanelHighlight( float red, float green, float blue, float line_width )
+{
+	glPushAttrib( GL_ALL_ATTRIB_BITS );
+	glEnable( GL_POLYGON_OFFSET_FILL );
+	glPolygonOffset( -2.5f, -2.5f );
+	glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+	glLineWidth( line_width );
+	glColor3f( red, green, blue );
+	glDisable( GL_TEXTURE_2D );
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::endPanelHighlight()
+{
+	glPopAttrib();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::draw( int draw_type )
+{
+	for( int panel = 0; panel < (int)mMediaPanels.size(); ++panel )
+	{
+		// drawing pick texture
+		if ( draw_type == DrawTypePickTexture )
+		{
+			// only bother with pick if we have something to render
+			// Actually, we need to pick even if we're not ready to render.
+			// Otherwise you can't select and remove a panel which has gone bad.
+			//if ( mMediaPanels[ panel ]->mReadyToRender )
+			{
+				glMatrixMode( GL_TEXTURE );
+				glPushMatrix();
+
+				// pick texture is a power of 2 so no need to scale
+				glLoadIdentity();
+
+				// bind to media texture
+				glLoadIdentity();
+				bindTexture( mMediaPanels[ panel ]->mPickTextureHandle );
+				glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+				glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+
+				// draw geometry using pick texture
+				drawGeometry( panel, false );
+
+				glMatrixMode( GL_TEXTURE );
+				glPopMatrix();
+			};
+		}
+		else
+		if ( draw_type == DrawTypeMediaTexture )
+		{
+			bool texture_valid = false;
+			bool plugin_exited = false;
+
+			if(mMediaPanels[ panel ]->mMediaSource)
+			{
+				texture_valid = mMediaPanels[ panel ]->mMediaSource->textureValid();
+				plugin_exited = mMediaPanels[ panel ]->mMediaSource->isPluginExited();
+			}
+
+			// save texture matrix (changes for each panel)
+			glMatrixMode( GL_TEXTURE );
+			glPushMatrix();
+
+			// only process texture if the media is ready to draw
+			// (we still want to draw the geometry)
+			if ( mMediaPanels[ panel ]->mReadyToRender && texture_valid )
+			{
+				// bind to media texture
+				bindTexture( mMediaPanels[ panel ]->mMediaTextureHandle );
+
+				if ( mFuzzyMedia )
+				{
+					glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+					glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+				}
+				else
+				{
+					glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+					glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+				}
+
+				// scale to fit panel
+				glScalef( mMediaPanels[ panel ]->mTextureScaleX,
+							mMediaPanels[ panel ]->mTextureScaleY,
+								1.0f );
+			};
+
+			float intensity = plugin_exited?0.25f:1.0f;
+
+			// highlight the selected panel
+			if ( mSelectedPanel && ( mMediaPanels[ panel ]->mId == mSelectedPanel->mId ) )
+			{
+				startPanelHighlight( intensity, intensity, 0.0f, 5.0f );
+				drawGeometry( panel, true );
+				endPanelHighlight();
+			}
+			else
+			// this panel not able to render yet since it
+			// doesn't have enough information
+			if ( !mMediaPanels[ panel ]->mReadyToRender )
+			{
+				startPanelHighlight( intensity, 0.0f, 0.0f, 2.0f );
+				drawGeometry( panel, false );
+				endPanelHighlight();
+			}
+			else
+			// just display a border around the media
+			{
+				startPanelHighlight( 0.0f, intensity, 0.0f, 2.0f );
+				drawGeometry( panel, false );
+				endPanelHighlight();
+			};
+
+			if ( mMediaPanels[ panel ]->mReadyToRender && texture_valid )
+			{
+				// draw visual geometry
+				drawGeometry( panel, false );
+			}
+
+			// restore texture matrix (changes for each panel)
+			glMatrixMode( GL_TEXTURE );
+			glPopMatrix();
+		};
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::display()
+{
+	// GLUI requires this
+	if ( glutGetWindow() != mAppWindow )
+		glutSetWindow( mAppWindow );
+
+	// start with a clean slate
+	glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
+	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+	// set up OpenGL view
+	glMatrixMode( GL_PROJECTION );
+	glLoadIdentity();
+	glFrustum( -mViewportAspect * 0.04f, mViewportAspect * 0.04f, -0.04f, 0.04f, 0.1f, 50.0f );
+	glMatrixMode( GL_MODELVIEW );
+	glLoadIdentity();
+	glTranslatef( 0.0, 0.0, 0.0f );
+	glTranslatef( mViewPos[ 0 ], mViewPos[ 1 ], -mViewPos[ 2 ] );
+	glMultMatrixf( mViewRotation );
+
+	// draw pick texture
+	draw( DrawTypePickTexture );
+
+	// read colors and get coordinate values
+	glReadPixels( mCurMouseX, mCurMouseY, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, mPixelReadColor );
+
+	// clear the pick render (otherwise it may depth-fight with the textures rendered later)
+	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+	// draw visible geometry
+	draw( DrawTypeMediaTexture );
+
+	glutSwapBuffers();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::idle()
+{
+//	checkGLError("LLFBConnectTest::idle");
+
+	// GLUI requires this
+	if ( glutGetWindow() != mAppWindow )
+		glutSetWindow( mAppWindow );
+
+	// random creation/destruction of panels enabled?
+/*
+	const time_t panel_timeout_time = 5;
+	if ( mRandomPanelCount )
+	{
+		// time for a change
+		static time_t last_panel_time = 0;
+		if ( time( NULL ) - last_panel_time > panel_timeout_time )
+		{
+			if ( rand() % 2 == 0 )
+			{
+				if ( mMediaPanels.size() < 16 )
+				{
+					std::cout << "Randomly adding new panel" << std::endl;
+					addMediaPanel( mBookmarks[ rand() % ( mBookmarks.size() - 1 ) + 1 ].second );
+				};
+			}
+			else
+			{
+				if ( mMediaPanels.size() > 0 )
+				{
+					std::cout << "Deleting selected panel" << std::endl;
+					remMediaPanel( mSelectedPanel );
+				};
+			};
+			time( &last_panel_time );
+		};
+	};
+
+	// random selection of bookmarks enabled?
+	const time_t bookmark_timeout_time = 5;
+	if ( mRandomBookmarks )
+	{
+		// time for a change
+		static time_t last_bookmark_time = 0;
+		if ( time( NULL ) - last_bookmark_time > bookmark_timeout_time )
+		{
+			// go to a different random bookmark on each panel
+			for( int panel = 0; panel < (int)mMediaPanels.size(); ++panel )
+			{
+				std::string uri = mBookmarks[ rand() % ( mBookmarks.size() - 1 ) + 1 ].second;
+
+				std::cout << "Random: navigating to : " << uri << std::endl;
+
+				std::string mime_type = mimeTypeFromUrl( uri );
+
+				if ( mime_type != mMediaPanels[ panel ]->mMimeType )
+				{
+					replaceMediaPanel( mMediaPanels[ panel ], uri );
+				}
+				else
+				{
+					mMediaPanels[ panel ]->mMediaSource->loadURI( uri );
+					mMediaPanels[ panel ]->mMediaSource->start();
+				};
+			};
+
+			time( &last_bookmark_time );
+		};
+	};
+*/
+	// update UI
+	if ( mSelectedPanel )
+	{
+		// set volume based on slider if we have time media
+		//if ( mGluiMediaTimeControlWindowFlag )
+		//{
+		//	mSelectedPanel->mMediaSource->setVolume( (float)mMediaTimeControlVolume / 100.0f );
+		//};
+
+		// NOTE: it is absurd that we need cache the state of GLUI controls
+		//       but enabling/disabling controls drags framerate from 500+
+		//		 down to 15. Not a problem for plugin system - only this test
+		// enable/disable time based UI controls based on type of plugin
+		if ( mSelectedPanel->mMediaSource->pluginSupportsMediaTime() )
+		{
+			/*
+			if ( ! mGluiMediaTimeControlWindowFlag )
+			{
+				mGluiMediaTimeControlWindow->enable();
+				mGluiMediaTimeControlWindowFlag = true;
+			};
+			*/
+		}
+		else
+		{
+			/*
+			if ( mGluiMediaTimeControlWindowFlag )
+			{
+				mGluiMediaTimeControlWindow->disable();
+				mGluiMediaTimeControlWindowFlag = false;
+			};
+			*/
+		};
+
+		// enable/disable browser based UI controls based on type of plugin
+		if ( mSelectedPanel->mMediaSource->pluginSupportsMediaBrowser() )
+		{
+			if ( ! mGluiMediaBrowserControlWindowFlag )
+			{
+				mGluiMediaBrowserControlWindow->enable();
+				mGluiMediaBrowserControlWindowFlag = true;
+			};
+		}
+		else
+		{
+			if ( mGluiMediaBrowserControlWindowFlag )
+			{
+				mGluiMediaBrowserControlWindow->disable();
+				mGluiMediaBrowserControlWindowFlag = false;
+			};
+		};
+
+		// enable/disable browser back button depending on browser history
+		if ( mSelectedPanel->mMediaSource->getHistoryBackAvailable()  )
+		{
+			if ( ! mMediaBrowserControlBackButtonFlag )
+			{
+				mMediaBrowserControlBackButton->enable();
+				mMediaBrowserControlBackButtonFlag = true;
+			};
+		}
+		else
+		{
+			if ( mMediaBrowserControlBackButtonFlag )
+			{
+				mMediaBrowserControlBackButton->disable();
+				mMediaBrowserControlBackButtonFlag = false;
+			};
+		};
+
+		// enable/disable browser forward button depending on browser history
+		if ( mSelectedPanel->mMediaSource->getHistoryForwardAvailable()  )
+		{
+			if ( ! mMediaBrowserControlForwardButtonFlag )
+			{
+				mMediaBrowserControlForwardButton->enable();
+				mMediaBrowserControlForwardButtonFlag = true;
+			};
+		}
+		else
+		{
+			if ( mMediaBrowserControlForwardButtonFlag )
+			{
+				mMediaBrowserControlForwardButton->disable();
+				mMediaBrowserControlForwardButtonFlag = false;
+			};
+		};
+
+		// NOTE: This is *very* slow and not worth optimising
+		updateStatusBar();
+	};
+
+	// update all the panels
+	for( int panel_index = 0; panel_index < (int)mMediaPanels.size(); ++panel_index )
+	{
+		mediaPanel *panel = mMediaPanels[ panel_index ];
+
+		// call plugins idle function so it can potentially update itself
+		panel->mMediaSource->idle();
+
+		// update each media panel
+		updateMediaPanel( panel );
+
+		LLRect dirty_rect;
+		if ( ! panel->mMediaSource->textureValid() )
+		{
+			//std::cout << "texture invalid, skipping update..." << std::endl;
+		}
+		else
+		if ( panel &&
+			 ( panel->mMediaWidth != panel->mMediaSource->getWidth() ||
+			   panel->mMediaHeight != panel->mMediaSource->getHeight() ) )
+		{
+			//std::cout << "Resize in progress, skipping update..." << std::endl;
+		}
+		else
+		if ( panel->mMediaSource->getDirty( &dirty_rect ) )
+		{
+			const unsigned char* pixels = panel->mMediaSource->getBitsData();
+			if ( pixels && isTexture(panel->mMediaTextureHandle))
+			{
+				int x_offset = dirty_rect.mLeft;
+				int y_offset = dirty_rect.mBottom;
+				int width = dirty_rect.mRight - dirty_rect.mLeft;
+				int height = dirty_rect.mTop - dirty_rect.mBottom;
+
+				if((dirty_rect.mRight <= panel->mTextureWidth) && (dirty_rect.mTop <= panel->mTextureHeight))
+				{
+					// Offset the pixels pointer properly
+					pixels += ( y_offset * panel->mMediaSource->getTextureDepth() * panel->mMediaSource->getBitsWidth() );
+					pixels += ( x_offset * panel->mMediaSource->getTextureDepth() );
+
+					// set up texture
+					bindTexture( panel->mMediaTextureHandle, panel->mMediaSource->getBitsWidth() );
+					if ( mFuzzyMedia )
+					{
+						glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+						glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+					}
+					else
+					{
+						glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+						glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+					};
+
+					checkGLError("glTexParameteri");
+
+					if(panel->mMediaSource->getTextureFormatSwapBytes())
+					{
+						glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
+						checkGLError("glPixelStorei");
+					}
+
+					// draw portion that changes into texture
+					glTexSubImage2D( GL_TEXTURE_2D, 0,
+						x_offset,
+						y_offset,
+						width,
+						height,
+						panel->mMediaSource->getTextureFormatPrimary(),
+						panel->mMediaSource->getTextureFormatType(),
+						pixels );
+
+					if(checkGLError("glTexSubImage2D"))
+					{
+						std::cerr << "    panel ID=" << panel->mId << std::endl;
+						std::cerr << "    texture size = " << panel->mTextureWidth << " x " << panel->mTextureHeight << std::endl;
+						std::cerr << "    media size = " << panel->mMediaWidth << " x " << panel->mMediaHeight << std::endl;
+						std::cerr << "    dirty rect = " << dirty_rect.mLeft << ", " << dirty_rect.mBottom << ", " << dirty_rect.mRight << ", " << dirty_rect.mTop << std::endl;
+						std::cerr << "    texture width = " << panel->mMediaSource->getBitsWidth() << std::endl;
+						std::cerr << "    format primary = 0x" << std::hex << panel->mMediaSource->getTextureFormatPrimary() << std::dec << std::endl;
+						std::cerr << "    format type = 0x" << std::hex << panel->mMediaSource->getTextureFormatType() << std::dec << std::endl;
+						std::cerr << "    pixels = " << (void*)pixels << std::endl;
+					}
+
+					if(panel->mMediaSource->getTextureFormatSwapBytes())
+					{
+						glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
+						checkGLError("glPixelStorei");
+					}
+
+					panel->mMediaSource->resetDirty();
+
+					panel->mReadyToRender = true;
+				}
+				else
+				{
+					std::cerr << "dirty rect is outside current media size, skipping update" << std::endl;
+				}
+			};
+		};
+	};
+
+	// GLUI requires this
+	if ( glutGetWindow() != mAppWindow )
+		glutSetWindow( mAppWindow );
+
+	// trigger re-display
+	glutPostRedisplay();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::windowPosToTexturePos( int window_x, int window_y,
+											   int& media_x, int& media_y,
+											   int& id )
+{
+	if ( ! mSelectedPanel )
+	{
+		media_x = 0;
+		media_y = 0;
+		id = 0;
+		return;
+	};
+
+	// record cursor poisiton for a readback next frame
+	mCurMouseX = window_x;
+	// OpenGL app == coordinate system this way
+	// NOTE: unrelated to settings in plugin - this
+	// is just for this app
+	mCurMouseY = mWindowHeight - window_y;
+
+	// extract x (0..1023, y (0..1023) and id (0..15) from RGB components
+	unsigned long pixel_read_color_bits = ( mPixelReadColor[ 0 ] << 16 ) | ( mPixelReadColor[ 1 ] << 8 ) | mPixelReadColor[ 2 ];
+	int texture_x = pixel_read_color_bits & 0x3ff;
+	int texture_y = ( pixel_read_color_bits >> 10 ) & 0x3ff;
+	id = ( pixel_read_color_bits >> 20 ) & 0x0f;
+
+	// scale to size of media (1024 because we use 10 bits for X and Y from 24)
+	media_x = (int)( ( (float)mSelectedPanel->mMediaWidth * (float)texture_x ) / 1024.0f );
+	media_y = (int)( ( (float)mSelectedPanel->mMediaHeight * (float)texture_y ) / 1024.0f );
+
+	// we assume the plugin uses an inverted coordinate scheme like OpenGL
+	// if not, the plugin code inverts the Y coordinate for us - we don't need to
+	media_y = mSelectedPanel->mMediaHeight - media_y;
+
+	if ( media_x > 0 && media_y > 0 )
+	{
+		//std::cout << "      mouse coords: " << mCurMouseX << " x " << mCurMouseY << " and id = " << id  << std::endl;
+		//std::cout << "raw texture coords: " << texture_x << " x " << texture_y << " and id = " << id  << std::endl;
+		//std::cout << "      media coords: " << media_x << " x " << media_y << " and id = " << id  << std::endl;
+		//std::cout << std::endl;
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::selectPanelById( int id )
+{
+	for( int panel = 0; panel < (int)mMediaPanels.size(); ++panel )
+	{
+		if ( mMediaPanels[ panel ]->mId == id )
+		{
+			selectPanel(mMediaPanels[ panel ]);
+			return;
+		};
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::selectPanel( mediaPanel* panel )
+{
+	if( mSelectedPanel == panel )
+		return;
+
+	// turn off volume before we delete it
+	if( mSelectedPanel && mSelectedPanel->mMediaSource )
+	{
+		mSelectedPanel->mMediaSource->setVolume( 0.0f );
+		mSelectedPanel->mMediaSource->setPriority( LLPluginClassMedia::PRIORITY_LOW );
+	};
+
+	mSelectedPanel = panel;
+
+	if( mSelectedPanel && mSelectedPanel->mMediaSource )
+	{
+		//mSelectedPanel->mMediaSource->setVolume( (float)mMediaTimeControlVolume / 100.0f );
+		mSelectedPanel->mMediaSource->setPriority( LLPluginClassMedia::PRIORITY_NORMAL );
+
+		if(!mSelectedPanel->mStartUrl.empty())
+		{
+			mUrlEdit->set_text(const_cast<char*>(mSelectedPanel->mStartUrl.c_str()) );
+		}
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel*  LLFBConnectTest::findMediaPanel( LLPluginClassMedia* source )
+{
+	mediaPanel *result = NULL;
+
+	for( int panel = 0; panel < (int)mMediaPanels.size(); ++panel )
+	{
+		if ( mMediaPanels[ panel ]->mMediaSource == source )
+		{
+			result = mMediaPanels[ panel ];
+		}
+	}
+
+	return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel* LLFBConnectTest::findMediaPanel( const std::string &target_name )
+{
+	mediaPanel *result = NULL;
+
+	for( int panel = 0; panel < (int)mMediaPanels.size(); ++panel )
+	{
+		if ( mMediaPanels[ panel ]->mTarget == target_name )
+		{
+			result = mMediaPanels[ panel ];
+		}
+	}
+
+	return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::navigateToNewURI( std::string uri )
+{
+	if ( uri.length() )
+	{
+		std::string mime_type = mimeTypeFromUrl( uri );
+
+		if ( !mSelectedPanel->mMediaSource->isPluginExited() && (mime_type == mSelectedPanel->mMimeType) )
+		{
+			std::cout << "MIME type is the same" << std::endl;
+			mSelectedPanel->mMediaSource->loadURI( uri );
+			mSelectedPanel->mMediaSource->start();
+			mBookmarkList->do_selection( 0 );
+		}
+		else
+		{
+			std::cout << "MIME type changed or plugin had exited" << std::endl;
+			replaceMediaPanel( mSelectedPanel, uri );
+			mBookmarkList->do_selection( 0 );
+		}
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::initUrlHistory( std::string uris )
+{
+	if ( uris.length() > 0 )
+	{
+		std::cout << "init URL : " << uris << std::endl;
+		LLSD historySD;
+
+		char *cstr, *p;
+		cstr = new char[uris.size()+1];
+		strcpy(cstr, uris.c_str());
+		const char *DELIMS = " ,;";
+		p = strtok(cstr, DELIMS);
+		while (p != NULL) {
+			historySD.insert(0, p);
+			p = strtok(NULL, DELIMS);
+		}
+		mSelectedPanel->mMediaSource->initializeUrlHistory(historySD);
+		delete[] cstr;
+	}
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::gluiCallback( int control_id )
+{
+	if ( control_id == mIdBookmarks )
+	{
+		std::string uri = mBookmarks[ mSelBookmark ].second;
+
+		navigateToNewURI( uri );
+	}
+	else
+    if ( control_id == mIdUrlEdit)
+	{
+		std::string uri = mUrlEdit->get_text();
+
+		navigateToNewURI( uri );
+	}
+/*
+	else
+	if ( control_id == mIdUrlInitHistoryEdit )
+	{
+		std::string uri = mUrlInitHistoryEdit->get_text();
+
+		initUrlHistory( uri );
+	}
+	else
+	if ( control_id == mIdControlAddPanel )
+	{
+		addMediaPanel( mBookmarks[ rand() % ( mBookmarks.size() - 1 ) + 1 ].second );
+	}
+	else
+	if ( control_id == mIdControlRemPanel )
+	{
+		remMediaPanel( mSelectedPanel );
+	}
+	else
+	if ( control_id == mIdDisableTimeout )
+	{
+		// Set the "disable timeout" flag for all active plugins.
+		for( int i = 0; i < (int)mMediaPanels.size(); ++i )
+		{
+			mMediaPanels[ i ]->mMediaSource->setDisableTimeout(mDisableTimeout);
+		}
+	}
+	else
+	if ( control_id == mIdUsePluginReadThread )
+	{
+		LLPluginProcessParent::setUseReadThread(mUsePluginReadThread);
+	}
+	else
+	if ( control_id == mIdControlCrashPlugin )
+	{
+		// send message to plugin and ask it to crash
+		// (switch out for ReleaseCandidate version :) )
+		if(mSelectedPanel && mSelectedPanel->mMediaSource)
+		{
+			mSelectedPanel->mMediaSource->crashPlugin();
+		}
+	}
+	else
+	if ( control_id == mIdControlHangPlugin )
+	{
+		// send message to plugin and ask it to hang
+		// (switch out for ReleaseCandidate version :) )
+		if(mSelectedPanel && mSelectedPanel->mMediaSource)
+		{
+			mSelectedPanel->mMediaSource->hangPlugin();
+		}
+	}
+	else
+*/
+	if ( control_id == mIdControlExitApp )
+	{
+		// text for exiting plugin system cleanly
+		delete this;	// clean up
+		exit( 0 );
+	}
+/*
+	else
+	if ( control_id == mIdMediaTimeControlPlay )
+	{
+		if ( mSelectedPanel )
+		{
+			mSelectedPanel->mMediaSource->setLoop( false );
+			mSelectedPanel->mMediaSource->start();
+		};
+	}
+	else
+	if ( control_id == mIdMediaTimeControlLoop )
+	{
+		if ( mSelectedPanel )
+		{
+			mSelectedPanel->mMediaSource->setLoop( true );
+			mSelectedPanel->mMediaSource->start();
+		};
+	}
+	else
+	if ( control_id == mIdMediaTimeControlPause )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->pause();
+	}
+	else
+	if ( control_id == mIdMediaTimeControlStop )
+	{
+		if ( mSelectedPanel )
+		{
+			mSelectedPanel->mMediaSource->stop();
+		};
+	}
+	else
+	if ( control_id == mIdMediaTimeControlSeek )
+	{
+		if ( mSelectedPanel )
+		{
+			// get value from spinner
+			float seconds_to_seek = mMediaTimeControlSeekSeconds;
+			mSelectedPanel->mMediaSource->seek( seconds_to_seek );
+			mSelectedPanel->mMediaSource->start();
+		};
+	}
+	else
+	if ( control_id == mIdMediaTimeControlRewind )
+	{
+		if ( mSelectedPanel )
+		{
+			mSelectedPanel->mMediaSource->setLoop( false );
+			mSelectedPanel->mMediaSource->start(-2.0f);
+		};
+	}
+	else
+	if ( control_id == mIdMediaTimeControlFastForward )
+	{
+		if ( mSelectedPanel )
+		{
+			mSelectedPanel->mMediaSource->setLoop( false );
+			mSelectedPanel->mMediaSource->start(2.0f);
+		};
+	}
+	else
+*/
+	if ( control_id == mIdMediaBrowserControlBack )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->browse_back();
+	}
+	else
+	if ( control_id == mIdMediaBrowserControlStop )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->browse_stop();
+	}
+	else
+	if ( control_id == mIdMediaBrowserControlForward )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->browse_forward();
+	}
+	else
+	if ( control_id == mIdMediaBrowserControlHome )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->loadURI( mHomeWebUrl );
+	}
+	else
+	if ( control_id == mIdMediaBrowserControlReload )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->browse_reload( true );
+	}
+/*
+	else
+	if ( control_id == mIdMediaBrowserControlClearCache )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->clear_cache();
+	}
+	else
+	if ( control_id == mIdMediaBrowserControlClearCookies )
+	{
+		if ( mSelectedPanel )
+			mSelectedPanel->mMediaSource->clear_cookies();
+	}
+	else
+	if ( control_id == mIdMediaBrowserControlEnableCookies )
+	{
+		if ( mSelectedPanel )
+		{
+			if ( mMediaBrowserControlEnableCookies )
+			{
+				mSelectedPanel->mMediaSource->enable_cookies( true );
+			}
+			else
+			{
+				mSelectedPanel->mMediaSource->enable_cookies( false );
+			}
+		};
+	};
+*/
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::keyboard( int key )
+{
+	//if ( key == 'a' || key == 'A' )
+	//	addMediaPanel( mBookmarks[ rand() % ( mBookmarks.size() - 1 ) + 1 ].second );
+	//else
+	//if ( key == 'r' || key == 'R' )
+	//	remMediaPanel( mSelectedPanel );
+	//else
+	//if ( key == 'd' || key == 'D' )
+	//	dumpPanelInfo();
+	//else
+	if ( key == 27 )
+	{
+		std::cout << "Application finished - exiting..." << std::endl;
+		delete this;
+		exit( 0 );
+	};
+
+	mSelectedPanel->mMediaSource->keyEvent( LLPluginClassMedia::KEY_EVENT_DOWN, key, 0 , LLSD());
+	mSelectedPanel->mMediaSource->keyEvent( LLPluginClassMedia::KEY_EVENT_UP, key, 0, LLSD());
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::mouseButton( int button, int state, int x, int y )
+{
+	if ( button == GLUT_LEFT_BUTTON )
+	{
+		if ( state == GLUT_DOWN )
+		{
+			int media_x, media_y, id;
+			windowPosToTexturePos( x, y, media_x, media_y, id );
+
+			if ( mSelectedPanel )
+				mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_DOWN, 0, media_x, media_y, 0 );
+		}
+		else
+		if ( state == GLUT_UP )
+		{
+			int media_x, media_y, id;
+			windowPosToTexturePos( x, y, media_x, media_y, id );
+
+			// only select a panel if we're on a panel
+			// (HACK: strictly speaking this rules out clicking on
+			// the origin of a panel but that's very unlikely)
+			if ( media_x > 0 && media_y > 0 )
+			{
+				selectPanelById( id );
+
+				if ( mSelectedPanel )
+					mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_UP, 0, media_x, media_y, 0 );
+			};
+		};
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::mousePassive( int x, int y )
+{
+	int media_x, media_y, id;
+	windowPosToTexturePos( x, y, media_x, media_y, id );
+
+	if ( mSelectedPanel )
+		mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_MOVE, 0, media_x, media_y, 0 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::mouseMove( int x, int y )
+{
+	int media_x, media_y, id;
+	windowPosToTexturePos( x, y, media_x, media_y, id );
+
+	if ( mSelectedPanel )
+		mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_MOVE, 0, media_x, media_y, 0 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::makeChrome()
+{
+	// IDs used by GLUI
+	int start_id = 0x1000;
+
+	// right side window - geometry manipulators
+#if __APPLE__
+	// the Apple GLUT implementation doesn't seem to set the graphic offset of subwindows correctly when they overlap in certain ways.
+	// Use a separate controls window in this case.
+	// GLUI window at right containing manipulation controls and other buttons
+	int x = glutGet(GLUT_WINDOW_X) + glutGet(GLUT_WINDOW_WIDTH) + 4;
+	int y = glutGet(GLUT_WINDOW_Y);
+	GLUI* right_glui_window = GLUI_Master.create_glui( "", 0, x, y );
+#else
+	GLUI* right_glui_window = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_RIGHT );
+#endif
+	mViewRotationCtrl = right_glui_window->add_rotation( "Rotation", mViewRotation );
+	mViewTranslationCtrl = right_glui_window->add_translation( "Translate", GLUI_TRANSLATION_XY, mViewPos );
+	mViewTranslationCtrl->set_speed( 0.01f );
+	mViewScaleCtrl = right_glui_window->add_translation( "Scale", GLUI_TRANSLATION_Z, &mViewPos[ 2 ] );
+	mViewScaleCtrl->set_speed( 0.05f );
+	right_glui_window->set_main_gfx_window( mAppWindow );
+
+	// right side window - app controls
+	/*
+	mIdControlAddPanel = start_id++;
+	right_glui_window->add_statictext( "" );
+	right_glui_window->add_separator();
+	right_glui_window->add_statictext( "" );
+	right_glui_window->add_button( "Add panel", mIdControlAddPanel, gluiCallbackWrapper );
+	right_glui_window->add_statictext( "" );
+	mIdControlRemPanel = start_id++;
+	right_glui_window->add_button( "Rem panel", mIdControlRemPanel, gluiCallbackWrapper );
+	right_glui_window->add_statictext( "" );
+	right_glui_window->add_separator();
+	right_glui_window->add_statictext( "" );
+	mIdControlCrashPlugin = start_id++;
+	right_glui_window->add_button( "Crash plugin", mIdControlCrashPlugin, gluiCallbackWrapper );
+	mIdControlHangPlugin = start_id++;
+	right_glui_window->add_button( "Hang plugin", mIdControlHangPlugin, gluiCallbackWrapper );
+	*/
+	right_glui_window->add_statictext( "" );
+	right_glui_window->add_separator();
+	right_glui_window->add_statictext( "" );
+	mIdControlExitApp = start_id++;
+	right_glui_window->add_button( "Exit app", mIdControlExitApp, gluiCallbackWrapper );
+
+	//// top window - holds bookmark UI
+	mIdBookmarks = start_id++;
+	mSelBookmark = 0;
+	GLUI* glui_window_top = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_TOP );
+	mBookmarkList = glui_window_top->add_listbox( "", &mSelBookmark, mIdBookmarks, gluiCallbackWrapper );
+	// only add the first 50 bookmarks - list can be very long sometimes (30,000+)
+	// when testing list of media URLs from AGNI for example
+	for( unsigned int each = 0; each < mBookmarks.size() && each < 50; ++each )
+		mBookmarkList->add_item( each, const_cast< char* >( mBookmarks[ each ].first.c_str() ) );
+	glui_window_top->set_main_gfx_window( mAppWindow );
+
+	glui_window_top->add_column( false );
+	mIdUrlEdit = start_id++;
+	mUrlEdit = glui_window_top->add_edittext( "Url:", GLUI_EDITTEXT_TEXT, 0, mIdUrlEdit, gluiCallbackWrapper );
+	mUrlEdit->set_w( 600 );
+	//GLUI* glui_window_top2 = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_TOP );
+	//mIdUrlInitHistoryEdit = start_id++;
+	//mUrlInitHistoryEdit = glui_window_top2->add_edittext( "Init History (separate by commas or semicolons):",
+	//	GLUI_EDITTEXT_TEXT, 0, mIdUrlInitHistoryEdit, gluiCallbackWrapper );
+	//mUrlInitHistoryEdit->set_w( 800 );
+
+	// top window - media controls for "time" media types (e.g. movies)
+/*
+	mGluiMediaTimeControlWindow = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_TOP );
+	mGluiMediaTimeControlWindow->set_main_gfx_window( mAppWindow );
+	mIdMediaTimeControlPlay = start_id++;
+	mGluiMediaTimeControlWindow->add_button( "PLAY", mIdMediaTimeControlPlay, gluiCallbackWrapper );
+	mGluiMediaTimeControlWindow->add_column( false );
+	mIdMediaTimeControlLoop = start_id++;
+	mGluiMediaTimeControlWindow->add_button( "LOOP", mIdMediaTimeControlLoop, gluiCallbackWrapper );
+	mGluiMediaTimeControlWindow->add_column( false );
+	mIdMediaTimeControlPause = start_id++;
+	mGluiMediaTimeControlWindow->add_button( "PAUSE", mIdMediaTimeControlPause, gluiCallbackWrapper );
+	mGluiMediaTimeControlWindow->add_column( false );
+
+	GLUI_Button  *button;
+	mIdMediaTimeControlRewind = start_id++;
+	button = mGluiMediaTimeControlWindow->add_button( "<<", mIdMediaTimeControlRewind, gluiCallbackWrapper );
+	button->set_w(30);
+	mGluiMediaTimeControlWindow->add_column( false );
+	mIdMediaTimeControlFastForward = start_id++;
+	button = mGluiMediaTimeControlWindow->add_button( ">>", mIdMediaTimeControlFastForward, gluiCallbackWrapper );
+	button->set_w(30);
+
+	mGluiMediaTimeControlWindow->add_column( true );
+
+	mIdMediaTimeControlStop = start_id++;
+	mGluiMediaTimeControlWindow->add_button( "STOP", mIdMediaTimeControlStop, gluiCallbackWrapper );
+	mGluiMediaTimeControlWindow->add_column( false );
+	mIdMediaTimeControlVolume = start_id++;
+	GLUI_Spinner* spinner = mGluiMediaTimeControlWindow->add_spinner( "Volume", 2, &mMediaTimeControlVolume, mIdMediaTimeControlVolume, gluiCallbackWrapper);
+	spinner->set_float_limits( 0, 100 );
+	mGluiMediaTimeControlWindow->add_column( true );
+	mIdMediaTimeControlSeekSeconds = start_id++;
+	spinner = mGluiMediaTimeControlWindow->add_spinner( "", 2, &mMediaTimeControlSeekSeconds, mIdMediaTimeControlSeekSeconds, gluiCallbackWrapper);
+	spinner->set_float_limits( 0, 200 );
+	spinner->set_w( 32 );
+	spinner->set_speed( 0.025f );
+	mGluiMediaTimeControlWindow->add_column( false );
+	mIdMediaTimeControlSeek = start_id++;
+	mGluiMediaTimeControlWindow->add_button( "SEEK", mIdMediaTimeControlSeek, gluiCallbackWrapper );
+	mGluiMediaTimeControlWindow->add_column( false );
+*/
+
+	// top window - media controls for "browser" media types (e.g. web browser)
+	mGluiMediaBrowserControlWindow = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_TOP );
+	mGluiMediaBrowserControlWindow->set_main_gfx_window( mAppWindow );
+	mIdMediaBrowserControlBack = start_id++;
+	mMediaBrowserControlBackButton = mGluiMediaBrowserControlWindow->add_button( "BACK", mIdMediaBrowserControlBack, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	mIdMediaBrowserControlStop = start_id++;
+	mGluiMediaBrowserControlWindow->add_button( "STOP", mIdMediaBrowserControlStop, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	mIdMediaBrowserControlForward = start_id++;
+	mMediaBrowserControlForwardButton = mGluiMediaBrowserControlWindow->add_button( "FORWARD", mIdMediaBrowserControlForward, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	mIdMediaBrowserControlHome = start_id++;
+	mGluiMediaBrowserControlWindow->add_button( "HOME", mIdMediaBrowserControlHome, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	mIdMediaBrowserControlReload = start_id++;
+	mGluiMediaBrowserControlWindow->add_button( "RELOAD", mIdMediaBrowserControlReload, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	/*
+	mIdMediaBrowserControlClearCache = start_id++;
+	mGluiMediaBrowserControlWindow->add_button( "CLEAR CACHE", mIdMediaBrowserControlClearCache, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	mIdMediaBrowserControlClearCookies = start_id++;
+	mGluiMediaBrowserControlWindow->add_button( "CLEAR COOKIES", mIdMediaBrowserControlClearCookies, gluiCallbackWrapper );
+	mGluiMediaBrowserControlWindow->add_column( false );
+	mIdMediaBrowserControlEnableCookies = start_id++;
+	mMediaBrowserControlEnableCookies = 0;
+	mGluiMediaBrowserControlWindow->add_checkbox( "Enable Cookies", &mMediaBrowserControlEnableCookies, mIdMediaBrowserControlEnableCookies, gluiCallbackWrapper );
+
+	// top window - misc controls
+	GLUI* glui_window_misc_control = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_TOP );
+	mIdRandomPanelCount = start_id++;
+	mRandomPanelCount = 0;
+	glui_window_misc_control->add_checkbox( "Randomize panel count", &mRandomPanelCount, mIdRandomPanelCount, gluiCallbackWrapper );
+	glui_window_misc_control->set_main_gfx_window( mAppWindow );
+	glui_window_misc_control->add_column( true );
+	mIdRandomBookmarks = start_id++;
+	mRandomBookmarks = 0;
+	glui_window_misc_control->add_checkbox( "Randomize bookmarks", &mRandomBookmarks, mIdRandomBookmarks, gluiCallbackWrapper );
+	glui_window_misc_control->set_main_gfx_window( mAppWindow );
+	glui_window_misc_control->add_column( true );
+
+	mIdDisableTimeout = start_id++;
+	mDisableTimeout = 0;
+	glui_window_misc_control->add_checkbox( "Disable plugin timeout", &mDisableTimeout, mIdDisableTimeout, gluiCallbackWrapper );
+	glui_window_misc_control->set_main_gfx_window( mAppWindow );
+	glui_window_misc_control->add_column( true );
+
+	mIdUsePluginReadThread = start_id++;
+	mUsePluginReadThread = 0;
+	glui_window_misc_control->add_checkbox( "Use plugin read thread", &mUsePluginReadThread, mIdUsePluginReadThread, gluiCallbackWrapper );
+	glui_window_misc_control->set_main_gfx_window( mAppWindow );
+	glui_window_misc_control->add_column( true );
+
+	mIdLargePanelSpacing = start_id++;
+	mLargePanelSpacing = 0;
+	glui_window_misc_control->add_checkbox( "Large Panel Spacing", &mLargePanelSpacing, mIdLargePanelSpacing, gluiCallbackWrapper );
+	glui_window_misc_control->set_main_gfx_window( mAppWindow );
+	glui_window_misc_control->add_column( true );
+*/
+	// bottom window - status
+	mBottomGLUIWindow = GLUI_Master.create_glui_subwindow( mAppWindow, GLUI_SUBWINDOW_BOTTOM );
+	mStatusText = mBottomGLUIWindow->add_statictext( "" );
+	mBottomGLUIWindow->set_main_gfx_window( mAppWindow );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::resetView()
+{
+	mViewRotationCtrl->reset();
+
+	mViewScaleCtrl->set_x( 0.0f );
+	mViewScaleCtrl->set_y( 0.0f );
+	mViewScaleCtrl->set_z( 1.3f );
+
+	mViewTranslationCtrl->set_x( 0.0f );
+	mViewTranslationCtrl->set_y( 0.0f );
+	mViewTranslationCtrl->set_z( 0.0f );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::makePickTexture( int id, GLuint* texture_handle, unsigned char** texture_pixels )
+{
+	int pick_texture_width = 1024;
+	int pick_texture_height = 1024;
+	int pick_texture_depth = 3;
+	unsigned char* ptr = new unsigned char[ pick_texture_width * pick_texture_height * pick_texture_depth ];
+	for( int y = 0; y < pick_texture_height; ++y )
+	{
+		for( int x = 0; x < pick_texture_width * pick_texture_depth ; x += pick_texture_depth )
+		{
+			unsigned long bits = 0L;
+			bits |= ( id << 20 ) | ( y << 10 ) | ( x / 3 );
+			unsigned char r_component = ( bits >> 16 ) & 0xff;
+			unsigned char g_component = ( bits >> 8 ) & 0xff;
+			unsigned char b_component = bits & 0xff;
+
+			ptr[ y * pick_texture_width * pick_texture_depth + x + 0 ] = r_component;
+			ptr[ y * pick_texture_width * pick_texture_depth + x + 1 ] = g_component;
+			ptr[ y * pick_texture_width * pick_texture_depth + x + 2 ] = b_component;
+		};
+	};
+
+	glGenTextures( 1, texture_handle );
+
+	checkGLError("glGenTextures");
+	std::cout << "glGenTextures returned " << *texture_handle << std::endl;
+
+	bindTexture( *texture_handle );
+	glTexImage2D( GL_TEXTURE_2D, 0,
+					GL_RGB,
+						pick_texture_width, pick_texture_height,
+							0, GL_RGB, GL_UNSIGNED_BYTE, ptr );
+
+	*texture_pixels = ptr;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+std::string LLFBConnectTest::mimeTypeFromUrl( std::string& url )
+{
+	// default to web
+	std::string mime_type = "text/html";
+
+	// we may need a more advanced MIME type accessor later :-)
+	if ( url.find( ".mov" ) != std::string::npos )	// Movies
+		mime_type = "video/quicktime";
+	else
+	if ( url.find( ".txt" ) != std::string::npos )	// Apple Text descriptors
+		mime_type = "video/quicktime";
+	else
+	if ( url.find( ".mp3" ) != std::string::npos )	// Apple Text descriptors
+		mime_type = "video/quicktime";
+	else
+	if ( url.find( "example://" ) != std::string::npos )	// Example plugin
+		mime_type = "example/example";
+
+	return mime_type;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+std::string LLFBConnectTest::pluginNameFromMimeType( std::string& mime_type )
+{
+#if LL_DARWIN
+	std::string plugin_name( "media_plugin_null.dylib" );
+	if ( mime_type == "video/quicktime" )
+		plugin_name = "media_plugin_quicktime.dylib";
+	else
+	if ( mime_type == "text/html" )
+		plugin_name = "media_plugin_webkit.dylib";
+
+#elif LL_WINDOWS
+	std::string plugin_name( "media_plugin_null.dll" );
+
+	if ( mime_type == "video/quicktime" )
+		plugin_name = "media_plugin_quicktime.dll";
+	else
+	if ( mime_type == "text/html" )
+		plugin_name = "media_plugin_webkit.dll";
+	else
+	if ( mime_type == "example/example" )
+		plugin_name = "media_plugin_example.dll";
+
+#elif LL_LINUX
+	std::string plugin_name( "libmedia_plugin_null.so" );
+
+	if ( mime_type == "video/quicktime" )
+		plugin_name = "libmedia_plugin_quicktime.so";
+	else
+	if ( mime_type == "text/html" )
+		plugin_name = "libmedia_plugin_webkit.so";
+#endif
+	return plugin_name;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel* LLFBConnectTest::addMediaPanel( std::string url )
+{
+	// Get the plugin filename using the URL
+	std::string mime_type = mimeTypeFromUrl( url );
+	std::string plugin_name = pluginNameFromMimeType( mime_type );
+
+	// create a random size for the new media
+	int media_width;
+	int media_height;
+	getRandomMediaSize( media_width, media_height, mime_type );
+	media_width = 1024;
+	media_height = 1536;
+
+	// make a new plugin
+	LLPluginClassMedia* media_source = new LLPluginClassMedia(this);
+
+	// tell the plugin what size we asked for
+	media_source->setSize( media_width, media_height );
+
+	// Use the launcher start and initialize the plugin
+#if LL_DARWIN || LL_LINUX
+	std::string launcher_name( "SLPlugin" );
+#elif LL_WINDOWS
+	std::string launcher_name( "SLPlugin.exe" );
+#endif
+
+	// for this test app, use the cwd as the user data path (ugh).
+#if LL_WINDOWS
+	std::string user_data_path = ".\\";
+#else
+        char cwd[ FILENAME_MAX ];
+	if (NULL == getcwd( cwd, FILENAME_MAX - 1 ))
+	{
+		std::cerr << "Couldn't get cwd - probably too long - failing to init." << std::endl;
+		return NULL;
+	}
+	std::string user_data_path = std::string( cwd ) + "/";
+#endif
+	media_source->setUserDataPath(user_data_path);
+	media_source->init( launcher_name, user_data_path, plugin_name, false );
+	//media_source->setDisableTimeout(mDisableTimeout);
+
+	// make a new panel and save parameters
+	mediaPanel* panel = new mediaPanel;
+	panel->mMediaSource = media_source;
+	panel->mStartUrl = url;
+	panel->mMimeType = mime_type;
+	panel->mMediaWidth = media_width;
+	panel->mMediaHeight = media_height;
+	panel->mTextureWidth = 0;
+	panel->mTextureHeight = 0;
+	panel->mTextureScaleX = 0;
+	panel->mTextureScaleY = 0;
+	panel->mMediaTextureHandle = 0;
+	panel->mPickTextureHandle = 0;
+	panel->mAppTextureCoordsOpenGL = false;	// really need an 'undefined' state here too
+	panel->mReadyToRender = false;
+
+	// look through current media panels to find an unused index number
+	bool id_exists = true;
+	for( int nid = 0; nid < mMaxPanels; ++nid )
+	{
+		// does this id exist already?
+		id_exists = false;
+		for( int pid = 0; pid < (int)mMediaPanels.size(); ++pid )
+		{
+			if ( nid == mMediaPanels[ pid ]->mId )
+			{
+				id_exists = true;
+				break;
+			};
+		};
+
+		// id wasn't found so we can use it
+		if ( ! id_exists )
+		{
+			panel->mId = nid;
+			break;
+		};
+	};
+
+	// if we get here and this flag is set, there is no room for any more panels
+	if ( id_exists )
+	{
+		std::cout << "No room for any more panels" << std::endl;
+	}
+	else
+	{
+		// now we have the ID we can use it to make the
+		// pick texture (id is baked into texture pixels)
+		makePickTexture( panel->mId, &panel->mPickTextureHandle, &panel->mPickTexturePixels );
+
+		// save this in the list of panels
+		mMediaPanels.push_back( panel );
+
+		// select the panel that was just created
+		selectPanel( panel );
+
+		// load and start the URL
+		panel->mMediaSource->loadURI( url );
+		panel->mMediaSource->start();
+
+		std::cout << "Adding new media panel for " << url << "(" << media_width << "x" << media_height << ") with index " << panel->mId << " - total panels = " << mMediaPanels.size() << std::endl;
+	}
+	
+	return panel;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::updateMediaPanel( mediaPanel* panel )
+{
+//	checkGLError("LLFBConnectTest::updateMediaPanel");
+
+	if ( ! panel )
+		return;
+
+	if(!panel->mMediaSource || !panel->mMediaSource->textureValid())
+	{
+		panel->mReadyToRender = false;
+		return;
+	}
+
+	// take a reference copy of the plugin values since they
+	// might change during this lifetime of this function
+	int plugin_media_width = panel->mMediaSource->getWidth();
+	int plugin_media_height = panel->mMediaSource->getHeight();
+	int plugin_texture_width = panel->mMediaSource->getBitsWidth();
+	int plugin_texture_height = panel->mMediaSource->getBitsHeight();
+
+	// If the texture isn't created or the media or texture dimensions changed AND
+	// the sizes are valid then we need to delete the old media texture (if necessary)
+	// then make a new one.
+	if ((panel->mMediaTextureHandle == 0 ||
+		 panel->mMediaWidth != plugin_media_width ||
+		 panel->mMediaHeight != plugin_media_height ||
+		 panel->mTextureWidth != plugin_texture_width ||
+		 panel->mTextureHeight != plugin_texture_height) &&
+		( plugin_media_width > 0 && plugin_media_height > 0 &&
+		  plugin_texture_width > 0 && plugin_texture_height > 0 ) )
+	{
+		std::cout << "Valid media size (" <<  plugin_media_width << " x " << plugin_media_height
+				<< ") and texture size (" <<  plugin_texture_width << " x " << plugin_texture_height
+				<< ") for panel with ID=" << panel->mId << " - making texture" << std::endl;
+
+		// delete old GL texture
+		if ( isTexture( panel->mMediaTextureHandle ) )
+		{
+			std::cerr << "updateMediaPanel: deleting texture " << panel->mMediaTextureHandle << std::endl;
+			glDeleteTextures( 1, &panel->mMediaTextureHandle );
+			panel->mMediaTextureHandle = 0;
+		}
+
+		std::cerr << "before: pick texture is " << panel->mPickTextureHandle << ", media texture is " << panel->mMediaTextureHandle << std::endl;
+
+		// make a GL texture based on the dimensions the plugin told us
+		GLuint new_texture = 0;
+		glGenTextures( 1, &new_texture );
+
+		checkGLError("glGenTextures");
+
+		std::cout << "glGenTextures returned " << new_texture << std::endl;
+
+		panel->mMediaTextureHandle = new_texture;
+
+		bindTexture( panel->mMediaTextureHandle );
+
+		std::cout << "Setting texture size to " << plugin_texture_width << " x " << plugin_texture_height << std::endl;
+		glTexImage2D( GL_TEXTURE_2D, 0,
+			GL_RGB,
+				plugin_texture_width, plugin_texture_height,
+					0, GL_RGB, GL_UNSIGNED_BYTE,
+						0 );
+
+
+		std::cerr << "after: pick texture is " << panel->mPickTextureHandle << ", media texture is " << panel->mMediaTextureHandle << std::endl;
+	};
+
+	// update our record of the media and texture dimensions
+	// NOTE: do this after we we check for sizes changes
+	panel->mMediaWidth = plugin_media_width;
+	panel->mMediaHeight = plugin_media_height;
+	panel->mTextureWidth = plugin_texture_width;
+	panel->mTextureHeight = plugin_texture_height;
+	if ( plugin_texture_width > 0 )
+	{
+		panel->mTextureScaleX = (double)panel->mMediaWidth / (double)panel->mTextureWidth;
+	};
+	if ( plugin_texture_height > 0 )
+	{
+		panel->mTextureScaleY = (double)panel->mMediaHeight / (double)panel->mTextureHeight;
+	};
+
+	// update the flag which tells us if the media source uses OprnGL coords or not.
+	panel->mAppTextureCoordsOpenGL = panel->mMediaSource->getTextureCoordsOpenGL();
+
+	// Check to see if we have enough to render this panel.
+	// If we do, set a flag that the display functions use so
+	// they only render a panel with media if it's ready.
+	if ( panel->mMediaWidth < 0 ||
+		 panel->mMediaHeight < 0 ||
+		 panel->mTextureWidth < 1 ||
+		 panel->mTextureHeight < 1 ||
+		 panel->mMediaTextureHandle == 0 )
+	{
+		panel->mReadyToRender = false;
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel* LLFBConnectTest::replaceMediaPanel( mediaPanel* panel, std::string url )
+{
+	// no media panels so we can't change anything - have to add
+	if ( mMediaPanels.size() == 0 )
+		return NULL;
+
+	// sanity check
+	if ( ! panel )
+		return NULL;
+
+	int index;
+	for(index = 0; index < (int)mMediaPanels.size(); index++)
+	{
+		if(mMediaPanels[index] == panel)
+			break;
+	}
+
+	if(index >= (int)mMediaPanels.size())
+	{
+		// panel isn't in mMediaPanels
+		return NULL;
+	}
+
+	std::cout << "Replacing media panel with index " << panel->mId << std::endl;
+
+	int panel_id = panel->mId;
+
+	if(mSelectedPanel == panel)
+		mSelectedPanel = NULL;
+
+	delete panel;
+
+	// Get the plugin filename using the URL
+	std::string mime_type = mimeTypeFromUrl( url );
+	std::string plugin_name = pluginNameFromMimeType( mime_type );
+
+	// create a random size for the new media
+	int media_width;
+	int media_height;
+	getRandomMediaSize( media_width, media_height, mime_type );
+
+	// make a new plugin
+	LLPluginClassMedia* media_source = new LLPluginClassMedia(this);
+
+	// tell the plugin what size we asked for
+	media_source->setSize( media_width, media_height );
+
+	// Use the launcher start and initialize the plugin
+#if LL_DARWIN || LL_LINUX
+	std::string launcher_name( "SLPlugin" );
+#elif LL_WINDOWS
+	std::string launcher_name( "SLPlugin.exe" );
+#endif
+
+	// for this test app, use the cwd as the user data path (ugh).
+#if LL_WINDOWS
+	std::string user_data_path = ".\\";
+#else
+        char cwd[ FILENAME_MAX ];
+	if (NULL == getcwd( cwd, FILENAME_MAX - 1 ))
+	{
+		std::cerr << "Couldn't get cwd - probably too long - failing to init." << std::endl;
+		return NULL;
+	}
+	std::string user_data_path = std::string( cwd ) + "/";
+#endif
+
+	media_source->setUserDataPath(user_data_path);
+	media_source->init( launcher_name, user_data_path, plugin_name, false );
+	//media_source->setDisableTimeout(mDisableTimeout);
+
+	// make a new panel and save parameters
+	panel = new mediaPanel;
+	panel->mMediaSource = media_source;
+	panel->mStartUrl = url;
+	panel->mMimeType = mime_type;
+	panel->mMediaWidth = media_width;
+	panel->mMediaHeight = media_height;
+	panel->mTextureWidth = 0;
+	panel->mTextureHeight = 0;
+	panel->mTextureScaleX = 0;
+	panel->mTextureScaleY = 0;
+	panel->mMediaTextureHandle = 0;
+	panel->mPickTextureHandle = 0;
+	panel->mAppTextureCoordsOpenGL = false;	// really need an 'undefined' state here too
+	panel->mReadyToRender = false;
+
+	panel->mId = panel_id;
+
+	// Replace the entry in the panels array
+	mMediaPanels[index] = panel;
+
+	// now we have the ID we can use it to make the
+	// pick texture (id is baked into texture pixels)
+	makePickTexture( panel->mId, &panel->mPickTextureHandle, &panel->mPickTexturePixels );
+
+	// select the panel that was just created
+	selectPanel( panel );
+
+	// load and start the URL
+	panel->mMediaSource->loadURI( url );
+	panel->mMediaSource->start();
+	
+	return panel;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::getRandomMediaSize( int& width, int& height, std::string mime_type )
+{
+	// Make a new media source with a random size which we'll either
+	// directly or the media plugin will tell us what it wants later.
+	// Use a random size so we can test support for weird media sizes.
+	// (Almost everything else will get filled in later once the
+	// plugin responds)
+	// NB. Do we need to enforce that width is on 4 pixel boundary?
+	width = ( ( rand() % 170 ) + 30 ) * 4;
+	height = ( ( rand() % 170 ) + 30 ) * 4;
+
+	// adjust this random size if it's a browser so we get
+	// a more useful size for testing..
+	if ( mime_type == "text/html" || mime_type == "example/example"  )
+	{
+		width = ( ( rand() % 100 ) + 100 ) * 4;
+		height = ( width * ( ( rand() % 400 ) + 1000 ) ) / 1000;
+	};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::remMediaPanel( mediaPanel* panel )
+{
+	// always leave one panel
+	if ( mMediaPanels.size() == 1 )
+		return;
+
+	// sanity check - don't think this can happen but see above for a case where it might...
+	if ( ! panel )
+		return;
+
+	std::cout << "Removing media panel with index " << panel->mId << " - total panels = " << mMediaPanels.size() - 1 << std::endl;
+
+	if(mSelectedPanel == panel)
+		mSelectedPanel = NULL;
+
+	delete panel;
+
+	// remove from storage list
+	for( int i = 0; i < (int)mMediaPanels.size(); ++i )
+	{
+		if ( mMediaPanels[ i ] == panel )
+		{
+			mMediaPanels.erase( mMediaPanels.begin() + i );
+			break;
+		};
+	};
+
+	// select the first panel
+	selectPanel( mMediaPanels[ 0 ] );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::updateStatusBar()
+{
+	if ( ! mSelectedPanel )
+		return;
+
+	// cache results - this is a very slow function
+	static int cached_id = -1;
+	static int cached_media_width = -1;
+	static int cached_media_height = -1;
+	static int cached_texture_width = -1;
+	static int cached_texture_height = -1;
+	static bool cached_supports_browser_media = true;
+	static bool cached_supports_time_media = false;
+	static int cached_movie_time = -1;
+	static GLfloat cached_distance = -1.0f;
+
+	static std::string cached_plugin_version = "";
+	if (
+		 cached_id == mSelectedPanel->mId &&
+		 cached_media_width == mSelectedPanel->mMediaWidth &&
+		 cached_media_height  == mSelectedPanel->mMediaHeight &&
+		 cached_texture_width == mSelectedPanel->mTextureWidth &&
+		 cached_texture_height == mSelectedPanel->mTextureHeight &&
+		 cached_supports_browser_media == mSelectedPanel->mMediaSource->pluginSupportsMediaBrowser() &&
+		 cached_supports_time_media == mSelectedPanel->mMediaSource->pluginSupportsMediaTime() &&
+		 cached_plugin_version == mSelectedPanel->mMediaSource->getPluginVersion() &&
+		 cached_movie_time == (int)mSelectedPanel->mMediaSource->getCurrentTime() &&
+		 cached_distance == mDistanceCameraToSelectedGeometry
+	   )
+	{
+		// nothing changed so don't spend time here
+		return;
+	};
+
+	std::ostringstream stream( "" );
+
+	stream.str( "" );
+	stream.clear();
+
+	stream << "Id: ";
+	stream << std::setw( 2 ) << std::setfill( '0' );
+	stream << mSelectedPanel->mId;
+	stream << " | ";
+	stream << "Media: ";
+	stream << std::setw( 3 ) << std::setfill( '0' );
+	stream << mSelectedPanel->mMediaWidth;
+	stream << " x ";
+	stream << std::setw( 3 ) << std::setfill( '0' );
+	stream << mSelectedPanel->mMediaHeight;
+	stream << " | ";
+	stream << "Texture: ";
+	stream << std::setw( 4 ) << std::setfill( '0' );
+	stream << mSelectedPanel->mTextureWidth;
+	stream << " x ";
+	stream << std::setw( 4 ) << std::setfill( '0' );
+	stream << mSelectedPanel->mTextureHeight;
+
+	stream << " | ";
+	stream << "Distance: ";
+	stream << std::setw( 6 );
+	stream << std::setprecision( 3 );
+	stream << std::setprecision( 3 );
+	stream << mDistanceCameraToSelectedGeometry;
+	stream << " | ";
+
+	if ( mSelectedPanel->mMediaSource->pluginSupportsMediaBrowser() )
+		stream << "BROWSER";
+	else
+	if ( mSelectedPanel->mMediaSource->pluginSupportsMediaTime() )
+		stream << "TIME   ";
+	stream << " | ";
+	stream << mSelectedPanel->mMediaSource->getPluginVersion();
+	stream << " | ";
+	if ( mSelectedPanel->mMediaSource->pluginSupportsMediaTime() )
+	{
+		stream << std::setw( 3 ) << std::setfill( '0' );
+		stream << (int)mSelectedPanel->mMediaSource->getCurrentTime();
+		stream << " / ";
+		stream << std::setw( 3 ) << std::setfill( '0' );
+		stream << (int)mSelectedPanel->mMediaSource->getDuration();
+		stream << " @ ";
+		stream << (int)mSelectedPanel->mMediaSource->getCurrentPlayRate();
+		stream << " | ";
+	};
+
+	glutSetWindow( mBottomGLUIWindow->get_glut_window_id() );
+	mStatusText->set_text( const_cast< char*>( stream.str().c_str() ) );
+	glutSetWindow( mAppWindow );
+
+	// caching
+	cached_id = mSelectedPanel->mId;
+	cached_media_width = mSelectedPanel->mMediaWidth;
+	cached_media_height = mSelectedPanel->mMediaHeight;
+	cached_texture_width = mSelectedPanel->mTextureWidth;
+	cached_texture_height = mSelectedPanel->mTextureHeight;
+	cached_supports_browser_media = mSelectedPanel->mMediaSource->pluginSupportsMediaBrowser();
+	cached_supports_time_media = mSelectedPanel->mMediaSource->pluginSupportsMediaTime();
+	cached_plugin_version = mSelectedPanel->mMediaSource->getPluginVersion();
+	cached_movie_time = (int)mSelectedPanel->mMediaSource->getCurrentTime();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::dumpPanelInfo()
+{
+	std::cout << std::endl << "===== Media Panels =====" << std::endl;
+	for( int i = 0; i < (int)mMediaPanels.size(); ++i )
+	{
+		std::cout << std::setw( 2 ) << std::setfill( '0' );
+		std::cout << i + 1 << "> ";
+		std::cout << "Id: ";
+		std::cout << std::setw( 2 ) << std::setfill( '0' );
+		std::cout << mMediaPanels[ i ]->mId;
+		std::cout << " | ";
+		std::cout << "Media: ";
+		std::cout << std::setw( 3 ) << std::setfill( '0' );
+		std::cout << mMediaPanels[ i ]->mMediaWidth;
+		std::cout << " x ";
+		std::cout << std::setw( 3 ) << std::setfill( '0' );
+		std::cout << mMediaPanels[ i ]->mMediaHeight;
+		std::cout << " | ";
+		std::cout << "Texture: ";
+		std::cout << std::setw( 4 ) << std::setfill( '0' );
+		std::cout << mMediaPanels[ i ]->mTextureWidth;
+		std::cout << " x ";
+		std::cout << std::setw( 4 ) << std::setfill( '0' );
+		std::cout << mMediaPanels[ i ]->mTextureHeight;
+		std::cout << " | ";
+		if ( mMediaPanels[ i ] == mSelectedPanel )
+			std::cout << "(selected)";
+
+		std::cout << std::endl;
+	};
+	std::cout << "========================" << std::endl;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFBConnectTest::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
+{
+	// Uncomment this to make things much, much quieter.
+//	return;
+
+	switch(event)
+	{
+		case MEDIA_EVENT_CONTENT_UPDATED:
+			// too spammy -- don't log these
+//			std::cerr <<  "Media event:  MEDIA_EVENT_CONTENT_UPDATED " << std::endl;
+		break;
+
+		case MEDIA_EVENT_TIME_DURATION_UPDATED:
+			// too spammy -- don't log these
+//			std::cerr <<  "Media event:  MEDIA_EVENT_TIME_DURATION_UPDATED, time is " << self->getCurrentTime() << " of " << self->getDuration() << std::endl;
+		break;
+
+		case MEDIA_EVENT_SIZE_CHANGED:
+			std::cerr <<  "Media event:  MEDIA_EVENT_SIZE_CHANGED " << std::endl;
+		break;
+
+		case MEDIA_EVENT_CURSOR_CHANGED:
+			std::cerr <<  "Media event:  MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << self->getCursorName() << std::endl;
+		break;
+
+		case MEDIA_EVENT_NAVIGATE_BEGIN:
+			std::cerr <<  "Media event:  MEDIA_EVENT_NAVIGATE_BEGIN " << std::endl;
+		break;
+
+		case MEDIA_EVENT_NAVIGATE_COMPLETE:
+			std::cerr <<  "Media event:  MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << std::endl;
+		break;
+
+		case MEDIA_EVENT_PROGRESS_UPDATED:
+			std::cerr <<  "Media event:  MEDIA_EVENT_PROGRESS_UPDATED, loading at " << self->getProgressPercent() << "%" << std::endl;
+		break;
+
+		case MEDIA_EVENT_STATUS_TEXT_CHANGED:
+			std::cerr <<  "Media event:  MEDIA_EVENT_STATUS_TEXT_CHANGED, new status text is: " << self->getStatusText() << std::endl;
+		break;
+
+		case MEDIA_EVENT_NAME_CHANGED:
+			std::cerr <<  "Media event:  MEDIA_EVENT_NAME_CHANGED, new name is: " << self->getMediaName() << std::endl;
+			glutSetWindowTitle( self->getMediaName().c_str() );
+		break;
+
+		case MEDIA_EVENT_LOCATION_CHANGED:
+		{
+			std::cerr <<  "Media event:  MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << std::endl;
+			mediaPanel* panel = findMediaPanel(self);
+			if(panel != NULL)
+			{
+				panel->mStartUrl = self->getLocation();
+				if(panel == mSelectedPanel)
+				{
+					mUrlEdit->set_text(const_cast<char*>(panel->mStartUrl.c_str()) );
+				}
+			}
+		}
+		break;
+
+		case MEDIA_EVENT_NAVIGATE_ERROR_PAGE:
+			std::cerr <<  "Media event:  MEDIA_EVENT_NAVIGATE_ERROR_PAGE, uri is: " << self->getClickURL() << std::endl;
+		break;
+			
+		case MEDIA_EVENT_CLICK_LINK_HREF:
+		{
+			std::cerr <<  "Media event:  MEDIA_EVENT_CLICK_LINK_HREF, uri is " << self->getClickURL() << ", target is " << self->getClickTarget() << std::endl;
+			// retrieve the event parameters
+			std::string url = self->getClickURL();
+			std::string target = self->getClickTarget();
+			
+			if(target == "_external")
+			{
+				// this should open in an external browser, but since this is a test app we don't care.
+			}
+			else if(target == "_blank")
+			{
+				// Create a new panel with the specified URL.
+				addMediaPanel(url);
+			}
+			else // other named target
+			{
+				mediaPanel *target_panel = findMediaPanel(target);
+				if(target_panel)
+				{
+					target_panel = replaceMediaPanel(target_panel, url);
+				}
+				else
+				{
+					target_panel = addMediaPanel(url);
+				}
+
+				if(target_panel)
+				{
+					target_panel->mTarget = target;
+				}
+			}
+		}
+		break;
+
+		case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
+			std::cerr <<  "Media event:  MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is " << self->getClickURL() << std::endl;
+		break;
+
+		case MEDIA_EVENT_PLUGIN_FAILED:
+			std::cerr <<  "Media event:  MEDIA_EVENT_PLUGIN_FAILED" << std::endl;
+		break;
+
+		case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
+			std::cerr <<  "Media event:  MEDIA_EVENT_PLUGIN_FAILED_LAUNCH" << std::endl;
+		break;
+
+		case MEDIA_EVENT_CLOSE_REQUEST:
+			std::cerr <<  "Media event:  MEDIA_EVENT_CLOSE_REQUEST" << std::endl;
+		break;
+		
+		case MEDIA_EVENT_PICK_FILE_REQUEST:
+			std::cerr <<  "Media event:  MEDIA_EVENT_PICK_FILE_REQUEST" << std::endl;
+			// TODO: display an actual file picker
+			self->sendPickFileResponse("cake");
+		break;
+
+		case MEDIA_EVENT_GEOMETRY_CHANGE:
+			std::cerr <<  "Media event:  MEDIA_EVENT_GEOMETRY_CHANGE, uuid is " << self->getClickUUID() 
+				<< ", x = " << self->getGeometryX() 
+				<< ", y = " << self->getGeometryY() 
+				<< ", width = " << self->getGeometryWidth() 
+				<< ", height = " << self->getGeometryHeight() 
+				<< std::endl;
+		break;
+
+		case MEDIA_EVENT_AUTH_REQUEST:
+		{
+			//std::cerr <<  "Media event:  MEDIA_EVENT_AUTH_REQUEST, url " << self->getAuthURL() ", realm " << self->getAuthRealm() << std::endl;
+
+			// TODO: display an auth dialog
+			self->sendAuthResponse(false, "", "");
+		}
+		break;
+
+		case MEDIA_EVENT_LINK_HOVERED:
+		{
+			std::cerr <<  "Media event:  MEDIA_EVENT_LINK_HOVERED, hover text is: " << self->getHoverText() << std::endl;
+		}
+		break;
+
+		default:
+		{
+			std::cerr <<  "Media event:  <unknown>, code is: " << int(event) << std::endl;
+		}
+		break;
+	}
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+static void gluiCallbackWrapper( int control_id )
+{
+	if ( gApplication )
+		gApplication->gluiCallback( control_id );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutReshape( int width, int height )
+{
+	if ( gApplication )
+		gApplication->reshape( width, height );
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutDisplay()
+{
+	if ( gApplication )
+		gApplication->display();
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutIdle(int update_ms)
+{
+	GLUI_Master.set_glutTimerFunc( update_ms, glutIdle, update_ms);
+
+	if ( gApplication )
+		gApplication->idle();
+
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutKeyboard( unsigned char key, int x, int y )
+{
+	if ( gApplication )
+		gApplication->keyboard( key );
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutMousePassive( int x, int y )
+{
+	if ( gApplication )
+		gApplication->mousePassive( x, y );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutMouseMove( int x , int y )
+{
+	if ( gApplication )
+		gApplication->mouseMove( x, y );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void glutMouseButton( int button, int state, int x, int y )
+{
+	if ( gApplication )
+		gApplication->mouseButton( button, state, x, y );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+int main( int argc, char* argv[] )
+{
+#if LL_DARWIN
+	// Set the current working directory to <application bundle>/Contents/Resources/
+	CFURLRef resources_url = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
+	if(resources_url != NULL)
+	{
+		CFStringRef resources_string = CFURLCopyFileSystemPath(resources_url, kCFURLPOSIXPathStyle);
+		CFRelease(resources_url);
+		if(resources_string != NULL)
+		{
+			char buffer[PATH_MAX] = "";
+			if(CFStringGetCString(resources_string, buffer, sizeof(buffer), kCFStringEncodingUTF8))
+			{
+				chdir(buffer);
+			}
+			CFRelease(resources_string);
+		}
+	}
+#endif
+
+	glutInit( &argc, argv );
+	glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB );
+
+	const int app_window_x = 80;
+	const int app_window_y = 0;
+	const int app_window_width = 960;
+	const int app_window_height = 960;
+
+	glutInitWindowPosition( app_window_x, app_window_y );
+	glutInitWindowSize( app_window_width, app_window_height );
+
+	int app_window_handle = glutCreateWindow( "LLFBConnectTest" );
+
+	glutDisplayFunc( glutDisplay );
+
+	GLUI_Master.set_glutReshapeFunc( glutReshape );
+	GLUI_Master.set_glutKeyboardFunc( glutKeyboard );
+	GLUI_Master.set_glutMouseFunc( glutMouseButton );
+
+	glutPassiveMotionFunc( glutMousePassive );
+	glutMotionFunc( glutMouseMove );
+
+	glutSetWindow( app_window_handle );
+
+	gApplication = new LLFBConnectTest( app_window_handle, app_window_width, app_window_height );
+
+	// update at approximately 60hz
+	int update_ms = 1000 / 60;
+
+	GLUI_Master.set_glutTimerFunc( update_ms, glutIdle, update_ms);
+
+	glutMainLoop();
+
+	delete gApplication;
+}
diff --git a/indra/test_apps/llfbconnecttest/llfbconnecttest.h b/indra/test_apps/llfbconnecttest/llfbconnecttest.h
new file mode 100644
index 0000000000..6f442a55b3
--- /dev/null
+++ b/indra/test_apps/llfbconnecttest/llfbconnecttest.h
@@ -0,0 +1,207 @@
+/**
+ * @file LLFBConnectTest.cpp
+ * @brief Facebook Connect Test App
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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_FB_CONNECT_H
+#define LL_FB_CONNECT_H
+
+#include <vector>
+#include <string>
+#include "llpluginclassmedia.h"
+#include "llgl.h"
+
+// Forward declarations
+class GLUI_Rotation;
+class GLUI_Translation;
+class GLUI_Listbox;
+class GLUI_EditText;
+class GLUI_StaticText;
+class GLUI;
+class GLUI_Button;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+struct mediaPanel
+{
+	public:
+		mediaPanel();
+		~mediaPanel();
+		int mId;
+		std::string mStartUrl;
+		std::string mMimeType;
+		std::string mTarget;
+		LLPluginClassMedia *mMediaSource;
+		int mMediaWidth;
+		int mMediaHeight;
+		int mTextureWidth;
+		int mTextureHeight;
+		double mTextureScaleX;
+		double mTextureScaleY;
+		GLuint mMediaTextureHandle;
+		GLuint mPickTextureHandle;
+		unsigned char* mPickTexturePixels;
+		bool mAppTextureCoordsOpenGL;
+		bool mReadyToRender;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+class LLFBConnectTest : public LLPluginClassMediaOwner
+{
+	public:
+		LLFBConnectTest( int app_window, int window_width, int window_height );
+		~LLFBConnectTest();
+
+		void reshape( int width, int height );
+		void display();
+		void idle();
+		void gluiCallback( int control_id );
+		void keyboard( int key );
+		void mousePassive( int x, int y );
+		void mouseButton( int button, int state, int x, int y );
+		void mouseMove( int x, int y );
+
+		void bindTexture(GLuint texture, GLint row_length = 0, GLint alignment = 1);
+		bool checkGLError(const char *name = "OpenGL");
+		void drawGeometry( int panel, bool selected );
+		void startPanelHighlight( float red, float green, float blue, float line_width );
+		void endPanelHighlight();
+		enum { DrawTypePickTexture, DrawTypeMediaTexture };
+		void draw( int draw_type );
+		void windowPosToTexturePos( int window_x, int window_y, int& media_x, int& media_y, int& id );
+
+		mediaPanel* addMediaPanel( std::string url );
+		void updateMediaPanel( mediaPanel* panel );
+		void remMediaPanel( mediaPanel* panel );
+		mediaPanel* replaceMediaPanel( mediaPanel* panel, std::string url );
+		void getRandomMediaSize( int& width, int& height, std::string mime_type );
+		void navigateToNewURI( std::string uri );
+        void initUrlHistory( std::string uri );
+		void selectPanelById( int id );
+		void selectPanel( mediaPanel* panel );
+		mediaPanel* findMediaPanel( LLPluginClassMedia* panel );
+		mediaPanel* findMediaPanel( const std::string &target_name );
+		void makePickTexture( int id, GLuint* texture_handle, unsigned char** texture_pixels );
+		void makeChrome();
+		void resetView();
+
+		void dumpPanelInfo();
+		void updateStatusBar();
+
+		GLfloat distanceToCamera( GLfloat point_x, GLfloat point_y, GLfloat point_z );
+		
+
+	// Inherited from LLPluginClassMediaOwner
+	/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, LLPluginClassMediaOwner::EMediaEvent);
+
+	private:
+		const int mVersionMajor;
+		const int mVersionMinor;
+		const int mVersionPatch;
+		const int mMaxPanels;
+		int mAppWindow;
+		int mWindowWidth;
+		int mWindowHeight;
+		int mCurMouseX;
+		int mCurMouseY;
+		unsigned char mPixelReadColor[ 3 ];
+		bool mFuzzyMedia;
+		const std::string mHomeWebUrl;
+
+		std::vector< mediaPanel* > mMediaPanels;
+		mediaPanel* mSelectedPanel;
+		std::string mimeTypeFromUrl( std::string& url );
+		std::string pluginNameFromMimeType( std::string& mime_type );
+
+		GLUI_Rotation* mViewRotationCtrl;
+		GLUI_Translation* mViewScaleCtrl;
+		GLUI_Translation* mViewTranslationCtrl;
+		float mViewportAspect;
+		float mViewPos[ 3 ];
+		float mViewRotation[ 16 ];
+
+		float mDistanceCameraToSelectedGeometry;
+
+		int mIdControlAddPanel;
+		int mIdControlRemPanel;
+
+		std::vector< std::pair< std::string, std::string > > mBookmarks;
+		GLUI_Listbox* mBookmarkList;
+		int mIdBookmarks;
+		int mIdUrlEdit;
+		GLUI_EditText* mUrlEdit;
+        //int mIdUrlInitHistoryEdit;
+		//GLUI_EditText* mUrlInitHistoryEdit;
+		int mSelBookmark;
+		//int mIdRandomPanelCount;
+		//int mRandomPanelCount;
+		//int mIdRandomBookmarks;
+		//int mRandomBookmarks;
+		//int mIdDisableTimeout;
+		//int mDisableTimeout;
+		//int mIdUsePluginReadThread;
+		//int mUsePluginReadThread;
+		//int mIdLargePanelSpacing;
+		//int mLargePanelSpacing;
+		//int mIdControlCrashPlugin;
+		//int mIdControlHangPlugin;
+		int mIdControlExitApp;
+
+		//GLUI* mGluiMediaTimeControlWindow;
+		//int mIdMediaTimeControlPlay;
+		//int mIdMediaTimeControlLoop;
+		//int mIdMediaTimeControlPause;
+		//int mIdMediaTimeControlStop;
+		//int mIdMediaTimeControlSeek;
+		//int mIdMediaTimeControlVolume;
+		//int mMediaTimeControlVolume;
+		//int mIdMediaTimeControlSeekSeconds;
+		//int mMediaTimeControlSeekSeconds;
+		//int mIdMediaTimeControlRewind;
+		//int mIdMediaTimeControlFastForward;
+
+		GLUI* mGluiMediaBrowserControlWindow;
+		int mIdMediaBrowserControlBack;
+		GLUI_Button* mMediaBrowserControlBackButton;
+		int mIdMediaBrowserControlStop;
+		int mIdMediaBrowserControlForward;
+		GLUI_Button* mMediaBrowserControlForwardButton;
+		bool mGluiMediaTimeControlWindowFlag;
+		bool mGluiMediaBrowserControlWindowFlag;
+		bool mMediaBrowserControlBackButtonFlag;
+		bool mMediaBrowserControlForwardButtonFlag;
+		int mIdMediaBrowserControlHome;
+		int mIdMediaBrowserControlReload;
+		int mIdMediaBrowserControlClearCache;
+		int mIdMediaBrowserControlClearCookies;
+		int mIdMediaBrowserControlEnableCookies;
+		int mMediaBrowserControlEnableCookies;
+
+		GLUI* mBottomGLUIWindow;
+		GLUI_StaticText* mStatusText;
+};
+
+#endif	// LL_FB_CONNECT_H
+
-- 
cgit v1.2.3


From bf981db8b98cd9f8048a1a800d7e99907fecd1a8 Mon Sep 17 00:00:00 2001
From: Ansariel <none@none>
Date: Sat, 23 Feb 2013 00:12:08 +0100
Subject: STORM-1932: Region/Estate floater contains unlocalizable strings

---
 doc/contributions.txt                          |  1 +
 indra/newview/llfloaterregioninfo.cpp          | 18 ++++++++++--------
 indra/newview/skins/default/xui/en/strings.xml |  6 +++++-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index e86ef11a72..732dfdffa9 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -175,6 +175,7 @@ Ansariel Hiller
 	STORM-1685
 	STORM-1713
 	STORM-1899
+	STORM-1932
 Aralara Rajal
 Ardy Lay
 	STORM-859
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index fe29bb38c7..4b2ea52ad3 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1680,7 +1680,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, void* data)
 			LLSD args;
 			args["NUM_ADDED"] = llformat("%d",ids.size());
 			args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
-			args["LIST_TYPE"] = "Allowed Residents";
+			args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeAllowedAgents");
 			args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
 			LLNotificationsUtil::add("MaxAgentOnRegionBatch", args);
 			delete change_info;
@@ -1696,7 +1696,7 @@ void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, void* data)
 			LLSD args;
 			args["NUM_ADDED"] = llformat("%d",ids.size());
 			args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
-			args["LIST_TYPE"] = "Banned Residents";
+			args["LIST_TYPE"] = LLTrans::getString("RegionInfoListTypeBannedAgents");
 			args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
 			LLNotificationsUtil::add("MaxAgentOnRegionBatch", args);
 			delete change_info;
@@ -2761,9 +2761,10 @@ bool LLDispatchSetEstateAccess::operator()(
 		}
 
 
-		std::string msg = llformat("Banned residents: (%d, max %d)",
-									totalBannedAgents,
-									ESTATE_MAX_ACCESS_IDS);
+		LLStringUtil::format_map_t args;
+		args["[BANNEDAGENTS]"] = llformat("%d", totalBannedAgents);
+		args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS);
+		std::string msg = LLTrans::getString("RegionInfoBannedResidents", args);
 		panel->getChild<LLUICtrl>("ban_resident_label")->setValue(LLSD(msg));
 
 		if (banned_agent_name_list)
@@ -2783,9 +2784,10 @@ bool LLDispatchSetEstateAccess::operator()(
 
 	if (access_flags & ESTATE_ACCESS_MANAGERS)
 	{
-		std::string msg = llformat("Estate Managers: (%d, max %d)",
-									num_estate_managers,
-									ESTATE_MAX_MANAGERS);
+		LLStringUtil::format_map_t args;
+		args["[ESTATEMANAGERS]"] = llformat("%d", num_estate_managers);
+		args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS);
+		std::string msg = LLTrans::getString("RegionInfoEstateManagers", args);
 		panel->getChild<LLUICtrl>("estate_manager_label")->setValue(LLSD(msg));
 
 		LLNameListCtrl* estate_manager_name_list =
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 4383b98592..c4a3f2c5b6 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2453,7 +2453,11 @@ Drag folders to this area and click "Send to Marketplace" to list them for sale
 		all estates that you manage for [OWNER]
 	</string>
 	<string name="RegionInfoAllowedResidents">Allowed Residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string>
-	<string name="RegionInfoAllowedGroups">Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string>
+	<string name="RegionInfoAllowedGroups">Allowed Groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string>
+	<string name="RegionInfoEstateManagers">Estate Managers: ([ESTATEMANAGERS], max [MAXMANAGERS])</string>
+	<string name="RegionInfoBannedResidents">Banned Residents: ([BANNEDAGENTS], max [MAXBANNED])</string>
+	<string name="RegionInfoListTypeAllowedAgents">Allowed Residents</string>
+	<string name="RegionInfoListTypeBannedAgents">Banned Residents</string>
 
 	<!-- script limits floater -->
 	<string name="ScriptLimitsParcelScriptMemory">Parcel Script Memory</string>
-- 
cgit v1.2.3


From f3025b0ae4a2ff714cca68f69d0aa06aed925c1f Mon Sep 17 00:00:00 2001
From: Ansariel <none@none>
Date: Sat, 23 Feb 2013 02:01:07 +0100
Subject: STORM-1933: Certain show in search categories for parcels will not
 stay selected

---
 doc/contributions.txt                                     |  1 +
 indra/newview/llfloaterland.cpp                           | 10 ++++------
 indra/newview/skins/default/xui/en/floater_about_land.xml |  2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index e86ef11a72..5643710dad 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -175,6 +175,7 @@ Ansariel Hiller
 	STORM-1685
 	STORM-1713
 	STORM-1899
+	STORM-1933
 Aralara Rajal
 Ardy Lay
 	STORM-859
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index be743d57d2..9a1274bf3b 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2104,9 +2104,8 @@ void LLPanelLandOptions::refreshSearch()
 		mCheckShowDirectory->set(FALSE);
 		mCheckShowDirectory->setEnabled(FALSE);
 
-		// *TODO:Translate
-		const std::string& none_string = LLParcel::getCategoryUIString(LLParcel::C_NONE);
-		mCategoryCombo->setSimple(none_string);
+		const std::string& none_string = LLParcel::getCategoryString(LLParcel::C_NONE);
+		mCategoryCombo->setValue(none_string);
 		mCategoryCombo->setEnabled(FALSE);
 		return;
 	}
@@ -2133,10 +2132,9 @@ void LLPanelLandOptions::refreshSearch()
 	mCheckShowDirectory	->set(show_directory);
 
 	// Set by string in case the order in UI doesn't match the order by index.
-	// *TODO:Translate
 	LLParcel::ECategory cat = parcel->getCategory();
-	const std::string& category_string = LLParcel::getCategoryUIString(cat);
-	mCategoryCombo->setSimple(category_string);
+	const std::string& category_string = LLParcel::getCategoryString(cat);
+	mCategoryCombo->setValue(category_string);
 
 	std::string tooltip;
 	bool enable_show_directory = false;
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 793a6e6fa1..a660e812cc 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1365,7 +1365,7 @@ Only large parcels can be listed in search.
                 <combo_box.item
                  label="Any Category"
                  name="item0"
-                 value="any" />
+                 value="none" />
                 <combo_box.item
                  label="Linden Location"
                  name="item1"
-- 
cgit v1.2.3


From 676838ac58ca8e07f473e25055310cf70e58e8b2 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 23 Feb 2013 01:05:00 +0000
Subject: ACME-72 FIX Streamline Webkit test app for FB Connect testing Enabled
 cookies by default and set starting URL to
 https://cryptic-ridge-1632.herokuapp.com/

---
 indra/test_apps/llfbconnecttest/llfbconnecttest.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp b/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp
index 1a0c783376..483a15c468 100644
--- a/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp
+++ b/indra/test_apps/llfbconnecttest/llfbconnecttest.cpp
@@ -133,7 +133,7 @@ LLFBConnectTest::LLFBConnectTest( int app_window, int window_width, int window_h
 	mGluiMediaBrowserControlWindowFlag( true ),
 	mMediaBrowserControlBackButtonFlag( true ),
 	mMediaBrowserControlForwardButtonFlag( true ),
-	mHomeWebUrl( "http://www.facebook.com/" )
+	mHomeWebUrl( "https://cryptic-ridge-1632.herokuapp.com/" )
 {
 	// debugging spam
 	std::cout << std::endl << "             GLUT version: " << "3.7.6" << std::endl;	// no way to get real version from GLUT
@@ -1613,6 +1613,9 @@ mediaPanel* LLFBConnectTest::addMediaPanel( std::string url )
 	// make a new plugin
 	LLPluginClassMedia* media_source = new LLPluginClassMedia(this);
 
+	// enable cookies so the FB login works
+	media_source->enable_cookies(true);
+
 	// tell the plugin what size we asked for
 	media_source->setSize( media_width, media_height );
 
-- 
cgit v1.2.3


From 6cd617a60dfb4cd491da495a4e4f5c0285f95a95 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 2 Mar 2013 01:46:18 +0000
Subject: ACME-73 FIX Add a button in the viewer to show FB login page Added a
 menu item Develop > UI > FB Connect Test that pops up a browser window set to
 https://cryptic-ridge-1632.herokuapp.com/

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 18932a32d0..ac42137925 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2917,6 +2917,13 @@
              function="Advanced.WebContentTest"
              parameter="http://google.com"/>
           </menu_item_call>
+          <menu_item_call
+           label="FB Connect Test"
+           name="FB Connect Test">
+            <menu_item_call.on_click
+             function="Advanced.WebContentTest"
+             parameter="https://cryptic-ridge-1632.herokuapp.com/"/>
+          </menu_item_call>
           <menu_item_call
              label="Dump SelectMgr"
              name="Dump SelectMgr">
-- 
cgit v1.2.3


From d902534f969343611e0fdadde6e242cde842da9f Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Tue, 5 Mar 2013 11:16:03 -0500
Subject: STORM-1838 Remove redundant word in notification message

---
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index dba84b6c6b..80bc9038ed 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6540,7 +6540,7 @@ However, this region contains content accessible to adults only.
    icon="notify.tga"
    name="TeleportRequest"
    type="offer">
-[NAME_SLURL] is requesting to be teleported your to your location.
+[NAME_SLURL] is requesting to be teleported to your location.
 [MESSAGE]
 
 Offer a teleport?
-- 
cgit v1.2.3


From 57469ce55def897699364bc03580b077af91cca1 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 9 Mar 2013 01:05:01 +0000
Subject: ACME-97 FIX Create an extra FB tab in the People panel

---
 indra/newview/llpanelpeople.cpp                     |  6 ++++++
 indra/newview/skins/default/xui/en/panel_people.xml | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f1380e7a36..903574e8bd 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -72,6 +72,7 @@ static const std::string NEARBY_TAB_NAME	= "nearby_panel";
 static const std::string FRIENDS_TAB_NAME	= "friends_panel";
 static const std::string GROUP_TAB_NAME		= "groups_panel";
 static const std::string RECENT_TAB_NAME	= "recent_panel";
+static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
@@ -943,6 +944,9 @@ LLUUID LLPanelPeople::getCurrentItemID() const
 	if (cur_tab == GROUP_TAB_NAME)
 		return mGroupList->getSelectedUUID();
 
+	if (cur_tab == FBCTEST_TAB_NAME)
+		return LLUUID::null;
+
 	llassert(0 && "unknown tab selected");
 	return LLUUID::null;
 }
@@ -963,6 +967,8 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
 		mRecentList->getSelectedUUIDs(selected_uuids);
 	else if (cur_tab == GROUP_TAB_NAME)
 		mGroupList->getSelectedUUIDs(selected_uuids);
+	else if (cur_tab == FBCTEST_TAB_NAME)
+		return;
 	else
 		llassert(0 && "unknown tab selected");
 
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 98c7c49ff4..5c698c5048 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -571,6 +571,21 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
              />
             </panel>
         </panel>
+        <panel
+           background_opaque="true"
+         background_visible="true"
+           bg_alpha_color="DkGray"
+           bg_opaque_color="DkGray"
+           follows="all"
+           height="383"
+           label="FBC TEST"
+           layout="topleft"
+           left="0"
+           help_topic="people_fbctest_tab"
+           name="fbctest_panel"
+           top="0"
+           width="313">
+        </panel>
     </tab_container>
     <panel
      follows="bottom|left|right"
-- 
cgit v1.2.3


From ca74562a398d487245b112b1ea4cb5baa8ed00d3 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 9 Mar 2013 01:51:53 +0000
Subject: ACME-98 FIX Create a FB Login button in FB tab in People panel

---
 indra/newview/llpanelpeople.cpp                    |  6 +++
 indra/newview/llpanelpeople.h                      |  2 +
 .../newview/skins/default/xui/en/panel_people.xml  | 60 +++++++++++++++++++++-
 3 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 903574e8bd..85f54b06eb 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -513,6 +513,7 @@ LLPanelPeople::LLPanelPeople()
 	mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList,	this));
 	mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
 	mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
+	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
 }
 
 LLPanelPeople::~LLPanelPeople()
@@ -1561,4 +1562,9 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
+void LLPanelPeople::onLoginFbcButtonClicked()
+{
+	LLWeb::loadURLInternal("https://cryptic-ridge-1632.herokuapp.com/");
+}
+
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 46c58cd139..4df5df2574 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -112,6 +112,8 @@ private:
 	void					onNearbyViewSortMenuItemClicked(const LLSD& userdata);
 	void					onGroupsViewSortMenuItemClicked(const LLSD& userdata);
 	void					onRecentViewSortMenuItemClicked(const LLSD& userdata);
+	
+	void					onLoginFbcButtonClicked();
 
 	//returns false only if group is "none"
 	bool					isRealGroup();
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 5c698c5048..781a1d773f 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -573,7 +573,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
         </panel>
         <panel
            background_opaque="true"
-         background_visible="true"
+           background_visible="true"
            bg_alpha_color="DkGray"
            bg_opaque_color="DkGray"
            follows="all"
@@ -585,6 +585,64 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            name="fbctest_panel"
            top="0"
            width="313">
+          <avatar_list
+            allow_select="true"
+            follows="all"
+            height="356"
+            layout="topleft"
+            left="3"
+            multi_select="true"
+            name="avatar_list"
+            show_last_interaction_time="true"
+            top="0"
+            width="307" />
+          <panel
+           background_visible="true"
+           follows="left|right|bottom"
+           height="27"
+           label="bottom_panel"
+           layout="topleft"
+           left="3"
+           name="bottom_panel"
+           top_pad="0"
+           width="313">
+            <menu_button
+              follows="bottom|left"
+              tool_tip="Options"
+              height="25"
+              image_hover_unselected="Toolbar_Left_Over"
+              image_overlay="OptionsMenu_Off"
+              image_selected="Toolbar_Left_Selected"
+              image_unselected="Toolbar_Left_Off"
+              layout="topleft"
+              name="fbc_options_btn"
+              top="1"
+              width="31" />
+            <button
+               follows="bottom|left"
+               height="25"
+               image_hover_unselected="Toolbar_Middle_Over"
+               image_overlay="AddItem_Off"
+               image_selected="Toolbar_Middle_Selected"
+               image_unselected="Toolbar_Middle_Off"
+               layout="topleft"
+               left_pad="1"
+               name="fbc_login_btn"
+               tool_tip="Log in to FBC"
+               width="31">
+              <commit_callback
+                 function="People.loginFBC" />
+            </button>
+            <icon
+             follows="bottom|left|right"
+             height="25"
+             image_name="Toolbar_Right_Off"
+             layout="topleft"
+             left_pad="1"
+             name="dummy_icon"
+             width="244"
+             />
+          </panel>
         </panel>
     </tab_container>
     <panel
-- 
cgit v1.2.3


From 352138a8486623575ee015c89f3263103b30bef4 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 12 Mar 2013 00:56:51 +0100
Subject: ACME-99 FIX Populate the FB tab friends list with FB data

---
 indra/newview/llpanelpeople.cpp                    | 93 +++++++++++++++++++++-
 indra/newview/llpanelpeople.h                      |  5 ++
 .../newview/skins/default/xui/en/panel_people.xml  | 19 ++---
 3 files changed, 104 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 85f54b06eb..491b8dd7c5 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -64,9 +64,11 @@
 #include "llvoiceclient.h"
 #include "llworld.h"
 #include "llspeakers.h"
+#include "llfloaterwebcontent.h"
 
 #define FRIEND_LIST_UPDATE_TIMEOUT	0.5
 #define NEARBY_LIST_UPDATE_INTERVAL 1
+#define FBCTEST_LIST_UPDATE_INTERVAL 0.25
 
 static const std::string NEARBY_TAB_NAME	= "nearby_panel";
 static const std::string FRIENDS_TAB_NAME	= "friends_panel";
@@ -489,6 +491,45 @@ public:
 	}
 };
 
+/**
+ * Periodically updates the FBC test list after a login is initiated.
+ * 
+ * The period is defined by FBCTEST_LIST_UPDATE_INTERVAL constant.
+ */
+class LLFbcTestListUpdater : public LLAvatarListUpdater
+{
+	LOG_CLASS(LLFbcTestListUpdater);
+
+public:
+	LLFbcTestListUpdater(callback_t cb)
+	:	LLAvatarListUpdater(cb, FBCTEST_LIST_UPDATE_INTERVAL)
+	{
+		setActive(false);
+	}
+
+	/*virtual*/ void setActive(bool val)
+	{
+		if (val)
+		{
+			// update immediately and start regular updates
+			update();
+			mEventTimer.start(); 
+		}
+		else
+		{
+			// stop regular updates
+			mEventTimer.stop();
+		}
+	}
+
+	/*virtual*/ BOOL tick()
+	{
+		update();
+		return FALSE;
+	}
+private:
+};
+
 //=============================================================================
 
 LLPanelPeople::LLPanelPeople()
@@ -502,6 +543,7 @@ LLPanelPeople::LLPanelPeople()
 		mNearbyList(NULL),
 		mRecentList(NULL),
 		mGroupList(NULL),
+		mFbcTestText(NULL),
 		mNearbyGearButton(NULL),
 		mFriendsGearButton(NULL),
 		mGroupsGearButton(NULL),
@@ -511,6 +553,7 @@ LLPanelPeople::LLPanelPeople()
 	mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList,	this));
 	mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList,	this));
 	mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList,	this));
+	mFbcTestListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFbcTestList,	this));
 	mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
 	mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
@@ -522,6 +565,7 @@ LLPanelPeople::~LLPanelPeople()
 	delete mNearbyListUpdater;
 	delete mFriendListUpdater;
 	delete mRecentListUpdater;
+	delete mFbcTestListUpdater;
 
 	if(LLVoiceClient::instanceExists())
 	{
@@ -533,7 +577,7 @@ LLPanelPeople::~LLPanelPeople()
 	if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
 	if (mGroupsViewSortMenuHandle.get()) mGroupsViewSortMenuHandle.get()->die();
 	if (mRecentViewSortMenuHandle.get()) mRecentViewSortMenuHandle.get()->die();
-
+	if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die();
 }
 
 void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
@@ -598,6 +642,8 @@ BOOL LLPanelPeople::postBuild()
 	mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+	
+	mFbcTestText = getChild<LLPanel>(FBCTEST_TAB_NAME)->getChild<LLTextBox>("fbctest_label");
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
@@ -823,6 +869,40 @@ void LLPanelPeople::updateRecentList()
 	mRecentList->setDirty();
 }
 
+void LLPanelPeople::updateFbcTestList()
+{
+	if (!mFbcTestText)
+		return;
+
+	if (mFbcTestBrowserHandle.get())
+	{
+		// get the browser data (from the title bar, of course!)
+		std::string title = mFbcTestBrowserHandle.get()->getTitle();
+
+		// if the data is ready (if it says the magic word)
+		if (title.length() > 8 && title.substr(0, 8) == "FBCTEST ")
+		{
+			// get the list of friends' names from the title bar
+			std::vector<std::string> names = LLStringUtil::getTokens(title.substr(8), ",");
+			
+			// display the names in the list
+			std::string label;
+			for (std::vector<std::string>::const_iterator i = names.begin() + 1; i != names.end(); ++i)
+			{
+				label += *i;
+				label += "\n";
+			}
+			mFbcTestText->setText(label);
+
+			// close the browser window
+			mFbcTestBrowserHandle.get()->die();
+			
+			// stop updating
+			mFbcTestListUpdater->setActive(false);
+		}
+	}
+}
+
 void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible)
 {
 	// To make sure we're referencing the right widget (a child of the button bar).
@@ -1564,7 +1644,16 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	LLWeb::loadURLInternal("https://cryptic-ridge-1632.herokuapp.com/");
+	LLFloaterWebContent::Params p;
+	p.url("https://cryptic-ridge-1632.herokuapp.com/");
+	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
+
+	if (browser)
+	{
+		// start checking the browser to see if the data is available yet
+		mFbcTestBrowserHandle = browser->getHandle();
+		mFbcTestListUpdater->setActive(true);
+	}
 }
 
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 4df5df2574..010fb5ca77 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -73,6 +73,7 @@ private:
 	void					updateFriendList();
 	void					updateNearbyList();
 	void					updateRecentList();
+	void					updateFbcTestList();
 
 	bool					isItemsFreeOfFriends(const uuid_vec_t& uuids);
 
@@ -145,16 +146,20 @@ private:
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
 	LLNetMap*				mMiniMap;
+	
+	LLTextBox*				mFbcTestText;
 
 	LLHandle<LLView>		mGroupPlusMenuHandle;
 	LLHandle<LLView>		mNearbyViewSortMenuHandle;
 	LLHandle<LLView>		mFriendsViewSortMenuHandle;
 	LLHandle<LLView>		mGroupsViewSortMenuHandle;
 	LLHandle<LLView>		mRecentViewSortMenuHandle;
+	LLHandle<LLFloater>		mFbcTestBrowserHandle;
 
 	Updater*				mFriendListUpdater;
 	Updater*				mNearbyListUpdater;
 	Updater*				mRecentListUpdater;
+	Updater*				mFbcTestListUpdater;
 	Updater*				mButtonsUpdater;
 
 	LLMenuButton*			mNearbyGearButton;
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 781a1d773f..cbb6aff4ea 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -585,17 +585,14 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            name="fbctest_panel"
            top="0"
            width="313">
-          <avatar_list
-            allow_select="true"
-            follows="all"
-            height="356"
-            layout="topleft"
-            left="3"
-            multi_select="true"
-            name="avatar_list"
-            show_last_interaction_time="true"
-            top="0"
-            width="307" />
+          <text
+             follows="all"
+             height="356"
+             layout="topleft"
+             left="3"
+             name="fbctest_label"
+             top="0"
+             width="307"/>
           <panel
            background_visible="true"
            follows="left|right|bottom"
-- 
cgit v1.2.3


From 3a08b4e3889753e74b35a643b4753912cebe3c5a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 13 Mar 2013 17:35:37 -0700
Subject: Now using the FBC Test panel you can select the '+' button to view
 FBC app settings, send a FBC app invite or send a facebook message.

---
 indra/newview/llpanelpeople.cpp | 37 +++++++++++++++++++++++++++++++++++++
 indra/newview/llpanelpeople.h   |  4 ++++
 2 files changed, 41 insertions(+)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 491b8dd7c5..dfc48145dc 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -557,6 +557,8 @@ LLPanelPeople::LLPanelPeople()
 	mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
 	mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
+	mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this));
+	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
 }
 
 LLPanelPeople::~LLPanelPeople()
@@ -717,6 +719,7 @@ BOOL LLPanelPeople::postBuild()
 	mFriendsGearButton = getChild<LLMenuButton>("friends_viewsort_btn");
 	mGroupsGearButton = getChild<LLMenuButton>("groups_viewsort_btn");
 	mRecentGearButton = getChild<LLMenuButton>("recent_viewsort_btn");
+	mFBCGearButton = getChild<LLMenuButton>("fbc_options_btn");
 
 	LLMenuGL* plus_menu  = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_group_plus.xml",  gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
 	mGroupPlusMenuHandle  = plus_menu->getHandle();
@@ -749,6 +752,13 @@ BOOL LLPanelPeople::postBuild()
 		mRecentGearButton->setMenu(recent_view_sort);
 	}
 
+	LLToggleableMenu* fbc_menu  = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_gear_fbc.xml",  gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+	if(fbc_menu)
+	{
+		mFBCMenuHandle = fbc_menu->getHandle();
+		mFBCGearButton->setMenu(fbc_menu);
+	}
+
 	LLVoiceClient::getInstance()->addObserver(this);
 
 	// call this method in case some list is empty and buttons can be in inconsistent state
@@ -1656,4 +1666,31 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 }
 
+void LLPanelPeople::onFacebookAppRequestClicked()
+{
+	LLFloaterWebContent::Params p;
+	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/");
+	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
+
+	if (browser)
+	{
+		// start checking the browser to see if the data is available yet
+		mFbcTestBrowserHandle = browser->getHandle();
+		mFbcTestListUpdater->setActive(true);
+	}
+}
+
+void LLPanelPeople::onFacebookAppSendClicked()
+{
+	LLFloaterWebContent::Params p;
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/");
+	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
+
+	if (browser)
+	{
+		// start checking the browser to see if the data is available yet
+		mFbcTestBrowserHandle = browser->getHandle();
+		mFbcTestListUpdater->setActive(true);
+	}
+}
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 010fb5ca77..feb32d1f69 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -115,6 +115,8 @@ private:
 	void					onRecentViewSortMenuItemClicked(const LLSD& userdata);
 	
 	void					onLoginFbcButtonClicked();
+	void					onFacebookAppRequestClicked();
+	void					onFacebookAppSendClicked();
 
 	//returns false only if group is "none"
 	bool					isRealGroup();
@@ -154,6 +156,7 @@ private:
 	LLHandle<LLView>		mFriendsViewSortMenuHandle;
 	LLHandle<LLView>		mGroupsViewSortMenuHandle;
 	LLHandle<LLView>		mRecentViewSortMenuHandle;
+	LLHandle<LLView>		mFBCMenuHandle;
 	LLHandle<LLFloater>		mFbcTestBrowserHandle;
 
 	Updater*				mFriendListUpdater;
@@ -166,6 +169,7 @@ private:
 	LLMenuButton*			mFriendsGearButton;
 	LLMenuButton*			mGroupsGearButton;
 	LLMenuButton*			mRecentGearButton;
+	LLMenuButton*			mFBCGearButton;
 
 	std::string				mFilterSubString;
 	std::string				mFilterSubStringOrig;
-- 
cgit v1.2.3


From aec007f8bd21d2133130fc6157202101c2424a6c Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 14 Mar 2013 11:09:39 -0700
Subject: forgot to add new .xml file for the gear menu in the FBC Test panel.
 Also cleaned up the code I added.

---
 indra/newview/llpanelpeople.cpp                    | 29 ++++++++-------------
 indra/newview/llpanelpeople.h                      |  2 ++
 .../newview/skins/default/xui/en/menu_gear_fbc.xml | 30 ++++++++++++++++++++++
 3 files changed, 42 insertions(+), 19 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/menu_gear_fbc.xml

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index dfc48145dc..ab82273ccd 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1652,10 +1652,8 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
-void LLPanelPeople::onLoginFbcButtonClicked()
+void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 {
-	LLFloaterWebContent::Params p;
-	p.url("https://cryptic-ridge-1632.herokuapp.com/");
 	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
 
 	if (browser)
@@ -1666,31 +1664,24 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 }
 
+void LLPanelPeople::onLoginFbcButtonClicked()
+{
+	LLFloaterWebContent::Params p;
+	p.url("https://cryptic-ridge-1632.herokuapp.com/");
+	openFacebookWeb(p);
+}
+
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 	LLFloaterWebContent::Params p;
 	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/");
-	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
-
-	if (browser)
-	{
-		// start checking the browser to see if the data is available yet
-		mFbcTestBrowserHandle = browser->getHandle();
-		mFbcTestListUpdater->setActive(true);
-	}
+	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
 	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/");
-	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
-
-	if (browser)
-	{
-		// start checking the browser to see if the data is available yet
-		mFbcTestBrowserHandle = browser->getHandle();
-		mFbcTestListUpdater->setActive(true);
-	}
+	openFacebookWeb(p);
 }
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index feb32d1f69..39cdbc9bd7 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -30,6 +30,7 @@
 #include <llpanel.h>
 
 #include "llcallingcard.h" // for avatar tracker
+#include "llfloaterwebcontent.h"
 #include "llvoiceclient.h"
 
 class LLAvatarList;
@@ -117,6 +118,7 @@ private:
 	void					onLoginFbcButtonClicked();
 	void					onFacebookAppRequestClicked();
 	void					onFacebookAppSendClicked();
+	void					openFacebookWeb(LLFloaterWebContent::Params& p);
 
 	//returns false only if group is "none"
 	bool					isRealGroup();
diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
new file mode 100644
index 0000000000..b05ba46107
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<toggleable_menu 
+     name="menu_group_plus"
+     left="0" bottom="0" visible="false"
+     mouse_opaque="false">
+  <menu_item_check
+   label="Facebook App Settings"
+   layout="topleft"
+   name="Facebook App Settings">
+      <menu_item_check.on_click
+       function="Advanced.WebContentTest"
+       parameter="http://www.facebook.com/settings?tab=applications" />
+  </menu_item_check>
+  <menu_item_check
+   label="Facebook App Request"
+   layout="topleft"
+   name="Facebook App Request">
+    <menu_item_check.on_click
+     function="People.requestFBC"
+     parameter="http://www.facebook.com/settings?tab=applications" />
+  </menu_item_check>
+  <menu_item_check
+   label="Facebook App Send"
+   layout="topleft"
+   name="Facebook App Send">
+    <menu_item_check.on_click
+     function="People.sendFBC"
+     parameter="http://www.facebook.com/settings?tab=applications" />
+  </menu_item_check>  
+</toggleable_menu>
\ No newline at end of file
-- 
cgit v1.2.3


From ecbcef1224899d7f61860289fc079aae284a3360 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 29 Mar 2013 01:42:50 +0100
Subject: changed url to pdp15.lindenlab.com

---
 indra/newview/llpanelpeople.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ab82273ccd..10a783053b 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1667,21 +1667,21 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://cryptic-ridge-1632.herokuapp.com/");
+	p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString());
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/");
+	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://pdp15.lindenlab.com/");
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/");
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://pdp15.lindenlab.com/");
 	openFacebookWeb(p);
 }
 // EOF
-- 
cgit v1.2.3


From 67726254a7d638a61025cbff53d88378f9b0ef04 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 29 Mar 2013 21:40:23 +0100
Subject: added response to successful FBC authentication

---
 indra/newview/llpanelpeople.cpp | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 10a783053b..8f138a821a 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -78,6 +78,8 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
+static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com";
+
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
 {
@@ -890,19 +892,18 @@ void LLPanelPeople::updateFbcTestList()
 		std::string title = mFbcTestBrowserHandle.get()->getTitle();
 
 		// if the data is ready (if it says the magic word)
-		if (title.length() > 8 && title.substr(0, 8) == "FBCTEST ")
+		if (title.length() >= 2 && title[0] == ':')
 		{
-			// get the list of friends' names from the title bar
-			std::vector<std::string> names = LLStringUtil::getTokens(title.substr(8), ",");
-			
-			// display the names in the list
-			std::string label;
-			for (std::vector<std::string>::const_iterator i = names.begin() + 1; i != names.end(); ++i)
+			// success! :)
+			if (title[1] == ')')
+			{
+				mFbcTestText->setText(std::string("okay, now we can get the list of friends!"));
+			}
+			// failure :(
+			else if (title[1] == '(')
 			{
-				label += *i;
-				label += "\n";
+				mFbcTestText->setText(std::string("hmm, the authentication failed somehow"));
 			}
-			mFbcTestText->setText(label);
 
 			// close the browser window
 			mFbcTestBrowserHandle.get()->die();
@@ -1667,21 +1668,21 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString());
+	p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://pdp15.lindenlab.com/");
+	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL);
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://pdp15.lindenlab.com/");
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=" + FBC_SERVICES_URL);
 	openFacebookWeb(p);
 }
 // EOF
-- 
cgit v1.2.3


From 11aed44bab1da46e0fadb458464e3cfd7ea2be43 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 29 Mar 2013 15:28:41 -0700
Subject: Using curl to access pdp with the has-acces-token API and then upon
 receipt will open the webview when no token exists for the user.

---
 indra/newview/llpanelpeople.cpp | 42 ++++++++++++++++++++++++++++++++++++++---
 indra/newview/llpanelpeople.h   |  2 +-
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 10a783053b..e229fd3cf3 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1664,11 +1664,47 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 	}
 }
 
+class LLFacebookLogin : public LLHTTPClient::Responder
+{
+public:
+
+	LLPanelPeople * mPanelPeople;
+
+	LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+
+	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		// in case of invalid characters, the avatar picker returns a 400
+		// just set it to process so it displays 'not found'
+		if (isGoodStatus(status) || status == 400)
+		{
+			llinfos << content << llendl;
+
+			bool has_token = content["has_access_token"].asBoolean();
+			
+			//use the token to pull down graph data
+			if(has_token)
+			{
+				
+			}
+			//request user to login
+			else
+			{
+				LLFloaterWebContent::Params p;
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString());
+				mPanelPeople->openFacebookWeb(p);
+			}
+		}
+		else
+		{
+			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
+		}
+	}
+};
+
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString());
-	openFacebookWeb(p);
+	LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this));
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 39cdbc9bd7..dadd273603 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -55,6 +55,7 @@ public:
 	// Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
 	// when voice is available
 	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
+	void openFacebookWeb(LLFloaterWebContent::Params& p);
 
 	// internals
 	class Updater;
@@ -118,7 +119,6 @@ private:
 	void					onLoginFbcButtonClicked();
 	void					onFacebookAppRequestClicked();
 	void					onFacebookAppSendClicked();
-	void					openFacebookWeb(LLFloaterWebContent::Params& p);
 
 	//returns false only if group is "none"
 	bool					isRealGroup();
-- 
cgit v1.2.3


From 4fe3e00aad663d1afd35007b4e8093ae4e58e92e Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 2 Apr 2013 02:10:04 +0100
Subject: added request to /get-friends/ after FB login

---
 indra/newview/llpanelpeople.cpp | 67 +++++++++++++++++++++++++++++++++++------
 indra/newview/llpanelpeople.h   |  3 ++
 2 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 01d68cb9a0..87bede76bc 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -896,8 +896,11 @@ void LLPanelPeople::updateFbcTestList()
 		{
 			// success! :)
 			if (title[1] == ')')
-		{
+			{
 				mFbcTestText->setText(std::string("okay, now we can get the list of friends!"));
+
+				// get the friends
+				getFacebookFriends();
 			}
 			// failure :(
 			else if (title[1] == '(')
@@ -1665,13 +1668,28 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 	}
 }
 
-class LLFacebookLogin : public LLHTTPClient::Responder
+void LLPanelPeople::showFacebookFriends(const LLSD& friends)
+{
+	std::string text = "Facebook Friends";
+	for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
+	{
+		std::string name = (*i)["name"].asString();
+		std::string id = (*i)["id"].asString();
+
+		text += "\n" + name + " (" + id + ")";
+	}
+
+	// display the facebook friend data on the test text box
+	mFbcTestText->setText(text);
+}
+
+class FacebookLoginResponder : public LLHTTPClient::Responder
 {
 public:
 
 	LLPanelPeople * mPanelPeople;
 
-	LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+	FacebookLoginResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
 
 	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
@@ -1686,15 +1704,41 @@ public:
 			//use the token to pull down graph data
 			if(has_token)
 			{
-				
+				mPanelPeople->getFacebookFriends();
 			}
 			//request user to login
 			else
 			{
-	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
+				LLFloaterWebContent::Params p;
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
 				mPanelPeople->openFacebookWeb(p);
-}
+			}
+		}
+		else
+		{
+			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
+		}
+	}
+};
+
+class FacebookFriendsResponder : public LLHTTPClient::Responder
+{
+public:
+
+	LLPanelPeople * mPanelPeople;
+
+	FacebookFriendsResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+
+	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		// in case of invalid characters, the avatar picker returns a 400
+		// just set it to process so it displays 'not found'
+		if (isGoodStatus(status) || status == 400)
+		{
+			llinfos << content << llendl;
+
+			// display the friend data
+			mPanelPeople->showFacebookFriends(content["friends"]);
 		}
 		else
 		{
@@ -1703,9 +1747,14 @@ public:
 	}
 };
 
+void LLPanelPeople::getFacebookFriends()
+{
+	LLHTTPClient::get(FBC_SERVICES_URL + "/get-friends/" + gAgentID.asString(), new FacebookFriendsResponder(this));
+}
+
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this));
+	LLHTTPClient::get(FBC_SERVICES_URL + "/has-access-token/" + gAgentID.asString(), new FacebookLoginResponder(this));
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
@@ -1718,7 +1767,7 @@ void LLPanelPeople::onFacebookAppRequestClicked()
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=" + FBC_SERVICES_URL);
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL);
 	openFacebookWeb(p);
 }
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index dadd273603..86bcac3ede 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -55,7 +55,10 @@ public:
 	// Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
 	// when voice is available
 	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
+
 	void openFacebookWeb(LLFloaterWebContent::Params& p);
+	void showFacebookFriends(const LLSD& friends);
+	void getFacebookFriends();
 
 	// internals
 	class Updater;
-- 
cgit v1.2.3


From 0a4ab0c64790b82edba369891a1983cd4b7f84f2 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 1 Apr 2013 23:08:16 -0700
Subject: Some not so clean code to use to show facebook friends using the
 existing avatar list.

---
 indra/newview/llavatarlist.cpp                     | 36 +++++++++++++++++++++
 indra/newview/llavatarlist.h                       | 27 +++++++++++++---
 indra/newview/llpanelpeople.cpp                    | 37 ++++------------------
 indra/newview/llpanelpeople.h                      |  2 ++
 .../newview/skins/default/xui/en/panel_people.xml  | 36 +++++++++++++++++----
 5 files changed, 96 insertions(+), 42 deletions(-)

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 771419f60a..37de2d5793 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -624,3 +624,39 @@ void LLAvalineListItem::setName(const std::string& name)
 		LLAvatarListItem::setAvatarToolTip(formatted_phone);
 	}
 }
+
+/************************************************************************/
+/*             class LLAvatarListSocial                                  */
+/************************************************************************/
+
+static LLDefaultChildRegistry::Register<LLAvatarListSocial> s("avatar_list_social");
+
+LLAvatarListSocial::LLAvatarListSocial(const Params& p) : LLAvatarList(p)
+{
+
+}
+
+void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
+{
+	LLAvatarListItem* item = new LLAvatarListItem();
+	// This sets the name as a side effect
+	item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false);
+	item->setAvatarName(name);
+	item->setOnline(mIgnoreOnlineStatus ? true : is_online);
+	item->showLastInteractionTime(mShowLastInteractionTime);
+
+	item->setAvatarIconVisible(mShowIcons);
+	item->setShowInfoBtn(mShowInfoBtn);
+	item->setShowProfileBtn(mShowProfileBtn);
+	item->showSpeakingIndicator(mShowSpeakingIndicator);
+	item->setShowPermissions(mShowPermissions);
+
+	item->setDoubleClickCallback(boost::bind(&LLAvatarListSocial::onItemDoubleClicked, this, _1, _2, _3, _4));
+
+	addItem(item, id, pos);
+}
+
+void LLAvatarListSocial::refresh()
+{
+	
+}
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index 4814a88a79..cbe5956493 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -97,10 +97,12 @@ public:
 	void addAvalineItem(const LLUUID& item_id, const LLUUID& session_id, const std::string& item_name);
 	void handleDisplayNamesOptionChanged();
 
-protected:
-	void refresh();
+	
 
-	void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM);
+protected:
+	virtual void refresh();
+	virtual void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM);
+	
 	void computeDifference(
 		const uuid_vec_t& vnew,
 		uuid_vec_t& vadded,
@@ -110,8 +112,6 @@ protected:
 	void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask);
 	void updateAvatarNames();
 
-private:
-
 	bool isAvalineItemSelected();
 
 	bool mIgnoreOnlineStatus;
@@ -205,4 +205,21 @@ private:
 	bool mIsHideNumber;
 };
 
+class LLAvatarListSocial : public LLAvatarList
+{
+	public:
+	struct Params : public LLInitParam::Block<Params, LLAvatarList::Params>
+	{
+
+	};
+
+	LLAvatarListSocial(const Params&);
+
+	void addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM);
+
+	protected:
+	/*virtual*/ void refresh();
+};
+
+
 #endif // LL_LLAVATARLIST_H
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 01d68cb9a0..7a3e6abb7f 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -647,7 +647,9 @@ BOOL LLPanelPeople::postBuild()
 	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	
-	mFbcTestText = getChild<LLPanel>(FBCTEST_TAB_NAME)->getChild<LLTextBox>("fbctest_label");
+	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
+	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2));
+	mFacebookFriends = social_tab->getChild<LLAvatarListSocial>("facebook_friends");
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
@@ -883,35 +885,10 @@ void LLPanelPeople::updateRecentList()
 
 void LLPanelPeople::updateFbcTestList()
 {
-	if (!mFbcTestText)
-		return;
-
-	if (mFbcTestBrowserHandle.get())
-	{
-		// get the browser data (from the title bar, of course!)
-		std::string title = mFbcTestBrowserHandle.get()->getTitle();
-
-		// if the data is ready (if it says the magic word)
-		if (title.length() >= 2 && title[0] == ':')
-		{
-			// success! :)
-			if (title[1] == ')')
-		{
-				mFbcTestText->setText(std::string("okay, now we can get the list of friends!"));
-			}
-			// failure :(
-			else if (title[1] == '(')
-			{
-				mFbcTestText->setText(std::string("hmm, the authentication failed somehow"));
-			}
-
-			// close the browser window
-			mFbcTestBrowserHandle.get()->die();
-			
-			// stop updating
-			mFbcTestListUpdater->setActive(false);
-		}
-	}
+	mFacebookFriends->addSocialItem(LLUUID(), "TEST", false);
+	
+	// stop updating
+	mFbcTestListUpdater->setActive(false);
 }
 
 void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible)
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index dadd273603..a00b5be516 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -34,6 +34,7 @@
 #include "llvoiceclient.h"
 
 class LLAvatarList;
+class LLAvatarListSocial;
 class LLAvatarName;
 class LLFilterEditor;
 class LLGroupList;
@@ -149,6 +150,7 @@ private:
 	LLAvatarList*			mNearbyList;
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
+	LLAvatarListSocial*		mFacebookFriends;
 	LLNetMap*				mMiniMap;
 	
 	LLTextBox*				mFbcTestText;
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index cbb6aff4ea..f3334fd767 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -585,14 +585,36 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            name="fbctest_panel"
            top="0"
            width="313">
-          <text
-             follows="all"
-             height="356"
+          <accordion
+                    background_visible="true"
+                    bg_alpha_color="DkGray2"
+                    bg_opaque_color="DkGray2"
+                      follows="all"
+                      height="356"
+                      layout="topleft"
+                      left="3"
+                      name="friends_accordion"
+                      top="0"
+                      width="307">
+            <accordion_tab
              layout="topleft"
-             left="3"
-             name="fbctest_label"
-             top="0"
-             width="307"/>
+             height="172"
+             min_height="150"
+             name="tab_facebook"
+             title="Facebook Friends">
+              <avatar_list_social
+               allow_select="true"
+               follows="all"
+               height="172"
+               layout="topleft"
+               left="0"
+               multi_select="true"
+               name="facebook_friends"
+               show_permissions_granted="true"
+               top="0"
+               width="307" />
+            </accordion_tab>
+          </accordion>
           <panel
            background_visible="true"
            follows="left|right|bottom"
-- 
cgit v1.2.3


From 2c183a805d9eb5fcea03d67bfc1ad26ab4c09a8d Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 1 Apr 2013 23:48:51 -0700
Subject: removing the facebook test label which appends friends names. Now
 using the avatar list widgit.

---
 indra/newview/llpanelpeople.cpp | 15 +++------------
 indra/newview/llpanelpeople.h   |  2 --
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 05dcdd97fa..c7e10d67db 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -545,7 +545,6 @@ LLPanelPeople::LLPanelPeople()
 		mNearbyList(NULL),
 		mRecentList(NULL),
 		mGroupList(NULL),
-		mFbcTestText(NULL),
 		mNearbyGearButton(NULL),
 		mFriendsGearButton(NULL),
 		mGroupsGearButton(NULL),
@@ -648,7 +647,6 @@ BOOL LLPanelPeople::postBuild()
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	
 	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
-	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2));
 	mFacebookFriends = social_tab->getChild<LLAvatarListSocial>("facebook_friends");
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
@@ -885,9 +883,6 @@ void LLPanelPeople::updateRecentList()
 
 void LLPanelPeople::updateFbcTestList()
 {
-	if (!mFbcTestText)
-		return;
-
 	if (mFbcTestBrowserHandle.get())
 	{
 		// get the browser data (from the title bar, of course!)
@@ -899,15 +894,13 @@ void LLPanelPeople::updateFbcTestList()
 			// success! :)
 			if (title[1] == ')')
 			{
-				mFbcTestText->setText(std::string("okay, now we can get the list of friends!"));
-
 				// get the friends
 				getFacebookFriends();
 			}
 			// failure :(
 			else if (title[1] == '(')
 			{
-				mFbcTestText->setText(std::string("hmm, the authentication failed somehow"));
+				llinfos << "authentication failed" << llendl;
 			}
 
 			// close the browser window
@@ -1678,11 +1671,9 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		std::string name = (*i)["name"].asString();
 		std::string id = (*i)["id"].asString();
 
-		text += "\n" + name + " (" + id + ")";
+		text = name + " (" + id + ")";
+		mFacebookFriends->addSocialItem(LLUUID(NULL), text, false);
 	}
-
-	// display the facebook friend data on the test text box
-	mFbcTestText->setText(text);
 }
 
 class FacebookLoginResponder : public LLHTTPClient::Responder
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index dab5d74f77..45ed7e1039 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -155,8 +155,6 @@ private:
 	LLGroupList*			mGroupList;
 	LLAvatarListSocial*		mFacebookFriends;
 	LLNetMap*				mMiniMap;
-	
-	LLTextBox*				mFbcTestText;
 
 	LLHandle<LLView>		mGroupPlusMenuHandle;
 	LLHandle<LLView>		mNearbyViewSortMenuHandle;
-- 
cgit v1.2.3


From 37b57559538aede47d46274208a6974d93caad1c Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 2 Apr 2013 21:07:46 +0100
Subject: updated to work with new /get-friends/ response format

---
 indra/newview/llavatarlist.cpp  | 10 ++++++----
 indra/newview/llpanelpeople.cpp | 34 +++++++++++++++++++++-------------
 2 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 37de2d5793..a407515621 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -626,7 +626,7 @@ void LLAvalineListItem::setName(const std::string& name)
 }
 
 /************************************************************************/
-/*             class LLAvatarListSocial                                  */
+/*             class LLAvatarListSocial                                 */
 /************************************************************************/
 
 static LLDefaultChildRegistry::Register<LLAvatarListSocial> s("avatar_list_social");
@@ -638,10 +638,12 @@ LLAvatarListSocial::LLAvatarListSocial(const Params& p) : LLAvatarList(p)
 
 void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
 {
+	LLAvatarName avatar_name;
+	bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name);
+
 	LLAvatarListItem* item = new LLAvatarListItem();
-	// This sets the name as a side effect
-	item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false);
-	item->setAvatarName(name);
+	item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect
+	item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName : name);
 	item->setOnline(mIgnoreOnlineStatus ? true : is_online);
 	item->showLastInteractionTime(mShowLastInteractionTime);
 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index c7e10d67db..183714b436 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1665,14 +1665,16 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 
 void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 {
-	std::string text = "Facebook Friends";
+	mFacebookFriends->clear();
+
 	for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
 	{
-		std::string name = (*i)["name"].asString();
-		std::string id = (*i)["id"].asString();
+		const LLSD& fb_friend = *i;
 
-		text = name + " (" + id + ")";
-		mFacebookFriends->addSocialItem(LLUUID(NULL), text, false);
+		std::string name = fb_friend["name"].asString();
+		LLUUID agent_id = fb_friend.has("agent_id") ? fb_friend["agent_id"].asUUID() : LLUUID(NULL);
+		
+		mFacebookFriends->addSocialItem(agent_id, name, false);
 	}
 }
 
@@ -1692,20 +1694,19 @@ public:
 		{
 			llinfos << content << llendl;
 
+			// use the token to pull down graph data
 			bool has_token = content["has_access_token"].asBoolean();
-			
-			//use the token to pull down graph data
-			if(has_token)
+			if (has_token)
 			{
 				mPanelPeople->getFacebookFriends();
 			}
-			//request user to login
+			// request user to login
 			else
 			{
-	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
+				LLFloaterWebContent::Params p;
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
 				mPanelPeople->openFacebookWeb(p);
-}
+			}
 		}
 		else
 		{
@@ -1731,7 +1732,14 @@ public:
 			llinfos << content << llendl;
 
 			// display the friend data
-			mPanelPeople->showFacebookFriends(content["friends"]);
+			if (content.has("friends"))
+			{
+				mPanelPeople->showFacebookFriends(content["friends"]);
+			}
+			else if (content.has("error"))
+			{
+				llinfos << "failed to get facebook friends. reason: " << content["error"] << llendl;
+			}
 		}
 		else
 		{
-- 
cgit v1.2.3


From 0c55af934d19145993c6ec0756397fa75f9a9842 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 2 Apr 2013 21:46:00 +0100
Subject: added display of FB name to SL user in FBCTEST list

---
 indra/newview/llavatarlist.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index a407515621..fb6d042807 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -643,7 +643,7 @@ void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name
 
 	LLAvatarListItem* item = new LLAvatarListItem();
 	item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect
-	item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName : name);
+	item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name);
 	item->setOnline(mIgnoreOnlineStatus ? true : is_online);
 	item->showLastInteractionTime(mShowLastInteractionTime);
 
-- 
cgit v1.2.3


From caad92499e2a2f8419e4c217c74f54cf4f2be54c Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 01:10:19 +0100
Subject: updated to account for new routes in FBC Services

---
 indra/newview/llpanelpeople.cpp | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 183714b436..d2e764df13 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1678,33 +1678,31 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 	}
 }
 
-class FacebookLoginResponder : public LLHTTPClient::Responder
+class FacebookConnectedResponder : public LLHTTPClient::Responder
 {
 public:
 
 	LLPanelPeople * mPanelPeople;
+	bool mShowLoginIfNotConnected;
 
-	FacebookLoginResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+	FacebookConnectedResponder(LLPanelPeople * panel_people, bool show_login_if_not_connected) : mPanelPeople(panel_people), mShowLoginIfNotConnected(show_login_if_not_connected) {}
 
 	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
-		// in case of invalid characters, the avatar picker returns a 400
-		// just set it to process so it displays 'not found'
-		if (isGoodStatus(status) || status == 400)
+		if (isGoodStatus(status))
 		{
 			llinfos << content << llendl;
 
-			// use the token to pull down graph data
-			bool has_token = content["has_access_token"].asBoolean();
-			if (has_token)
+			// pull down graph data if already contected
+			if (content["connected"])
 			{
 				mPanelPeople->getFacebookFriends();
 			}
-			// request user to login
-			else
+			// show the facebook login page
+			else if (mShowLoginIfNotConnected)
 			{
 				LLFloaterWebContent::Params p;
-				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString());
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect");
 				mPanelPeople->openFacebookWeb(p);
 			}
 		}
@@ -1725,9 +1723,7 @@ public:
 
 	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
-		// in case of invalid characters, the avatar picker returns a 400
-		// just set it to process so it displays 'not found'
-		if (isGoodStatus(status) || status == 400)
+		if (isGoodStatus(status))
 		{
 			llinfos << content << llendl;
 
@@ -1738,7 +1734,7 @@ public:
 			}
 			else if (content.has("error"))
 			{
-				llinfos << "failed to get facebook friends. reason: " << content["error"] << llendl;
+				llinfos << "failed to get facebook friends. reason: " << content["error"]["message"] << llendl;
 			}
 		}
 		else
@@ -1750,25 +1746,25 @@ public:
 
 void LLPanelPeople::getFacebookFriends()
 {
-	LLHTTPClient::get(FBC_SERVICES_URL + "/get-friends/" + gAgentID.asString(), new FacebookFriendsResponder(this));
+	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this));
 }
 
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	LLHTTPClient::get(FBC_SERVICES_URL + "/has-access-token/" + gAgentID.asString(), new FacebookLoginResponder(this));
+	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true));
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL);
+	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/");
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL);
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/");
 	openFacebookWeb(p);
 }
 // EOF
-- 
cgit v1.2.3


From 21e8d2ca30842422eb5eef469c9e1bb91c0c847b Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 02:11:11 +0100
Subject: updated to use POST for connect and disconnect, instead of Webkit

---
 indra/newview/llpanelpeople.cpp | 132 ++++++++++++++++++++++++++++++++--------
 indra/newview/llpanelpeople.h   |   7 ++-
 2 files changed, 112 insertions(+), 27 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index d2e764df13..ebf7002fc1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -536,6 +536,7 @@ private:
 
 LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
+		mConnectedToFbc(false),
 		mFilterSubString(LLStringUtil::null),
 		mFilterSubStringOrig(LLStringUtil::null),
 		mFilterEditor(NULL),
@@ -885,23 +886,17 @@ void LLPanelPeople::updateFbcTestList()
 {
 	if (mFbcTestBrowserHandle.get())
 	{
-		// get the browser data (from the title bar, of course!)
-		std::string title = mFbcTestBrowserHandle.get()->getTitle();
+		// get the current browser url (from the title bar, of course!)
+		std::string url = mFbcTestBrowserHandle.get()->getTitle();
 
-		// if the data is ready (if it says the magic word)
-		if (title.length() >= 2 && title[0] == ':')
+		// if the browser has redirected from facebook
+		if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL)
 		{
-			// success! :)
-			if (title[1] == ')')
-			{
-				// get the friends
-				getFacebookFriends();
-			}
-			// failure :(
-			else if (title[1] == '(')
-			{
-				llinfos << "authentication failed" << llendl;
-			}
+			// get the auth code
+			std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6);
+			
+			// finish authenticating on the server
+			connectToFacebook(auth_code);
 
 			// close the browser window
 			mFbcTestBrowserHandle.get()->die();
@@ -1669,15 +1664,82 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 
 	for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
 	{
-		const LLSD& fb_friend = *i;
-
-		std::string name = fb_friend["name"].asString();
-		LLUUID agent_id = fb_friend.has("agent_id") ? fb_friend["agent_id"].asUUID() : LLUUID(NULL);
+		std::string name = (*i)["name"].asString();
+		LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL);
 		
 		mFacebookFriends->addSocialItem(agent_id, name, false);
 	}
 }
 
+void LLPanelPeople::hideFacebookFriends()
+{
+	mFacebookFriends->clear();
+}
+
+class FacebookConnectResponder : public LLHTTPClient::Responder
+{
+public:
+
+	LLPanelPeople * mPanelPeople;
+
+	FacebookConnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+
+	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			llinfos << content << llendl;
+			
+			// grab some graph data now that we are connected
+			if (content["success"])
+			{
+				mPanelPeople->mConnectedToFbc = true;
+				mPanelPeople->loadFacebookFriends();
+			}
+			else if (content.has("error"))
+			{
+				llinfos << "failed to connect. reason: " << content["error"]["message"] << llendl;
+			}
+		}
+		else
+		{
+			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
+		}
+	}
+};
+
+class FacebookDisconnectResponder : public LLHTTPClient::Responder
+{
+public:
+
+	LLPanelPeople * mPanelPeople;
+
+	FacebookDisconnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
+
+	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			llinfos << content << llendl;
+			
+			// hide all the facebook stuff
+			if (content["success"])
+			{
+				mPanelPeople->mConnectedToFbc = false;
+				mPanelPeople->hideFacebookFriends();
+			}
+			else if (content.has("error"))
+			{
+				llinfos << "failed to disconnect. reason: " << content["error"]["message"] << llendl;
+			}
+		}
+		else
+		{
+			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
+		}
+	}
+};
+
 class FacebookConnectedResponder : public LLHTTPClient::Responder
 {
 public:
@@ -1693,16 +1755,17 @@ public:
 		{
 			llinfos << content << llendl;
 
-			// pull down graph data if already contected
+			// grab some graph data if already connected
 			if (content["connected"])
 			{
-				mPanelPeople->getFacebookFriends();
+				mPanelPeople->mConnectedToFbc = true;
+				mPanelPeople->loadFacebookFriends();
 			}
-			// show the facebook login page
+			// show the facebook login page if not connected yet
 			else if (mShowLoginIfNotConnected)
 			{
 				LLFloaterWebContent::Params p;
-				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect");
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL);
 				mPanelPeople->openFacebookWeb(p);
 			}
 		}
@@ -1727,7 +1790,7 @@ public:
 		{
 			llinfos << content << llendl;
 
-			// display the friend data
+			// display the list of friends
 			if (content.has("friends"))
 			{
 				mPanelPeople->showFacebookFriends(content["friends"]);
@@ -1744,14 +1807,31 @@ public:
 	}
 };
 
-void LLPanelPeople::getFacebookFriends()
+void LLPanelPeople::loadFacebookFriends()
 {
 	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this));
 }
 
+void LLPanelPeople::connectToFacebook(const std::string& auth_code)
+{
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this));
+}
+
+void LLPanelPeople::disconnectFromFacebook()
+{
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", LLSD(), new FacebookDisconnectResponder(this));
+}
+
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true));
+	if (mConnectedToFbc)
+	{
+		disconnectFromFacebook();
+	}
+	else
+	{
+		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true));
+	}
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 45ed7e1039..914899ca6d 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -59,7 +59,12 @@ public:
 
 	void openFacebookWeb(LLFloaterWebContent::Params& p);
 	void showFacebookFriends(const LLSD& friends);
-	void getFacebookFriends();
+	void hideFacebookFriends();
+	void loadFacebookFriends();
+	void connectToFacebook(const std::string& auth_code);
+	void disconnectFromFacebook();
+	
+	bool mConnectedToFbc;
 
 	// internals
 	class Updater;
-- 
cgit v1.2.3


From 207db356c21246ca9eb1b255b71623b0a5a4d470 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 03:06:24 +0100
Subject: got it working

---
 indra/newview/llpanelpeople.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ebf7002fc1..4b4dd27bf2 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -893,7 +893,10 @@ void LLPanelPeople::updateFbcTestList()
 		if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL)
 		{
 			// get the auth code
-			std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6);
+			std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7);
+			auth_code = auth_code.substr(0, auth_code.length() - 4);
+
+			llinfos << "extracted code " << auth_code << " from url " << url << llendl;
 			
 			// finish authenticating on the server
 			connectToFacebook(auth_code);
@@ -1765,7 +1768,7 @@ public:
 			else if (mShowLoginIfNotConnected)
 			{
 				LLFloaterWebContent::Params p;
-				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL);
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/");
 				mPanelPeople->openFacebookWeb(p);
 			}
 		}
@@ -1814,6 +1817,7 @@ void LLPanelPeople::loadFacebookFriends()
 
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
+	llinfos << "attempting to connect to facebook with code " << auth_code << llendl;
 	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this));
 }
 
@@ -1837,14 +1841,14 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/");
+	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL);
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/");
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL);
 	openFacebookWeb(p);
 }
 // EOF
-- 
cgit v1.2.3


From ae4dcb2d1cade521f4cb116e3b7aa79475c38cc6 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 2 Apr 2013 19:34:44 -0700
Subject: created LLSocialList and LLSocialListItem and linked them up to the
 facebook tab.

---
 indra/newview/CMakeLists.txt                       |   2 +
 indra/newview/llpanelpeople.cpp                    |   5 +-
 indra/newview/llpanelpeople.h                      |   3 +-
 indra/newview/llsociallist.cpp                     | 130 +++++++++++++++++++++
 indra/newview/llsociallist.h                       |  98 ++++++++++++++++
 .../newview/skins/default/xui/en/panel_people.xml  |   2 +-
 6 files changed, 236 insertions(+), 4 deletions(-)
 create mode 100644 indra/newview/llsociallist.cpp
 create mode 100644 indra/newview/llsociallist.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index dff2c04fbc..b303ff3d18 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -483,6 +483,7 @@ set(viewer_SOURCE_FILES
     llsidetraypanelcontainer.cpp
     llsky.cpp
     llslurl.cpp
+    llsociallist.cpp
     llspatialpartition.cpp
     llspeakers.cpp
     llspeakingindicatormanager.cpp
@@ -1050,6 +1051,7 @@ set(viewer_HEADER_FILES
     llsidetraypanelcontainer.h
     llsky.h
     llslurl.h
+    llsociallist.h
     llspatialpartition.h
     llspeakers.h
     llspeakingindicatormanager.h
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4b4dd27bf2..cbc5eba65f 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -63,6 +63,7 @@
 #include "llviewermenu.h"			// for gMenuHolder
 #include "llvoiceclient.h"
 #include "llworld.h"
+#include "llsociallist.h"
 #include "llspeakers.h"
 #include "llfloaterwebcontent.h"
 
@@ -648,7 +649,7 @@ BOOL LLPanelPeople::postBuild()
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
 	
 	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
-	mFacebookFriends = social_tab->getChild<LLAvatarListSocial>("facebook_friends");
+	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
@@ -1670,7 +1671,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		std::string name = (*i)["name"].asString();
 		LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL);
 		
-		mFacebookFriends->addSocialItem(agent_id, name, false);
+		mFacebookFriends->addNewItem(agent_id, name, false);
 	}
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 914899ca6d..d61eb80f57 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -38,6 +38,7 @@ class LLAvatarListSocial;
 class LLAvatarName;
 class LLFilterEditor;
 class LLGroupList;
+class LLSocialList;
 class LLMenuButton;
 class LLTabContainer;
 
@@ -158,7 +159,7 @@ private:
 	LLAvatarList*			mNearbyList;
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
-	LLAvatarListSocial*		mFacebookFriends;
+	LLSocialList*			mFacebookFriends;
 	LLNetMap*				mMiniMap;
 
 	LLHandle<LLView>		mGroupPlusMenuHandle;
diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp
new file mode 100644
index 0000000000..3d1d256149
--- /dev/null
+++ b/indra/newview/llsociallist.cpp
@@ -0,0 +1,130 @@
+sDestroyImmediate
+/** 
+* @file llsociallist.cpp
+* @brief Implementation of llsociallist
+* @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 "llsociallist.h"
+
+#include "llavatariconctrl.h"
+#include "lloutputmonitorctrl.h"
+#include "lltextutil.h"
+    
+static LLDefaultChildRegistry::Register<LLSocialList> r("social_list");
+
+LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p)
+{
+
+}
+
+LLSocialList::~LLSocialList()
+{
+
+}
+
+void LLSocialList::draw()
+{
+	LLFlatListView::draw();
+}
+
+void LLSocialList::refresh()
+{
+
+}
+
+void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
+{
+	LLSocialListItem * item = new LLSocialListItem();
+	item->setName(name, mNameFilter);
+	addItem(item, id, pos);
+}
+
+LLSocialListItem::LLSocialListItem()
+{
+	buildFromFile("panel_avatar_list_item.xml");
+}
+
+LLSocialListItem::~LLSocialListItem()
+{
+
+}
+
+BOOL LLSocialListItem::postBuild()
+{
+	mIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
+	mLabelTextBox = getChild<LLTextBox>("avatar_name");
+
+	mLastInteractionTime = getChild<LLTextBox>("last_interaction");
+	mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon");
+	mIconPermissionMap = getChild<LLIconCtrl>("permission_map_icon");
+	mIconPermissionEditMine = getChild<LLIconCtrl>("permission_edit_mine_icon");
+	mIconPermissionEditTheirs = getChild<LLIconCtrl>("permission_edit_theirs_icon");
+	mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
+	mInfoBtn = getChild<LLButton>("info_btn");
+	mProfileBtn = getChild<LLButton>("profile_btn");
+
+	mLastInteractionTime->setVisible(false);
+	mIconPermissionOnline->setVisible(false);
+	mIconPermissionMap->setVisible(false);
+	mIconPermissionEditMine->setVisible(false);
+	mIconPermissionEditTheirs->setVisible(false);
+	mSpeakingIndicator->setVisible(false);
+	mInfoBtn->setVisible(false);
+	mProfileBtn->setVisible(false);
+
+	return TRUE;
+}
+
+void LLSocialListItem::setName(const std::string& name, const std::string& highlight)
+{
+	mLabel = name;
+	LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight);
+}
+
+void LLSocialListItem::setValue(const LLSD& value)
+{
+	getChildView("selected_icon")->setVisible( value["selected"]);
+}
+
+void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask)
+{
+	getChildView("hovered_icon")->setVisible( true);
+	mInfoBtn->setVisible(true);
+	mProfileBtn->setVisible(true);
+
+	LLPanel::onMouseEnter(x, y, mask);
+}
+
+void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+	getChildView("hovered_icon")->setVisible( false);
+	mInfoBtn->setVisible(false);
+	mProfileBtn->setVisible(false);
+
+	LLPanel::onMouseLeave(x, y, mask);
+}
diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h
new file mode 100644
index 0000000000..884d6ebd7e
--- /dev/null
+++ b/indra/newview/llsociallist.h
@@ -0,0 +1,98 @@
+/** 
+* @file   llsociallist.h
+* @brief  Header file for llsociallist
+* @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_LLSOCIALLIST_H
+#define LL_LLSOCIALLIST_H
+
+#include "llflatlistview.h"
+#include "llstyle.h"
+
+
+/**
+ * Generic list of avatars.
+ * 
+ * Updates itself when it's dirty, using optional name filter.
+ * To initiate update, modify the UUID list and call setDirty().
+ * 
+ * @see getIDs()
+ * @see setDirty()
+ * @see setNameFilter()
+ */
+
+class LLAvatarIconCtrl;
+class LLIconCtrl;
+class LLOutputMonitorCtrl;
+
+class LLSocialList : public LLFlatListViewEx
+{
+public:
+
+	struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params>
+	{
+	};
+
+	LLSocialList(const Params&p);
+	virtual	~LLSocialList();
+
+	virtual void draw();
+	void refresh();
+	void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM);
+
+
+
+	std::string mNameFilter;
+};
+
+class LLSocialListItem : public LLPanel
+{
+	public:
+	LLSocialListItem();
+	~LLSocialListItem();
+
+	BOOL postBuild();
+	void setName(const std::string& name, const std::string& highlight = LLStringUtil::null);
+	void setValue(const LLSD& value);
+	void onMouseEnter(S32 x, S32 y, MASK mask);
+	void onMouseLeave(S32 x, S32 y, MASK mask);
+
+	LLTextBox * mLabelTextBox;
+	std::string mLabel;
+	LLStyle::Params mLabelTextBoxStyle;
+
+
+	LLAvatarIconCtrl * mIcon;
+	LLTextBox * mLastInteractionTime;
+	LLIconCtrl * mIconPermissionOnline;
+	LLIconCtrl * mIconPermissionMap;
+	LLIconCtrl * mIconPermissionEditMine;
+	LLIconCtrl * mIconPermissionEditTheirs;
+	LLOutputMonitorCtrl * mSpeakingIndicator;
+	LLButton * mInfoBtn;
+	LLButton * mProfileBtn;
+};	
+
+
+#endif // LL_LLSOCIALLIST_H
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index f3334fd767..81946ff7f9 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -602,7 +602,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
              min_height="150"
              name="tab_facebook"
              title="Facebook Friends">
-              <avatar_list_social
+              <social_list
                allow_select="true"
                follows="all"
                height="172"
-- 
cgit v1.2.3


From d9a143518f8e4c164c5a536de829c9cbd58e0e2c Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 03:55:53 +0100
Subject: got connectToFacebook working with code and redirect_uri passed as
 LLSD body in POST request

---
 indra/newview/llpanelpeople.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index cbc5eba65f..f55459afec 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -80,6 +80,7 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
 static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com";
+static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/";
 
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
@@ -1769,7 +1770,7 @@ public:
 			else if (mShowLoginIfNotConnected)
 			{
 				LLFloaterWebContent::Params p;
-				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/");
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI);
 				mPanelPeople->openFacebookWeb(p);
 			}
 		}
@@ -1818,8 +1819,10 @@ void LLPanelPeople::loadFacebookFriends()
 
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
-	llinfos << "attempting to connect to facebook with code " << auth_code << llendl;
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this));
+	LLSD body;
+	body["code"] = auth_code;
+	body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI;
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
-- 
cgit v1.2.3


From 859f7b5484df50bb45e10c8d73517205328b6b9c Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 2 Apr 2013 20:10:44 -0700
Subject: adding support for showing avatar icon and avatar name + facebook
 name into LLSocialListItem. Also the info button and profile button should
 now work

---
 indra/newview/llsociallist.cpp | 27 ++++++++++++++++++++++++++-
 indra/newview/llsociallist.h   |  4 ++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp
index 3d1d256149..2402a7c4b8 100644
--- a/indra/newview/llsociallist.cpp
+++ b/indra/newview/llsociallist.cpp
@@ -31,7 +31,10 @@ sDestroyImmediate
 
 #include "llsociallist.h"
 
+#include "llavataractions.h"
+#include "llfloaterreg.h"
 #include "llavatariconctrl.h"
+#include "llavatarnamecache.h"
 #include "lloutputmonitorctrl.h"
 #include "lltextutil.h"
     
@@ -60,7 +63,16 @@ void LLSocialList::refresh()
 void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
 {
 	LLSocialListItem * item = new LLSocialListItem();
-	item->setName(name, mNameFilter);
+	LLAvatarName avatar_name;
+	bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name);
+
+	item->mAvatarId = id;
+	if(id.notNull())
+	{
+		item->mIcon->setValue(id);
+	}
+
+	item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter);
 	addItem(item, id, pos);
 }
 
@@ -97,6 +109,9 @@ BOOL LLSocialListItem::postBuild()
 	mInfoBtn->setVisible(false);
 	mProfileBtn->setVisible(false);
 
+	mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this));
+	mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this));
+
 	return TRUE;
 }
 
@@ -128,3 +143,13 @@ void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask)
 
 	LLPanel::onMouseLeave(x, y, mask);
 }
+
+void LLSocialListItem::onInfoBtnClick()
+{
+	LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId));
+}
+
+void LLSocialListItem::onProfileBtnClick()
+{
+	LLAvatarActions::showProfile(mAvatarId);
+}
diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h
index 884d6ebd7e..bc667fc400 100644
--- a/indra/newview/llsociallist.h
+++ b/indra/newview/llsociallist.h
@@ -77,6 +77,10 @@ class LLSocialListItem : public LLPanel
 	void setValue(const LLSD& value);
 	void onMouseEnter(S32 x, S32 y, MASK mask);
 	void onMouseLeave(S32 x, S32 y, MASK mask);
+	void onInfoBtnClick();
+	void onProfileBtnClick();
+
+	LLUUID mAvatarId;
 
 	LLTextBox * mLabelTextBox;
 	std::string mLabel;
-- 
cgit v1.2.3


From 436bccf58be3e5f3dd5f990304b9aa0f8c9c66f4 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 04:11:43 +0100
Subject: made auth code extraction more robust

---
 indra/newview/llpanelpeople.cpp | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f55459afec..8fc1d378db 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -892,12 +892,24 @@ void LLPanelPeople::updateFbcTestList()
 		std::string url = mFbcTestBrowserHandle.get()->getTitle();
 
 		// if the browser has redirected from facebook
-		if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL)
+		if (url.find(FBC_SERVICES_REDIRECT_URI) == 0)
 		{
-			// get the auth code
-			std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7);
-			auth_code = auth_code.substr(0, auth_code.length() - 4);
-
+			// find the auth code in the url
+			std::string begin_string = "code=";
+			std::string end_string = "#";
+			size_t begin_index = begin_string.length() + url.find(begin_string, FBC_SERVICES_REDIRECT_URI.length());
+			size_t end_index = url.find(end_string, begin_index);
+
+			// extract the auth code from the url
+			std::string auth_code;
+			if (end_index != std::string::npos)
+			{
+				auth_code = url.substr(begin_index, end_index - begin_index);
+			}
+			else
+			{
+				auth_code = url.substr(begin_index);
+			}
 			llinfos << "extracted code " << auth_code << " from url " << url << llendl;
 			
 			// finish authenticating on the server
-- 
cgit v1.2.3


From 06d06454b25fd6b97d81076ce93b573fc53c36f9 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 04:40:11 +0100
Subject: made Facebook Friends list auto-populate

---
 indra/newview/llpanelpeople.cpp | 23 ++++++++++++++++++++++-
 indra/newview/llpanelpeople.h   |  2 ++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 8fc1d378db..6a83e84da1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -539,6 +539,7 @@ private:
 LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
 		mConnectedToFbc(false),
+		mTryToConnectToFbc(true),
 		mFilterSubString(LLStringUtil::null),
 		mFilterSubStringOrig(LLStringUtil::null),
 		mFilterEditor(NULL),
@@ -633,7 +634,7 @@ BOOL LLPanelPeople::postBuild()
 	mMiniMap = (LLNetMap*)getChildView("Net Map",true);
 	mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ? 
 		getString("AltMiniMapToolTipMsg") :	getString("MiniMapToolTipMsg"));
-
+	
 	mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
 	mRecentList->setNoItemsCommentText(getString("no_recent_people"));
 	mRecentList->setNoItemsMsg(getString("no_recent_people"));
@@ -651,6 +652,7 @@ BOOL LLPanelPeople::postBuild()
 	
 	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
 	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");
+	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2));
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
@@ -922,6 +924,17 @@ void LLPanelPeople::updateFbcTestList()
 			mFbcTestListUpdater->setActive(false);
 		}
 	}
+	else if (mTryToConnectToFbc)
+	{	
+		// try to reconnect to facebook!
+		tryToReconnectToFacebook();
+
+		// don't try again
+		mTryToConnectToFbc = false;
+		
+		// stop updating
+		mFbcTestListUpdater->setActive(false);
+	}
 }
 
 void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible)
@@ -1829,6 +1842,14 @@ void LLPanelPeople::loadFacebookFriends()
 	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this));
 }
 
+void LLPanelPeople::tryToReconnectToFacebook()
+{
+	if (!mConnectedToFbc)
+	{
+		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false));
+	}
+}
+
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
 	LLSD body;
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index d61eb80f57..2ac83c3677 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -62,10 +62,12 @@ public:
 	void showFacebookFriends(const LLSD& friends);
 	void hideFacebookFriends();
 	void loadFacebookFriends();
+	void tryToReconnectToFacebook();
 	void connectToFacebook(const std::string& auth_code);
 	void disconnectFromFacebook();
 	
 	bool mConnectedToFbc;
+	bool mTryToConnectToFbc;
 
 	// internals
 	class Updater;
-- 
cgit v1.2.3


From a8e89fbb46730ca51241f4f0b51d06210e2cf347 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Apr 2013 23:55:25 +0100
Subject: changed FBC Services redirect_uri for testing

---
 indra/newview/llpanelpeople.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 6a83e84da1..93e8411eb7 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -80,7 +80,7 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
 static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com";
-static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/";
+static const std::string FBC_SERVICES_REDIRECT_URI = "http://axcho.com/secondlife/";
 
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
-- 
cgit v1.2.3


From 819bbce34a2f265287df1e4e9adde90b5a70c8b6 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 4 Apr 2013 00:04:52 +0100
Subject: made FB+SL friends show up as <fb_name> (<sl_name)

---
 indra/newview/llavatarlist.cpp | 2 +-
 indra/newview/llsociallist.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index fb6d042807..59cea91b39 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -643,7 +643,7 @@ void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name
 
 	LLAvatarListItem* item = new LLAvatarListItem();
 	item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect
-	item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name);
+	item->setAvatarName(has_avatar_name ? name + " (" + avatar_name.mDisplayName + ")" : name);
 	item->setOnline(mIgnoreOnlineStatus ? true : is_online);
 	item->showLastInteractionTime(mShowLastInteractionTime);
 
diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp
index 2402a7c4b8..6cf0851fd7 100644
--- a/indra/newview/llsociallist.cpp
+++ b/indra/newview/llsociallist.cpp
@@ -72,7 +72,7 @@ void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
 		item->mIcon->setValue(id);
 	}
 
-	item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter);
+	item->setName(has_avatar_name ? name + " (" + avatar_name.mDisplayName + ")" : name, mNameFilter);
 	addItem(item, id, pos);
 }
 
-- 
cgit v1.2.3


From 10dba6b20148868ab630e53ac9aec67d2ed01cc1 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 5 Apr 2013 03:15:35 +0100
Subject: changed routes according to Kelly's and Enkidu's advice

---
 indra/newview/llpanelpeople.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2ca22a1382..4bcd146ad2 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1741,7 +1741,7 @@ void LLPanelPeople::tryToReconnectToFacebook()
 {
 	if (!mConnectedToFbc)
 	{
-		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false));
+		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, false));
 	}
 }
 
@@ -1750,12 +1750,12 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 	LLSD body;
 	body["code"] = auth_code;
 	body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI;
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this));
+	LLHTTPClient::put(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
 {
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", LLSD(), new FacebookDisconnectResponder(this));
+	LLHTTPClient::del(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookDisconnectResponder(this));
 }
 
 void LLPanelPeople::onLoginFbcButtonClicked()
@@ -1766,7 +1766,7 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 	else
 	{
-		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true));
+		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, true));
 	}
 }
 
-- 
cgit v1.2.3


From 2465634bf77b7c471106855c347b611bcd8ef2ab Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 5 Apr 2013 21:27:20 +0100
Subject: changed connect to use POST

---
 indra/newview/llpanelpeople.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4bcd146ad2..29a92525de 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1750,7 +1750,7 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 	LLSD body;
 	body["code"] = auth_code;
 	body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI;
-	LLHTTPClient::put(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this));
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
-- 
cgit v1.2.3


From c8883f6a5245056c4f26f2ce4f874549e62b2b29 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 9 Apr 2013 01:15:00 +0100
Subject: updated to use new API routes

---
 indra/newview/llpanelpeople.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 29a92525de..052637742b 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -888,6 +888,9 @@ void LLPanelPeople::updateFbcTestList()
 
 			// close the browser window
 			mFbcTestBrowserHandle.get()->die();
+
+			// get rid of the handle
+			mFbcTestBrowserHandle = LLHandle<LLFloater>();
 			
 			// stop updating
 			mFbcTestListUpdater->setActive(false);
@@ -1716,7 +1719,7 @@ public:
 			llinfos << content << llendl;
 
 			// display the list of friends
-			if (content.has("friends"))
+			if (content.has("friends") && !content.has("error"))
 			{
 				mPanelPeople->showFacebookFriends(content["friends"]);
 			}
@@ -1748,14 +1751,17 @@ void LLPanelPeople::tryToReconnectToFacebook()
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
 	LLSD body;
+	body["agent_id"] = gAgentID.asString();
 	body["code"] = auth_code;
 	body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI;
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this));
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
 {
-	LLHTTPClient::del(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookDisconnectResponder(this));
+	LLSD body;
+	body["agent_id"] = gAgentID.asString();
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", body, new FacebookDisconnectResponder(this));
 }
 
 void LLPanelPeople::onLoginFbcButtonClicked()
-- 
cgit v1.2.3


From 2b8632a81b40ef92a9b3872ad0909575a3bd938a Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 9 Apr 2013 02:01:56 +0100
Subject: changed redirect_uri to pdp15.lindenlab.com/redirect

---
 indra/newview/llpanelpeople.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 052637742b..a425919390 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -80,7 +80,7 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
 static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com";
-static const std::string FBC_SERVICES_REDIRECT_URI = "http://axcho.com/secondlife/";
+static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect";
 
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
-- 
cgit v1.2.3


From 479c5f4b4aad98dbb654cb03c343b2dce6222922 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 9 Apr 2013 13:24:51 -0700
Subject: adding in logging of building a list of 300 users inside LLAvatarList
 and LLFolderView to determine drawbacks/benefits and timing.

---
 indra/newview/llfloaterimcontainer.cpp               |  7 +++++--
 indra/newview/llpanelpeople.cpp                      | 17 +++++++++++++++++
 indra/newview/llpanelpeople.h                        |  1 +
 indra/newview/llparticipantlist.cpp                  | 14 ++++++++++++++
 indra/newview/llparticipantlist.h                    |  1 +
 indra/newview/skins/default/xui/en/menu_gear_fbc.xml |  9 ++++++++-
 6 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 7e281bd99b..af8c7e9dc4 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -342,8 +342,11 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked()
 
 void LLFloaterIMContainer::onSpeakButtonClicked()
 {
-	LLAgent::toggleMicrophone("speak");
-	updateSpeakBtnState();
+	//LLAgent::toggleMicrophone("speak");
+	//updateSpeakBtnState();
+
+	LLParticipantList* session_model = dynamic_cast<LLParticipantList*>(mConversationsItems[LLUUID(NULL)]);
+	session_model->addTestAvatarAgents();
 }
 void LLFloaterIMContainer::onExpandCollapseButtonClicked()
 {
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index a425919390..493395fdd1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -49,6 +49,7 @@
 #include "llavatarlist.h"
 #include "llavatarlistitem.h"
 #include "llcallingcard.h"			// for LLAvatarTracker
+#include "llerror.h"
 #include "llfloateravatarpicker.h"
 //#include "llfloaterminiinspector.h"
 #include "llfriendcard.h"
@@ -557,6 +558,7 @@ LLPanelPeople::LLPanelPeople()
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this));
 	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
+	mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this));
 
 
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
@@ -1789,4 +1791,19 @@ void LLPanelPeople::onFacebookAppSendClicked()
 	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL);
 	openFacebookWeb(p);
 }
+
+void LLPanelPeople::onFacebookTestAddClicked()
+{
+	mFacebookFriends->clear();
+
+	LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL;
+
+	for(int i = 0; i < 300; ++i)
+	{
+		mFacebookFriends->addNewItem(LLUUID(), "Test", false);
+	}
+
+	LL_INFOS("LLPanelPeople") << "finished adding 300 users" << LL_ENDL;
+}
+
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index ffb3f74192..76207108cd 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -124,6 +124,7 @@ private:
 	void					onLoginFbcButtonClicked();
 	void					onFacebookAppRequestClicked();
 	void					onFacebookAppSendClicked();
+	void					onFacebookTestAddClicked();
 
 	bool					onFriendsViewSortMenuItemCheck(const LLSD& userdata);
 	bool					onRecentViewSortMenuItemCheck(const LLSD& userdata);
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index c53760bca1..e05b27e539 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -27,6 +27,7 @@
 #include "llviewerprecompiledheaders.h"
 
 #include "llavatarnamecache.h"
+#include "llerror.h"
 #include "llimview.h"
 #include "llfloaterimcontainer.h"
 #include "llparticipantlist.h"
@@ -401,6 +402,19 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
 	adjustParticipant(avatar_id);
 }
 
+
+void LLParticipantList::addTestAvatarAgents()
+{
+	LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL;
+
+	for(int i = 0; i < 300; ++i)
+	{
+		addAvatarIDExceptAgent(LLUUID().generateNewID());
+	}
+
+	LL_INFOS("LLParticipantList") << "finished adding 300 users" << LL_ENDL;
+}
+
 void LLParticipantList::adjustParticipant(const LLUUID& speaker_id)
 {
 	LLPointer<LLSpeaker> speakerp = mSpeakerMgr->findSpeaker(speaker_id);
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 3a3ae76604..936e289c08 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -50,6 +50,7 @@ public:
 	 * @param[in] avatar_id - Avatar UUID to be added into the list
 	 */
 	void addAvatarIDExceptAgent(const LLUUID& avatar_id);
+	void addTestAvatarAgents();
 
 	/**
 	 * Refreshes the participant list.
diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
index b05ba46107..4d8cbb432e 100644
--- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
+++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
@@ -26,5 +26,12 @@
     <menu_item_check.on_click
      function="People.sendFBC"
      parameter="http://www.facebook.com/settings?tab=applications" />
-  </menu_item_check>  
+  </menu_item_check>
+  <menu_item_check
+   label="Facebook Add 300 test users"
+   layout="topleft"
+   name="Facebook App Add">
+    <menu_item_check.on_click
+     function="People.testaddFBC"/>
+  </menu_item_check>
 </toggleable_menu>
\ No newline at end of file
-- 
cgit v1.2.3


From 31eb1f6ebb27c016c66a50f3b32917ea7496fb2f Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 10 Apr 2013 00:46:15 +0100
Subject: updated routes URLs

---
 indra/newview/llpanelpeople.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index a425919390..cabc2cf4fe 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -79,8 +79,8 @@ static const std::string BLOCKED_TAB_NAME	= "blocked_panel"; // blocked avatars
 static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
-static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com";
-static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect";
+static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc";
+static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/fbc/redirect";
 
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
@@ -1737,14 +1737,14 @@ public:
 
 void LLPanelPeople::loadFacebookFriends()
 {
-	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this));
+	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/friends", new FacebookFriendsResponder(this));
 }
 
 void LLPanelPeople::tryToReconnectToFacebook()
 {
 	if (!mConnectedToFbc)
 	{
-		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, false));
+		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, false));
 	}
 }
 
@@ -1754,14 +1754,14 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 	body["agent_id"] = gAgentID.asString();
 	body["code"] = auth_code;
 	body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI;
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this));
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/connect", body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
 {
 	LLSD body;
 	body["agent_id"] = gAgentID.asString();
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", body, new FacebookDisconnectResponder(this));
+	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/disconnect", body, new FacebookDisconnectResponder(this));
 }
 
 void LLPanelPeople::onLoginFbcButtonClicked()
@@ -1772,7 +1772,7 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 	else
 	{
-		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, true));
+		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, true));
 	}
 }
 
-- 
cgit v1.2.3


From 46c690bd50c588f126d8b5dba67a6802d255c2bd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 11 Apr 2013 18:26:48 -0700
Subject: Adding in fast timer for testing creation of 300 avatar list items vs
 folderview items.

---
 indra/newview/llpanelpeople.cpp     | 4 ++++
 indra/newview/llparticipantlist.cpp | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2e97e8bab9..b33574bcc3 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1792,8 +1792,12 @@ void LLPanelPeople::onFacebookAppSendClicked()
 	openFacebookWeb(p);
 }
 
+static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test");
+
 void LLPanelPeople::onFacebookTestAddClicked()
 {
+	LLFastTimer _(FTM_AVATAR_LIST_TEST);
+
 	mFacebookFriends->clear();
 
 	LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL;
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index e05b27e539..b5c9f4a310 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -402,9 +402,13 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
 	adjustParticipant(avatar_id);
 }
 
+static LLFastTimer::DeclareTimer FTM_FOLDERVIEW_TEST("add test avatar agents");
+
 
 void LLParticipantList::addTestAvatarAgents()
 {
+	LLFastTimer _(FTM_FOLDERVIEW_TEST);
+
 	LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL;
 
 	for(int i = 0; i < 300; ++i)
-- 
cgit v1.2.3


From 9a0cd53bdaf10652236f082a63fe43ec126a9251 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 13 Apr 2013 02:10:13 +0100
Subject: switched to use FacebookConnect and FacebookRedirect capabilities

---
 indra/newview/llpanelpeople.cpp  | 39 +++++++++++++++++++++++++++------------
 indra/newview/llpanelpeople.h    |  3 +++
 indra/newview/llviewerregion.cpp |  2 ++
 3 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2e97e8bab9..5a4eca87ff 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -81,7 +81,7 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
 static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc";
-static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/fbc/redirect";
+static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect";
 
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
@@ -865,12 +865,12 @@ void LLPanelPeople::updateFbcTestList()
 		std::string url = mFbcTestBrowserHandle.get()->getTitle();
 
 		// if the browser has redirected from facebook
-		if (url.find(FBC_SERVICES_REDIRECT_URI) == 0)
+		if (url.find(getFacebookRedirectURL()) == 0)
 		{
 			// find the auth code in the url
 			std::string begin_string = "code=";
 			std::string end_string = "#";
-			size_t begin_index = begin_string.length() + url.find(begin_string, FBC_SERVICES_REDIRECT_URI.length());
+			size_t begin_index = begin_string.length() + url.find(begin_string, getFacebookRedirectURL().length());
 			size_t end_index = url.find(end_string, begin_index);
 
 			// extract the auth code from the url
@@ -1695,7 +1695,7 @@ public:
 			else if (mShowLoginIfNotConnected)
 			{
 				LLFloaterWebContent::Params p;
-				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI);
+				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL());
 				mPanelPeople->openFacebookWeb(p);
 			}
 		}
@@ -1739,14 +1739,14 @@ public:
 
 void LLPanelPeople::loadFacebookFriends()
 {
-	LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/friends", new FacebookFriendsResponder(this));
+	LLHTTPClient::get(getFacebookConnectURL("/friends"), new FacebookFriendsResponder(this));
 }
 
 void LLPanelPeople::tryToReconnectToFacebook()
 {
 	if (!mConnectedToFbc)
 	{
-		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, false));
+		LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, false));
 	}
 }
 
@@ -1755,17 +1755,32 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 	LLSD body;
 	body["agent_id"] = gAgentID.asString();
 	body["code"] = auth_code;
-	body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI;
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/connect", body, new FacebookConnectResponder(this));
+	body["redirect_uri"] = getFacebookRedirectURL();
+	LLHTTPClient::post(getFacebookConnectURL("/connect"), body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
 {
 	LLSD body;
 	body["agent_id"] = gAgentID.asString();
-	LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/disconnect", body, new FacebookDisconnectResponder(this));
+	LLHTTPClient::post(getFacebookConnectURL("/disconnect"), body, new FacebookDisconnectResponder(this));
 }
 
+std::string LLPanelPeople::getFacebookConnectURL(const std::string& route)
+{
+	static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
+	std::string url = sFacebookConnectUrl + route;
+	llinfos << url << llendl;
+	return url;
+}
+
+std::string LLPanelPeople::getFacebookRedirectURL()
+{
+	static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect");
+	llinfos << sFacebookRedirectUrl << llendl;
+	return sFacebookRedirectUrl;
+}	
+
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
 	if (mConnectedToFbc)
@@ -1774,21 +1789,21 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 	else
 	{
-		LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, true));
+		LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, true));
 	}
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL);
+	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL());
 	openFacebookWeb(p);
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
 	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL);
+	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL());
 	openFacebookWeb(p);
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 76207108cd..e9581bb5f3 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -66,6 +66,9 @@ public:
 	void connectToFacebook(const std::string& auth_code);
 	void disconnectFromFacebook();
 	
+	std::string getFacebookConnectURL(const std::string& route = "");
+	std::string getFacebookRedirectURL();
+	
 	bool mConnectedToFbc;
 	bool mTryToConnectToFbc;
 
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index e4234a538d..5b3b11ae2d 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1522,6 +1522,8 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append("EnvironmentSettings");
 	capabilityNames.append("EstateChangeInfo");
 	capabilityNames.append("EventQueueGet");
+	capabilityNames.append("FacebookConnect");
+	//capabilityNames.append("FacebookRedirect");
 
 	if (gSavedSettings.getBOOL("UseHTTPInventory"))
 	{
-- 
cgit v1.2.3


From 828334ac553182e6e9db6806c3a1b8203e64bc43 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 17 Apr 2013 02:53:50 +0100
Subject: updated to use new API as suggested by Don Linden

---
 indra/newview/llpanelpeople.cpp | 68 +++++++++++++----------------------------
 1 file changed, 21 insertions(+), 47 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 519868612a..75c29558e5 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1592,10 +1592,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 {
 	mFacebookFriends->clear();
 
-	for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
+	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
 	{
-		std::string name = (*i)["name"].asString();
-		LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL);
+		std::string name = i->second["name"].asString();
+		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
 		
 		mFacebookFriends->addNewItem(agent_id, name, false);
 	}
@@ -1621,15 +1621,8 @@ public:
 			llinfos << content << llendl;
 			
 			// grab some graph data now that we are connected
-			if (content["success"])
-			{
-				mPanelPeople->mConnectedToFbc = true;
-				mPanelPeople->loadFacebookFriends();
-			}
-			else if (content.has("error"))
-			{
-				llinfos << "failed to connect. reason: " << content["error"]["message"] << llendl;
-			}
+			mPanelPeople->mConnectedToFbc = true;
+			mPanelPeople->loadFacebookFriends();
 		}
 		else
 		{
@@ -1653,15 +1646,8 @@ public:
 			llinfos << content << llendl;
 			
 			// hide all the facebook stuff
-			if (content["success"])
-			{
-				mPanelPeople->mConnectedToFbc = false;
-				mPanelPeople->hideFacebookFriends();
-			}
-			else if (content.has("error"))
-			{
-				llinfos << "failed to disconnect. reason: " << content["error"]["message"] << llendl;
-			}
+			mPanelPeople->mConnectedToFbc = false;
+			mPanelPeople->hideFacebookFriends();
 		}
 		else
 		{
@@ -1686,23 +1672,21 @@ public:
 			llinfos << content << llendl;
 
 			// grab some graph data if already connected
-			if (content["connected"])
-			{
-				mPanelPeople->mConnectedToFbc = true;
-				mPanelPeople->loadFacebookFriends();
-			}
+			mPanelPeople->mConnectedToFbc = true;
+			mPanelPeople->loadFacebookFriends();
+		}
+		else
+		{
+			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
+
 			// show the facebook login page if not connected yet
-			else if (mShowLoginIfNotConnected)
+			if (status == 404 && mShowLoginIfNotConnected)
 			{
 				LLFloaterWebContent::Params p;
 				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL());
 				mPanelPeople->openFacebookWeb(p);
 			}
 		}
-		else
-		{
-			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
-		}
 	}
 };
 
@@ -1721,14 +1705,7 @@ public:
 			llinfos << content << llendl;
 
 			// display the list of friends
-			if (content.has("friends") && !content.has("error"))
-			{
-				mPanelPeople->showFacebookFriends(content["friends"]);
-			}
-			else if (content.has("error"))
-			{
-				llinfos << "failed to get facebook friends. reason: " << content["error"]["message"] << llendl;
-			}
+			mPanelPeople->showFacebookFriends(content);
 		}
 		else
 		{
@@ -1739,31 +1716,28 @@ public:
 
 void LLPanelPeople::loadFacebookFriends()
 {
-	LLHTTPClient::get(getFacebookConnectURL("/friends"), new FacebookFriendsResponder(this));
+	LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this));
 }
 
 void LLPanelPeople::tryToReconnectToFacebook()
 {
 	if (!mConnectedToFbc)
 	{
-		LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, false));
+		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false));
 	}
 }
 
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
 	LLSD body;
-	body["agent_id"] = gAgentID.asString();
 	body["code"] = auth_code;
 	body["redirect_uri"] = getFacebookRedirectURL();
-	LLHTTPClient::post(getFacebookConnectURL("/connect"), body, new FacebookConnectResponder(this));
+	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this));
 }
 
 void LLPanelPeople::disconnectFromFacebook()
 {
-	LLSD body;
-	body["agent_id"] = gAgentID.asString();
-	LLHTTPClient::post(getFacebookConnectURL("/disconnect"), body, new FacebookDisconnectResponder(this));
+	LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this));
 }
 
 std::string LLPanelPeople::getFacebookConnectURL(const std::string& route)
@@ -1789,7 +1763,7 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 	else
 	{
-		LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, true));
+		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true));
 	}
 }
 
-- 
cgit v1.2.3


From 7f0798fd6dad069aca44b954aa0fb7e49d42198c Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 16 Apr 2013 19:34:40 -0700
Subject: adding a new tab in people panel that has a folder view

---
 indra/newview/llconversationmodel.cpp              |   1 +
 indra/newview/llpanelpeople.cpp                    | 142 +++++++++++++++++++++
 indra/newview/llpanelpeople.h                      |  18 ++-
 .../newview/skins/default/xui/en/panel_people.xml  |  13 ++
 4 files changed, 173 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index c74ce24872..ed434d82d5 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -95,6 +95,7 @@ void LLConversationItem::postEvent(const std::string& event_type, LLConversation
 	LLUUID participant_id = (participant ? participant->getUUID() : LLUUID());
 	LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id));
 	LLEventPumps::instance().obtain("ConversationsEvents").post(event);
+	LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event);
 }
 
 // Virtual action callbacks
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 519868612a..6864381404 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -28,6 +28,8 @@
 
 // libs
 #include "llavatarname.h"
+#include "llconversationview.h"
+#include "llfloaterimcontainer.h"
 #include "llfloaterreg.h"
 #include "llfloatersidepanelcontainer.h"
 #include "llmenubutton.h"
@@ -48,7 +50,9 @@
 #include "llavataractions.h"
 #include "llavatarlist.h"
 #include "llavatarlistitem.h"
+#include "llavatarnamecache.h"
 #include "llcallingcard.h"			// for LLAvatarTracker
+#include "llcallbacklist.h"
 #include "llerror.h"
 #include "llfloateravatarpicker.h"
 //#include "llfloaterminiinspector.h"
@@ -58,6 +62,7 @@
 #include "llinventoryobserver.h"
 #include "llnetmap.h"
 #include "llpanelpeoplemenus.h"
+#include "llparticipantlist.h"
 #include "llsidetraypanelcontainer.h"
 #include "llrecentpeople.h"
 #include "llviewercontrol.h"		// for gSavedSettings
@@ -78,6 +83,7 @@ static const std::string GROUP_TAB_NAME		= "groups_panel";
 static const std::string RECENT_TAB_NAME	= "recent_panel";
 static const std::string BLOCKED_TAB_NAME	= "blocked_panel"; // blocked avatars
 static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
+static const std::string FBCTESTTWO_TAB_NAME	= "fbctesttwo_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
 static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc";
@@ -540,6 +546,8 @@ private:
 LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
 		mConnectedToFbc(false),
+		mConversationsRoot(NULL),
+		mConversationsEventStream("ConversationsEventsTwo"),
 		mTryToConnectToFbc(true),
 		mTabContainer(NULL),
 		mOnlineFriendList(NULL),
@@ -595,6 +603,8 @@ LLPanelPeople::~LLPanelPeople()
 	}
 
 	if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die();
+
+	mConversationsEventStream.stopListening("ConversationsRefresh");
 }
 
 void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
@@ -678,6 +688,61 @@ BOOL LLPanelPeople::postBuild()
 	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");
 	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2));
 
+	//===Test START========================================================================
+
+	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
+
+	//Create folder view
+	LLConversationItem* base_item = new LLConversationItem(mConversationViewModel);
+
+	LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLFolderView>());
+	folder_view_params.rect.left(0).right(0).top(0).bottom(0);
+	folder_view_params.parent_panel = friends_tab;
+	folder_view_params.listener = base_item;
+	folder_view_params.view_model = &mConversationViewModel;
+	folder_view_params.root = NULL;
+	folder_view_params.use_ellipses = false;
+	folder_view_params.options_menu = "menu_conversation.xml";
+	folder_view_params.name = "fbcfolderview";
+	mConversationsRoot = LLUICtrlFactory::create<LLFolderView>(folder_view_params);
+	mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPanelPeople::onConversationModelEvent, this, _1));
+
+	//Create scroller
+	LLRect scroller_view_rect = socialtwo_tab->getRect();
+	//scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
+	LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams<LLFolderViewScrollContainer>());
+	scroller_params.rect(scroller_view_rect);
+
+	LLScrollContainer* scroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
+	socialtwo_tab->addChildInBack(scroller);
+	scroller->addChild(mConversationsRoot);
+	scroller->setFollowsAll();
+	mConversationsRoot->setScrollContainer(scroller);
+	mConversationsRoot->setFollowsAll();
+
+	//Create a session
+	//LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance();
+	LLConversationItemSession* item = new LLConversationItemSession(LLUUID(NULL), mConversationViewModel);
+	item->renameItem("Facebook Friends");
+	LLConversationViewSession::Params params;
+
+	params.name = item->getDisplayName();
+	params.root = mConversationsRoot;
+	params.listener = item;
+	params.tool_tip = params.name;
+	params.container = LLFloaterIMContainer::getInstance();
+	LLConversationViewSession * widget = LLUICtrlFactory::create<LLConversationViewSession>(params);
+	widget->addToFolder(mConversationsRoot);
+
+	mConversationsItems[LLUUID(NULL)] = item;
+	mConversationsWidgits[LLUUID(NULL)] = widget;
+
+	gIdleCallbacks.addFunction(idle, this);
+
+	//===Test END========================================================================
+
+
+
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
 	setSortOrder(mNearbyList,		(ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"),	false);
@@ -757,6 +822,12 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI,
 	updateButtons();
 }
 
+void LLPanelPeople::idle(void * user_data)
+{
+	LLPanelPeople * self = static_cast<LLPanelPeople *>(user_data);
+	self->mConversationsRoot->update();
+}
+
 void LLPanelPeople::updateFriendListHelpText()
 {
 	// show special help text for just created account to help finding friends. EXT-4836
@@ -999,6 +1070,10 @@ LLUUID LLPanelPeople::getCurrentItemID() const
 	if (cur_tab == FBCTEST_TAB_NAME)
 		return LLUUID::null;
 
+	if (cur_tab == FBCTESTTWO_TAB_NAME)
+		return LLUUID::null;
+
+
 	llassert(0 && "unknown tab selected");
 	return LLUUID::null;
 }
@@ -1023,6 +1098,8 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
 		selected_uuids.clear(); // FIXME?
 	else if (cur_tab == FBCTEST_TAB_NAME)
 		return;
+	else if (cur_tab == FBCTESTTWO_TAB_NAME)
+		return;
 	else
 		llassert(0 && "unknown tab selected");
 
@@ -1576,6 +1653,49 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
+bool LLPanelPeople::onConversationModelEvent(const LLSD& event)
+{
+	std::string type = event.get("type").asString();
+	LLUUID session_id = event.get("session_uuid").asUUID();
+	LLUUID participant_id = event.get("participant_uuid").asUUID();
+
+	if(type == "add_participant")
+	{
+		LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[session_id]);
+		LLConversationViewSession * session_view = dynamic_cast<LLConversationViewSession *>(mConversationsWidgits[session_id]);
+		LLConversationItemParticipant * participant_model = session_model->findParticipant(participant_id);
+
+		if(participant_model)
+		{
+			LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model);
+			participant_view->addToFolder(session_view);
+		}
+		
+
+		llinfos << "adding!!!!!!" << llendl;
+	}
+
+	return false;
+}
+
+LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant(LLConversationItem * item)
+{
+	LLConversationViewParticipant::Params params;
+	LLRect panel_rect = getChild<LLPanel>(FBCTESTTWO_TAB_NAME)->getRect();
+
+	params.name = item->getDisplayName();
+	params.root = mConversationsRoot;
+	params.listener = item;
+
+	//24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml.
+	params.rect = LLRect (0, 24, panel_rect.getWidth(), 0);
+	params.tool_tip = params.name;
+	params.participant_id = item->getUUID();
+	params.folder_indentation = 2;
+
+	return LLUICtrlFactory::create<LLConversationViewParticipant>(params);
+}
+
 void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 {
 	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
@@ -1601,6 +1721,28 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 	}
 }
 
+void LLPanelPeople::addTestParticipant()
+{
+	for(int i = 0; i < 300; ++i)
+	{
+		LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[LLUUID(NULL)]);
+		addParticipantToModel(session_model, LLUUID().generateNewID(), "Test");
+	}
+	}
+
+void LLPanelPeople::addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name)
+{
+	LLConversationItemParticipant* participant = NULL;
+
+	// Create a participant model
+	LLAvatarName avatar_name;
+	bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name);
+	std::string avatar_name_string = has_name ? name + " (" + avatar_name.getDisplayName() + ")" : name;
+
+	participant = new LLConversationItemParticipant(avatar_name_string , agent_id, mConversationViewModel);
+	session_model->addParticipant(participant);
+}
+
 void LLPanelPeople::hideFacebookFriends()
 {
 	mFacebookFriends->clear();
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index e9581bb5f3..b4582d9a3e 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -22,7 +22,7 @@
  * 
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
- */
+ */ 
 
 #ifndef LL_LLPANELPEOPLE_H
 #define LL_LLPANELPEOPLE_H
@@ -30,6 +30,8 @@
 #include <llpanel.h>
 
 #include "llcallingcard.h" // for avatar tracker
+#include "llconversationmodel.h"
+#include "llevents.h"
 #include "llfloaterwebcontent.h"
 #include "llvoiceclient.h"
 
@@ -41,6 +43,7 @@ class LLGroupList;
 class LLSocialList;
 class LLMenuButton;
 class LLTabContainer;
+class LLFolderView;
 
 class LLPanelPeople 
 	: public LLPanel
@@ -58,8 +61,12 @@ public:
 	// when voice is available
 	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
 
+	static void idle(void * user_data);
+
 	void openFacebookWeb(LLFloaterWebContent::Params& p);
 	void showFacebookFriends(const LLSD& friends);
+	void addTestParticipant();
+	void addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name);
 	void hideFacebookFriends();
 	void loadFacebookFriends();
 	void tryToReconnectToFacebook();
@@ -149,6 +156,9 @@ private:
 	bool					isAccordionCollapsedByUser(LLUICtrl* acc_tab);
 	bool					isAccordionCollapsedByUser(const std::string& name);
 
+	bool					onConversationModelEvent(const LLSD& event);
+	LLConversationViewParticipant * createConversationViewParticipant(LLConversationItem * item);
+
 	LLTabContainer*			mTabContainer;
 	LLAvatarList*			mOnlineFriendList;
 	LLAvatarList*			mAllFriendList;
@@ -170,6 +180,12 @@ private:
 	Updater*				mButtonsUpdater;
 	LLMenuButton*			mFBCGearButton;
     LLHandle< LLFloater >	mPicker;
+
+	conversations_items_map mConversationsItems;
+	conversations_widgets_map mConversationsWidgits;
+	LLConversationViewModel mConversationViewModel;
+	LLFolderView* mConversationsRoot;
+	LLEventStream mConversationsEventStream;
 };
 
 #endif //LL_LLPANELPEOPLE_H
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 08c8aef1e9..c4db547a8e 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -725,5 +725,18 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
              />
           </panel>
         </panel>
+        <panel
+           background_opaque="true"
+           background_visible="true"
+           bg_alpha_color="DkGray"
+           bg_opaque_color="DkGray"
+           follows="all"
+           height="383"
+           label="FBC TEST TWO"
+           layout="topleft"
+           left="0"
+           help_topic="people_fbctest_tab"
+           name="fbctesttwo_panel"
+           top="0"/>      
     </tab_container>
 </panel>
-- 
cgit v1.2.3


From 0eb2248f55c835e51705c4dc026e177f3930c5db Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 16 Apr 2013 22:36:32 -0700
Subject: made a separate button to add test users to the folder view list.
 Also when receiving facebook friends both the avatarlist and folderview will
 be populated.

---
 indra/newview/llpanelpeople.cpp                      | 13 +++++++++----
 indra/newview/skins/default/xui/en/menu_gear_fbc.xml |  9 ++++++++-
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 94b60ca2d6..34d565bbaa 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -567,7 +567,7 @@ LLPanelPeople::LLPanelPeople()
 	mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this));
 	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
 	mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this));
-
+	mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this));
 
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.AddFriendWizard",	boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked,	this));
@@ -1670,9 +1670,6 @@ bool LLPanelPeople::onConversationModelEvent(const LLSD& event)
 			LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model);
 			participant_view->addToFolder(session_view);
 		}
-		
-
-		llinfos << "adding!!!!!!" << llendl;
 	}
 
 	return false;
@@ -1717,7 +1714,15 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		std::string name = i->second["name"].asString();
 		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
 		
+		//add to avatar list
 		mFacebookFriends->addNewItem(agent_id, name, false);
+
+		//Add to folder view
+		LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[LLUUID(NULL)]);
+		if(session_model)
+		{
+			addParticipantToModel(session_model, agent_id, name);
+		}
 	}
 }
 
diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
index 4d8cbb432e..d73cee344b 100644
--- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
+++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
@@ -28,10 +28,17 @@
      parameter="http://www.facebook.com/settings?tab=applications" />
   </menu_item_check>
   <menu_item_check
-   label="Facebook Add 300 test users"
+   label="Facebook Add 300 test users to AvatarList"
    layout="topleft"
    name="Facebook App Add">
     <menu_item_check.on_click
      function="People.testaddFBC"/>
   </menu_item_check>
+  <menu_item_check
+   label="Facebook Add 300 test users to FolderView"
+   layout="topleft"
+   name="Facebook App Add">
+    <menu_item_check.on_click
+     function="People.testaddFBCFolderView"/>
+  </menu_item_check>  
 </toggleable_menu>
\ No newline at end of file
-- 
cgit v1.2.3


From a505c3734a4a3f644500558030b4496d3cb5a5b5 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 22 Apr 2013 18:08:36 -0700
Subject: ACME 162: Implemented a foundation model for the facebook connect
 folder view.

---
 indra/newview/CMakeLists.txt                       |   4 +
 indra/newview/llconversationmodel.cpp              |   1 -
 indra/newview/llpanelpeople.cpp                    |  80 +++++------
 indra/newview/llpanelpeople.h                      |  16 ++-
 indra/newview/llpersonfolderview.cpp               | 126 ++++++++++++++++
 indra/newview/llpersonfolderview.h                 |  93 ++++++++++++
 indra/newview/llpersonmodelcommon.cpp              | 158 +++++++++++++++++++++
 indra/newview/llpersonmodelcommon.h                | 132 +++++++++++++++++
 .../default/xui/en/widgets/person_folder_view.xml  |  13 ++
 9 files changed, 577 insertions(+), 46 deletions(-)
 create mode 100644 indra/newview/llpersonfolderview.cpp
 create mode 100644 indra/newview/llpersonfolderview.h
 create mode 100644 indra/newview/llpersonmodelcommon.cpp
 create mode 100644 indra/newview/llpersonmodelcommon.h
 create mode 100644 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 02ab1c9ff1..84e8811ce8 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -452,6 +452,8 @@ set(viewer_SOURCE_FILES
     llpathfindingobjectlist.cpp
     llpathfindingpathtool.cpp
     llpersistentnotificationstorage.cpp
+    llpersonmodelcommon.cpp
+    llpersonfolderview.cpp
     llphysicsmotion.cpp
     llphysicsshapebuilderutil.cpp
     llplacesinventorybridge.cpp
@@ -1029,6 +1031,8 @@ set(viewer_HEADER_FILES
     llpathfindingobjectlist.h
     llpathfindingpathtool.h
     llpersistentnotificationstorage.h
+    llpersonmodelcommon.h
+    llpersonfolderview.h
     llphysicsmotion.h
     llphysicsshapebuilderutil.h
     llplacesinventorybridge.h
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index ed434d82d5..c74ce24872 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -95,7 +95,6 @@ void LLConversationItem::postEvent(const std::string& event_type, LLConversation
 	LLUUID participant_id = (participant ? participant->getUUID() : LLUUID());
 	LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id));
 	LLEventPumps::instance().obtain("ConversationsEvents").post(event);
-	LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event);
 }
 
 // Virtual action callbacks
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 34d565bbaa..d2d1e602be 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -63,6 +63,8 @@
 #include "llnetmap.h"
 #include "llpanelpeoplemenus.h"
 #include "llparticipantlist.h"
+#include "llpersonmodelcommon.h"
+#include "llpersonfolderview.h"
 #include "llsidetraypanelcontainer.h"
 #include "llrecentpeople.h"
 #include "llviewercontrol.h"		// for gSavedSettings
@@ -696,7 +698,6 @@ BOOL LLPanelPeople::postBuild()
 	LLConversationItem* base_item = new LLConversationItem(mConversationViewModel);
 
 	LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLFolderView>());
-	folder_view_params.rect.left(0).right(0).top(0).bottom(0);
 	folder_view_params.parent_panel = friends_tab;
 	folder_view_params.listener = base_item;
 	folder_view_params.view_model = &mConversationViewModel;
@@ -709,7 +710,9 @@ BOOL LLPanelPeople::postBuild()
 
 	//Create scroller
 	LLRect scroller_view_rect = socialtwo_tab->getRect();
-	//scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
+	scroller_view_rect.mTop -= 4;
+	scroller_view_rect.mRight -=6;
+	scroller_view_rect.mLeft += 2;
 	LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams<LLFolderViewScrollContainer>());
 	scroller_params.rect(scroller_view_rect);
 
@@ -722,21 +725,18 @@ BOOL LLPanelPeople::postBuild()
 
 	//Create a session
 	//LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance();
-	LLConversationItemSession* item = new LLConversationItemSession(LLUUID(NULL), mConversationViewModel);
-	item->renameItem("Facebook Friends");
-	LLConversationViewSession::Params params;
-
+	LLPersonFolderModel* item = new LLPersonFolderModel("Facebook Friends", mConversationViewModel);
+	LLPersonFolderView::Params params;
 	params.name = item->getDisplayName();
 	params.root = mConversationsRoot;
 	params.listener = item;
 	params.tool_tip = params.name;
-	params.container = LLFloaterIMContainer::getInstance();
-	LLConversationViewSession * widget = LLUICtrlFactory::create<LLConversationViewSession>(params);
+	LLPersonFolderView * widget = LLUICtrlFactory::create<LLPersonFolderView>(params);
 	widget->addToFolder(mConversationsRoot);
 
-	mConversationsItems[LLUUID(NULL)] = item;
-	mConversationsWidgits[LLUUID(NULL)] = widget;
-
+	mPersonFolderModelMap[item->getID()] = item;
+	mPersonFolderViewMap[item->getID()] = widget;
+	
 	gIdleCallbacks.addFunction(idle, this);
 
 	//===Test END========================================================================
@@ -1656,28 +1656,32 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 bool LLPanelPeople::onConversationModelEvent(const LLSD& event)
 {
 	std::string type = event.get("type").asString();
-	LLUUID session_id = event.get("session_uuid").asUUID();
-	LLUUID participant_id = event.get("participant_uuid").asUUID();
+	LLUUID folder_id = event.get("folder_id").asUUID();
+	LLUUID person_id = event.get("person_id").asUUID();
 
 	if(type == "add_participant")
 	{
-		LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[session_id]);
-		LLConversationViewSession * session_view = dynamic_cast<LLConversationViewSession *>(mConversationsWidgits[session_id]);
-		LLConversationItemParticipant * participant_model = session_model->findParticipant(participant_id);
-
-		if(participant_model)
+		LLPersonFolderModel * person_folder_model = dynamic_cast<LLPersonFolderModel *>(mPersonFolderModelMap[folder_id]);
+		LLPersonFolderView * person_folder_view = dynamic_cast<LLPersonFolderView *>(mPersonFolderViewMap[person_id]);
+		
+		if(person_folder_model)
 		{
-			LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model);
-			participant_view->addToFolder(session_view);
+			LLPersonModel * person_model = person_folder_model->findParticipant(person_id);
+
+			if(person_model)
+			{
+				LLPersonView * participant_view = createConversationViewParticipant(person_model);
+				participant_view->addToFolder(person_folder_view);
+			}
 		}
 	}
 
 	return false;
 }
 
-LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant(LLConversationItem * item)
+LLPersonView * LLPanelPeople::createConversationViewParticipant(LLPersonModel * item)
 {
-	LLConversationViewParticipant::Params params;
+	LLPersonView::Params params;
 	LLRect panel_rect = getChild<LLPanel>(FBCTESTTWO_TAB_NAME)->getRect();
 
 	params.name = item->getDisplayName();
@@ -1687,10 +1691,9 @@ LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant
 	//24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml.
 	params.rect = LLRect (0, 24, panel_rect.getWidth(), 0);
 	params.tool_tip = params.name;
-	params.participant_id = item->getUUID();
 	params.folder_indentation = 2;
 
-	return LLUICtrlFactory::create<LLConversationViewParticipant>(params);
+	return LLUICtrlFactory::create<LLPersonView>(params);
 }
 
 void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
@@ -1718,11 +1721,11 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		mFacebookFriends->addNewItem(agent_id, name, false);
 
 		//Add to folder view
-		LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[LLUUID(NULL)]);
-		if(session_model)
-		{
-			addParticipantToModel(session_model, agent_id, name);
-		}
+		//LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[LLUUID(NULL)]);
+		//if(session_model)
+		//{
+		//	addParticipantToModel(session_model, agent_id, name);
+		//}
 	}
 }
 
@@ -1730,22 +1733,17 @@ void LLPanelPeople::addTestParticipant()
 {
 	for(int i = 0; i < 300; ++i)
 	{
-		LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[LLUUID(NULL)]);
-		addParticipantToModel(session_model, LLUUID().generateNewID(), "Test");
-	}
+		LLPersonFolderModel * person_folder_model = dynamic_cast<LLPersonFolderModel *>(mPersonFolderModelMap.begin()->second);
+		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy");
 	}
+}
 
-void LLPanelPeople::addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name)
+void LLPanelPeople::addParticipantToModel(LLPersonFolderModel * person_folder_model, const LLUUID& agent_id, const std::string& name)
 {
-	LLConversationItemParticipant* participant = NULL;
-
-	// Create a participant model
-	LLAvatarName avatar_name;
-	bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name);
-	std::string avatar_name_string = has_name ? name + " (" + avatar_name.getDisplayName() + ")" : name;
+	LLPersonModel* person_model = NULL;
 
-	participant = new LLConversationItemParticipant(avatar_name_string , agent_id, mConversationViewModel);
-	session_model->addParticipant(participant);
+	person_model = new LLPersonModel(name, mConversationViewModel);
+	person_folder_model->addParticipant(person_model);
 }
 
 void LLPanelPeople::hideFacebookFriends()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index b4582d9a3e..935171df2b 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -45,6 +45,14 @@ class LLMenuButton;
 class LLTabContainer;
 class LLFolderView;
 
+class LLPersonFolderModel;
+class LLPersonFolderView;
+class LLPersonView;
+class LLPersonModel;
+
+typedef std::map<LLUUID, LLPersonFolderModel *> person_folder_model_map;
+typedef std::map<LLUUID, LLPersonFolderView *> person_folder_view_map;
+
 class LLPanelPeople 
 	: public LLPanel
 	, public LLVoiceClientStatusObserver
@@ -66,7 +74,7 @@ public:
 	void openFacebookWeb(LLFloaterWebContent::Params& p);
 	void showFacebookFriends(const LLSD& friends);
 	void addTestParticipant();
-	void addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name);
+	void addParticipantToModel(LLPersonFolderModel * session_model, const LLUUID& agent_id, const std::string& name);
 	void hideFacebookFriends();
 	void loadFacebookFriends();
 	void tryToReconnectToFacebook();
@@ -157,7 +165,7 @@ private:
 	bool					isAccordionCollapsedByUser(const std::string& name);
 
 	bool					onConversationModelEvent(const LLSD& event);
-	LLConversationViewParticipant * createConversationViewParticipant(LLConversationItem * item);
+	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
 
 	LLTabContainer*			mTabContainer;
 	LLAvatarList*			mOnlineFriendList;
@@ -181,8 +189,8 @@ private:
 	LLMenuButton*			mFBCGearButton;
     LLHandle< LLFloater >	mPicker;
 
-	conversations_items_map mConversationsItems;
-	conversations_widgets_map mConversationsWidgits;
+	person_folder_model_map mPersonFolderModelMap;
+	person_folder_view_map mPersonFolderViewMap;
 	LLConversationViewModel mConversationViewModel;
 	LLFolderView* mConversationsRoot;
 	LLEventStream mConversationsEventStream;
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
new file mode 100644
index 0000000000..e1f1cbb1fa
--- /dev/null
+++ b/indra/newview/llpersonfolderview.cpp
@@ -0,0 +1,126 @@
+/** 
+* @file llpersonfolderview.cpp
+* @brief Implementation of llpersonfolderview
+* @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 "llpersonfolderview.h"
+
+static LLDefaultChildRegistry::Register<LLPersonFolderView> r_person_folder_view("person_folder_view");
+
+const LLColor4U DEFAULT_WHITE(255, 255, 255);
+
+LLPersonFolderView::Params::Params()
+{}
+
+LLPersonFolderView::LLPersonFolderView(const LLPersonFolderView::Params& p) :
+LLFolderViewFolder(p)
+{
+
+}
+
+S32 LLPersonFolderView::getLabelXPos()
+{
+	return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash;
+}
+
+LLPersonFolderView::~LLPersonFolderView()
+{
+
+}
+
+void LLPersonFolderView::draw()
+{
+	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
+
+	static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+	static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
+	static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+	static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE);
+
+	const LLFontGL * font = LLFontGL::getFontSansSerif();
+	F32 text_left = (F32)getLabelXPos();
+	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
+	LLColor4 color = sFgColor;
+	F32 right_x  = 0;
+
+	drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
+	
+	updateLabelRotation();
+	drawOpenFolderArrow(default_params, sFgColor);
+
+	drawLabel(font, text_left, y, color, right_x);
+
+	LLView::draw();
+}
+
+//
+// LLPersonFolderModel
+// 
+
+
+LLPersonView::Params::Params()
+{}
+
+LLPersonView::LLPersonView(const LLPersonView::Params& p) :
+LLFolderViewItem(p)
+{
+
+}
+
+S32 LLPersonView::getLabelXPos()
+{
+	return getIndentation();
+}
+
+void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
+{
+	LLFolderViewItem::addToFolder(person_folder_view);
+	//Added item to folder, could change folder's mHasVisibleChildren flag so call arrange
+	person_folder_view->requestArrange();
+}
+
+LLPersonView::~LLPersonView()
+{
+
+}
+
+void LLPersonView::draw()
+{
+	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+	static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
+
+	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
+	F32 text_left = (F32)getLabelXPos();
+	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
+	LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor;
+	F32 right_x  = 0;
+
+	drawLabel(font, text_left, y, color, right_x);
+
+	LLView::draw();
+}
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
new file mode 100644
index 0000000000..de032ac674
--- /dev/null
+++ b/indra/newview/llpersonfolderview.h
@@ -0,0 +1,93 @@
+/** 
+* @file   llpersonfolderview.h
+* @brief  Header file for llpersonfolderview
+* @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_LLPERSONFOLDERVIEW_H
+#define LL_LLPERSONFOLDERVIEW_H
+
+#include "llavatariconctrl.h"
+#include "llfolderviewitem.h"
+
+class LLPersonFolderView : public LLFolderViewFolder
+{
+
+public:
+
+	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
+	{
+		Params();
+	};
+
+	LLPersonFolderView(const LLPersonFolderView::Params& p);
+	virtual ~LLPersonFolderView();
+
+	S32 getLabelXPos();
+
+
+protected:	
+	 void draw();
+
+private:
+};
+
+class LLPersonView : public LLFolderViewItem
+{
+
+public:
+
+	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
+	{
+		Params();
+	};
+
+	LLPersonView(const LLPersonView::Params& p);
+	virtual ~LLPersonView();
+
+	 S32 getLabelXPos();
+	 void addToFolder(LLFolderViewFolder * person_folder_view);
+
+protected:	
+	void draw();
+
+private:
+
+	LLAvatarIconCtrl* mAvatarIcon;
+	LLButton * mInfoBtn;
+
+	typedef enum e_avatar_item_child {
+		ALIC_SPEAKER_INDICATOR,
+		ALIC_INFO_BUTTON,
+		ALIC_COUNT,
+	} EAvatarListItemChildIndex;
+
+	static bool	sStaticInitialized; // this variable is introduced to improve code readability
+	static S32 sChildrenWidths[ALIC_COUNT];
+	//static void initChildrenWidths(LLConversationViewParticipant* self);
+	//void updateChildren();
+	//LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
+};
+
+#endif // LL_LLPERSONFOLDERVIEW_H
+
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
new file mode 100644
index 0000000000..62208b98c9
--- /dev/null
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -0,0 +1,158 @@
+/** 
+* @file llavatarfolder.cpp
+* @brief Implementation of llavatarfolder
+* @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 "llpersonmodelcommon.h"
+
+#include "llevents.h"
+#include "llsdutil.h"
+
+//
+// LLPersonModelCommon
+// 
+
+LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) :
+LLFolderViewModelItemCommon(root_view_model),
+	mName(display_name)
+{
+}
+
+LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) :
+LLFolderViewModelItemCommon(root_view_model),
+	mName(""),
+	mID(LLUUID().generateNewID())
+{
+}
+
+LLPersonModelCommon::~LLPersonModelCommon()
+{
+
+}
+
+void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonFolderModel* folder, LLPersonModel* person)
+{
+	LLUUID folder_id = folder->getID();
+	LLUUID person_id = person->getID();
+	LLSD event(LLSDMap("type", event_type)("folder_id", folder_id)("person_id", person_id));
+	LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event);
+}
+
+// Virtual action callbacks
+void LLPersonModelCommon::performAction(LLInventoryModel* model, std::string action)
+{
+}
+
+void LLPersonModelCommon::openItem( void )
+{
+}
+
+void LLPersonModelCommon::closeItem( void )
+{
+}
+
+void LLPersonModelCommon::previewItem( void )
+{
+}
+
+void LLPersonModelCommon::showProperties(void)
+{
+}
+
+//
+// LLPersonFolderModel
+// 
+
+LLPersonFolderModel::LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(display_name,root_view_model)
+{
+
+}
+
+LLPersonFolderModel::LLPersonFolderModel(LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(root_view_model)
+{
+
+}
+
+void LLPersonFolderModel::addParticipant(LLPersonModel* participant)
+{
+	addChild(participant);
+	postEvent("add_participant", this, participant);
+}
+
+void LLPersonFolderModel::removeParticipant(LLPersonModel* participant)
+{
+	removeChild(participant);
+	postEvent("remove_participant", this, participant);
+}
+
+void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id)
+{
+	LLPersonModel* participant = findParticipant(participant_id);
+	if (participant)
+	{
+		removeParticipant(participant);
+	}
+}
+
+void LLPersonFolderModel::clearParticipants()
+{
+	clearChildren();
+}
+
+LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id)
+{
+	LLPersonModel * person_model = NULL;
+	child_list_t::iterator iter;
+
+	for(iter = mChildren.begin(); iter != mChildren.end(); ++iter)
+	{
+		person_model = static_cast<LLPersonModel *>(*iter);
+
+		if(person_model->getID() == person_id)
+		{
+			break;
+		}
+	}
+
+	return iter == mChildren.end() ? NULL : person_model;
+}
+
+//
+// LLConversationItemParticipant
+// 
+
+LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(display_name,root_view_model)
+{
+}
+
+LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(root_view_model)
+{
+}
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
new file mode 100644
index 0000000000..76ea139479
--- /dev/null
+++ b/indra/newview/llpersonmodelcommon.h
@@ -0,0 +1,132 @@
+/** 
+* @file   llavatarfolder.h
+* @brief  Header file for llavatarfolder
+* @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_LLPERSONMODELCOMMON_H
+#define LL_LLPERSONMODELCOMMON_H
+
+#include "../llui/llfolderviewitem.h"
+#include "../llui/llfolderviewmodel.h"
+
+class LLPersonFolderModel;
+class LLPersonModel;
+
+// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each  
+// that we tuck into the mConversationsListPanel. 
+class LLPersonModelCommon : public LLFolderViewModelItemCommon
+{
+public:
+
+	LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model);
+	LLPersonModelCommon(LLFolderViewModelInterface& root_view_model);
+	virtual ~LLPersonModelCommon();
+
+	// Stub those things we won't really be using in this conversation context
+	virtual const std::string& getName() const { return mName; }
+	virtual const std::string& getDisplayName() const { return mName; }
+	virtual const std::string& getSearchableName() const { return mName; }
+	virtual LLPointer<LLUIImage> getIcon() const { return NULL; }
+	virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
+	virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
+	virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
+	virtual BOOL isItemRenameable() const { return TRUE; }
+	virtual BOOL renameItem(const std::string& new_name) { mName = new_name; return TRUE; }
+	virtual BOOL isItemMovable( void ) const { return FALSE; }
+	virtual BOOL isItemRemovable( void ) const { return FALSE; }
+	virtual BOOL isItemInTrash( void) const { return FALSE; }
+	virtual BOOL removeItem() { return FALSE; }
+	virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) { }
+	virtual void move( LLFolderViewModelItem* parent_listener ) { }
+	virtual BOOL isItemCopyable() const { return FALSE; }
+	virtual BOOL copyToClipboard() const { return FALSE; }
+	virtual BOOL cutToClipboard() const { return FALSE; }
+	virtual BOOL isClipboardPasteable() const { return FALSE; }
+	virtual void pasteFromClipboard() { }
+	virtual void pasteLinkFromClipboard() { }
+	virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { }
+	virtual BOOL isUpToDate() const { return TRUE; }
+	virtual bool hasChildren() const { return FALSE; }
+
+	virtual bool potentiallyVisible() { return true; }
+	virtual bool filter( LLFolderViewFilter& filter) { return false; }
+	virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; }
+	virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { }
+	virtual bool passedFilter(S32 filter_generation = -1) { return true; }
+
+	// The action callbacks
+	virtual void performAction(LLInventoryModel* model, std::string action);
+	virtual void openItem( void );
+	virtual void closeItem( void );
+	virtual void previewItem( void );
+	virtual void selectItem(void) { } 
+	virtual void showProperties(void);
+
+	// This method will be called to determine if a drop can be
+	// performed, and will set drop to TRUE if a drop is
+	// requested. 
+	// Returns TRUE if a drop is possible/happened, FALSE otherwise.
+	virtual BOOL dragOrDrop(MASK mask, BOOL drop,
+		EDragAndDropType cargo_type,
+		void* cargo_data,
+		std::string& tooltip_msg) { return FALSE; }
+
+	const LLUUID& getID() {return mID;}
+	void postEvent(const std::string& event_type, LLPersonFolderModel* session, LLPersonModel* participant);
+
+protected:
+
+	std::string mName;	// Name of the session or the participant
+	LLUUID mID;
+};	
+
+class LLPersonFolderModel : public LLPersonModelCommon
+{
+public:
+	LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model);
+	LLPersonFolderModel(LLFolderViewModelInterface& root_view_model);
+
+	LLPointer<LLUIImage> getIcon() const { return NULL; }
+	void addParticipant(LLPersonModel* participant);
+	void removeParticipant(LLPersonModel* participant);
+	void removeParticipant(const LLUUID& participant_id);
+	void clearParticipants();
+	LLPersonModel* findParticipant(const LLUUID& person_id);
+
+private:
+};
+
+class LLPersonModel : public LLPersonModelCommon
+{
+public:
+	LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model);
+	LLPersonModel(LLFolderViewModelInterface& root_view_model);
+
+private:
+
+};
+
+
+#endif // LL_LLPERSONMODELCOMMON_H
+
diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
new file mode 100644
index 0000000000..bf22230ff9
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<conversation_view_session
+  folder_arrow_image="Folder_Arrow"
+  folder_indentation="4"
+  item_height="20" 
+  item_top_pad="0"
+  mouse_opaque="true"
+  follows="left|top|right"
+  text_pad="4"
+  text_pad_left="4"
+  text_pad_right="4"
+  arrow_size="11"
+  max_folder_item_overlap="2"/>
-- 
cgit v1.2.3


From 74f0d33dc1f81fe3d372da4b11799067349b64e7 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 22 Apr 2013 18:52:03 -0700
Subject: ACME-252: Created a folder view for the facebook connect tab

---
 indra/newview/llpersonfolderview.cpp                              | 4 ++--
 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index e1f1cbb1fa..97b2ce092b 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -43,7 +43,7 @@ LLFolderViewFolder(p)
 }
 
 S32 LLPersonFolderView::getLabelXPos()
-{
+{ 
 	return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash;
 }
 
@@ -55,7 +55,7 @@ LLPersonFolderView::~LLPersonFolderView()
 void LLPersonFolderView::draw()
 {
 	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
-	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
+	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonFolderView>();
 
 	static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
 	static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
index bf22230ff9..46857ac700 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <conversation_view_session
   folder_arrow_image="Folder_Arrow"
-  folder_indentation="4"
+  folder_indentation="5"
   item_height="20" 
-  item_top_pad="0"
+  item_top_pad="3"
   mouse_opaque="true"
   follows="left|top|right"
   text_pad="4"
   text_pad_left="4"
   text_pad_right="4"
-  arrow_size="11"
+  arrow_size="10"
   max_folder_item_overlap="2"/>
-- 
cgit v1.2.3


From f8ce67f0e0cd9afe8bd9542ea97d01769b690ffa Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Apr 2013 12:23:09 -0700
Subject: ACME-251 Create AvatarFolderItemView: Changed classes name from
 LLPersonFolder* to LLPersonTab*

---
 indra/newview/CMakeLists.txt                       |   4 +-
 indra/newview/llpanelpeople.cpp                    |  16 +--
 indra/newview/llpanelpeople.h                      |  10 +-
 indra/newview/llpersonfolderview.cpp               | 126 ---------------------
 indra/newview/llpersonfolderview.h                 |  93 ---------------
 indra/newview/llpersonmodelcommon.cpp              |  20 ++--
 indra/newview/llpersonmodelcommon.h                |  10 +-
 indra/newview/llpersontabview.cpp                  | 126 +++++++++++++++++++++
 indra/newview/llpersontabview.h                    |  93 +++++++++++++++
 .../default/xui/en/widgets/person_folder_view.xml  |  13 ---
 .../default/xui/en/widgets/person_tab_view.xml     |  13 +++
 11 files changed, 262 insertions(+), 262 deletions(-)
 delete mode 100644 indra/newview/llpersonfolderview.cpp
 delete mode 100644 indra/newview/llpersonfolderview.h
 create mode 100644 indra/newview/llpersontabview.cpp
 create mode 100644 indra/newview/llpersontabview.h
 delete mode 100644 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
 create mode 100644 indra/newview/skins/default/xui/en/widgets/person_tab_view.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 84e8811ce8..145affeb60 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -453,7 +453,7 @@ set(viewer_SOURCE_FILES
     llpathfindingpathtool.cpp
     llpersistentnotificationstorage.cpp
     llpersonmodelcommon.cpp
-    llpersonfolderview.cpp
+    llpersontabview.cpp
     llphysicsmotion.cpp
     llphysicsshapebuilderutil.cpp
     llplacesinventorybridge.cpp
@@ -1032,7 +1032,7 @@ set(viewer_HEADER_FILES
     llpathfindingpathtool.h
     llpersistentnotificationstorage.h
     llpersonmodelcommon.h
-    llpersonfolderview.h
+    llpersontabview.h
     llphysicsmotion.h
     llphysicsshapebuilderutil.h
     llplacesinventorybridge.h
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index d2d1e602be..3f4ff39644 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -64,7 +64,7 @@
 #include "llpanelpeoplemenus.h"
 #include "llparticipantlist.h"
 #include "llpersonmodelcommon.h"
-#include "llpersonfolderview.h"
+#include "llpersontabview.h"
 #include "llsidetraypanelcontainer.h"
 #include "llrecentpeople.h"
 #include "llviewercontrol.h"		// for gSavedSettings
@@ -725,13 +725,13 @@ BOOL LLPanelPeople::postBuild()
 
 	//Create a session
 	//LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance();
-	LLPersonFolderModel* item = new LLPersonFolderModel("Facebook Friends", mConversationViewModel);
-	LLPersonFolderView::Params params;
+	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mConversationViewModel);
+	LLPersonTabView::Params params;
 	params.name = item->getDisplayName();
 	params.root = mConversationsRoot;
 	params.listener = item;
 	params.tool_tip = params.name;
-	LLPersonFolderView * widget = LLUICtrlFactory::create<LLPersonFolderView>(params);
+	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
 	widget->addToFolder(mConversationsRoot);
 
 	mPersonFolderModelMap[item->getID()] = item;
@@ -1661,8 +1661,8 @@ bool LLPanelPeople::onConversationModelEvent(const LLSD& event)
 
 	if(type == "add_participant")
 	{
-		LLPersonFolderModel * person_folder_model = dynamic_cast<LLPersonFolderModel *>(mPersonFolderModelMap[folder_id]);
-		LLPersonFolderView * person_folder_view = dynamic_cast<LLPersonFolderView *>(mPersonFolderViewMap[person_id]);
+		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
+		LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[person_id]);
 		
 		if(person_folder_model)
 		{
@@ -1733,12 +1733,12 @@ void LLPanelPeople::addTestParticipant()
 {
 	for(int i = 0; i < 300; ++i)
 	{
-		LLPersonFolderModel * person_folder_model = dynamic_cast<LLPersonFolderModel *>(mPersonFolderModelMap.begin()->second);
+		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap.begin()->second);
 		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy");
 	}
 }
 
-void LLPanelPeople::addParticipantToModel(LLPersonFolderModel * person_folder_model, const LLUUID& agent_id, const std::string& name)
+void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model, const LLUUID& agent_id, const std::string& name)
 {
 	LLPersonModel* person_model = NULL;
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 935171df2b..d112ac2ec7 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -45,13 +45,13 @@ class LLMenuButton;
 class LLTabContainer;
 class LLFolderView;
 
-class LLPersonFolderModel;
-class LLPersonFolderView;
+class LLPersonTabModel;
+class LLPersonTabView;
 class LLPersonView;
 class LLPersonModel;
 
-typedef std::map<LLUUID, LLPersonFolderModel *> person_folder_model_map;
-typedef std::map<LLUUID, LLPersonFolderView *> person_folder_view_map;
+typedef std::map<LLUUID, LLPersonTabModel *> person_folder_model_map;
+typedef std::map<LLUUID, LLPersonTabView *> person_folder_view_map;
 
 class LLPanelPeople 
 	: public LLPanel
@@ -74,7 +74,7 @@ public:
 	void openFacebookWeb(LLFloaterWebContent::Params& p);
 	void showFacebookFriends(const LLSD& friends);
 	void addTestParticipant();
-	void addParticipantToModel(LLPersonFolderModel * session_model, const LLUUID& agent_id, const std::string& name);
+	void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
 	void hideFacebookFriends();
 	void loadFacebookFriends();
 	void tryToReconnectToFacebook();
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
deleted file mode 100644
index 97b2ce092b..0000000000
--- a/indra/newview/llpersonfolderview.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/** 
-* @file llpersonfolderview.cpp
-* @brief Implementation of llpersonfolderview
-* @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 "llpersonfolderview.h"
-
-static LLDefaultChildRegistry::Register<LLPersonFolderView> r_person_folder_view("person_folder_view");
-
-const LLColor4U DEFAULT_WHITE(255, 255, 255);
-
-LLPersonFolderView::Params::Params()
-{}
-
-LLPersonFolderView::LLPersonFolderView(const LLPersonFolderView::Params& p) :
-LLFolderViewFolder(p)
-{
-
-}
-
-S32 LLPersonFolderView::getLabelXPos()
-{ 
-	return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash;
-}
-
-LLPersonFolderView::~LLPersonFolderView()
-{
-
-}
-
-void LLPersonFolderView::draw()
-{
-	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
-	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonFolderView>();
-
-	static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
-	static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
-	static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
-	static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE);
-
-	const LLFontGL * font = LLFontGL::getFontSansSerif();
-	F32 text_left = (F32)getLabelXPos();
-	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
-	LLColor4 color = sFgColor;
-	F32 right_x  = 0;
-
-	drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
-	
-	updateLabelRotation();
-	drawOpenFolderArrow(default_params, sFgColor);
-
-	drawLabel(font, text_left, y, color, right_x);
-
-	LLView::draw();
-}
-
-//
-// LLPersonFolderModel
-// 
-
-
-LLPersonView::Params::Params()
-{}
-
-LLPersonView::LLPersonView(const LLPersonView::Params& p) :
-LLFolderViewItem(p)
-{
-
-}
-
-S32 LLPersonView::getLabelXPos()
-{
-	return getIndentation();
-}
-
-void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
-{
-	LLFolderViewItem::addToFolder(person_folder_view);
-	//Added item to folder, could change folder's mHasVisibleChildren flag so call arrange
-	person_folder_view->requestArrange();
-}
-
-LLPersonView::~LLPersonView()
-{
-
-}
-
-void LLPersonView::draw()
-{
-	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
-	static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
-
-	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
-	F32 text_left = (F32)getLabelXPos();
-	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
-	LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor;
-	F32 right_x  = 0;
-
-	drawLabel(font, text_left, y, color, right_x);
-
-	LLView::draw();
-}
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
deleted file mode 100644
index de032ac674..0000000000
--- a/indra/newview/llpersonfolderview.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/** 
-* @file   llpersonfolderview.h
-* @brief  Header file for llpersonfolderview
-* @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_LLPERSONFOLDERVIEW_H
-#define LL_LLPERSONFOLDERVIEW_H
-
-#include "llavatariconctrl.h"
-#include "llfolderviewitem.h"
-
-class LLPersonFolderView : public LLFolderViewFolder
-{
-
-public:
-
-	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
-	{
-		Params();
-	};
-
-	LLPersonFolderView(const LLPersonFolderView::Params& p);
-	virtual ~LLPersonFolderView();
-
-	S32 getLabelXPos();
-
-
-protected:	
-	 void draw();
-
-private:
-};
-
-class LLPersonView : public LLFolderViewItem
-{
-
-public:
-
-	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
-	{
-		Params();
-	};
-
-	LLPersonView(const LLPersonView::Params& p);
-	virtual ~LLPersonView();
-
-	 S32 getLabelXPos();
-	 void addToFolder(LLFolderViewFolder * person_folder_view);
-
-protected:	
-	void draw();
-
-private:
-
-	LLAvatarIconCtrl* mAvatarIcon;
-	LLButton * mInfoBtn;
-
-	typedef enum e_avatar_item_child {
-		ALIC_SPEAKER_INDICATOR,
-		ALIC_INFO_BUTTON,
-		ALIC_COUNT,
-	} EAvatarListItemChildIndex;
-
-	static bool	sStaticInitialized; // this variable is introduced to improve code readability
-	static S32 sChildrenWidths[ALIC_COUNT];
-	//static void initChildrenWidths(LLConversationViewParticipant* self);
-	//void updateChildren();
-	//LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
-};
-
-#endif // LL_LLPERSONFOLDERVIEW_H
-
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 62208b98c9..764dd08115 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -54,7 +54,7 @@ LLPersonModelCommon::~LLPersonModelCommon()
 
 }
 
-void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonFolderModel* folder, LLPersonModel* person)
+void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person)
 {
 	LLUUID folder_id = folder->getID();
 	LLUUID person_id = person->getID();
@@ -84,34 +84,34 @@ void LLPersonModelCommon::showProperties(void)
 }
 
 //
-// LLPersonFolderModel
+// LLPersonTabModel
 // 
 
-LLPersonFolderModel::LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
+LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
 LLPersonModelCommon(display_name,root_view_model)
 {
 
 }
 
-LLPersonFolderModel::LLPersonFolderModel(LLFolderViewModelInterface& root_view_model) :
+LLPersonTabModel::LLPersonTabModel(LLFolderViewModelInterface& root_view_model) :
 LLPersonModelCommon(root_view_model)
 {
 
 }
 
-void LLPersonFolderModel::addParticipant(LLPersonModel* participant)
+void LLPersonTabModel::addParticipant(LLPersonModel* participant)
 {
 	addChild(participant);
 	postEvent("add_participant", this, participant);
 }
 
-void LLPersonFolderModel::removeParticipant(LLPersonModel* participant)
+void LLPersonTabModel::removeParticipant(LLPersonModel* participant)
 {
 	removeChild(participant);
 	postEvent("remove_participant", this, participant);
 }
 
-void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id)
+void LLPersonTabModel::removeParticipant(const LLUUID& participant_id)
 {
 	LLPersonModel* participant = findParticipant(participant_id);
 	if (participant)
@@ -120,12 +120,12 @@ void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id)
 	}
 }
 
-void LLPersonFolderModel::clearParticipants()
+void LLPersonTabModel::clearParticipants()
 {
 	clearChildren();
 }
 
-LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id)
+LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id)
 {
 	LLPersonModel * person_model = NULL;
 	child_list_t::iterator iter;
@@ -144,7 +144,7 @@ LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id)
 }
 
 //
-// LLConversationItemParticipant
+// LLPersonModel
 // 
 
 LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index 76ea139479..866d863581 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -30,7 +30,7 @@
 #include "../llui/llfolderviewitem.h"
 #include "../llui/llfolderviewmodel.h"
 
-class LLPersonFolderModel;
+class LLPersonTabModel;
 class LLPersonModel;
 
 // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each  
@@ -93,7 +93,7 @@ public:
 		std::string& tooltip_msg) { return FALSE; }
 
 	const LLUUID& getID() {return mID;}
-	void postEvent(const std::string& event_type, LLPersonFolderModel* session, LLPersonModel* participant);
+	void postEvent(const std::string& event_type, LLPersonTabModel* session, LLPersonModel* participant);
 
 protected:
 
@@ -101,11 +101,11 @@ protected:
 	LLUUID mID;
 };	
 
-class LLPersonFolderModel : public LLPersonModelCommon
+class LLPersonTabModel : public LLPersonModelCommon
 {
 public:
-	LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model);
-	LLPersonFolderModel(LLFolderViewModelInterface& root_view_model);
+	LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model);
+	LLPersonTabModel(LLFolderViewModelInterface& root_view_model);
 
 	LLPointer<LLUIImage> getIcon() const { return NULL; }
 	void addParticipant(LLPersonModel* participant);
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
new file mode 100644
index 0000000000..156ff591f9
--- /dev/null
+++ b/indra/newview/llpersontabview.cpp
@@ -0,0 +1,126 @@
+/** 
+* @file llpersontabview.cpp
+* @brief Implementation of llpersontabview
+* @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 "llpersontabview.h"
+
+static LLDefaultChildRegistry::Register<LLPersonTabView> r_person_folder_view("person_folder_view");
+
+const LLColor4U DEFAULT_WHITE(255, 255, 255);
+
+LLPersonTabView::Params::Params()
+{}
+
+LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) :
+LLFolderViewFolder(p)
+{
+
+}
+
+S32 LLPersonTabView::getLabelXPos()
+{ 
+	return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash;
+}
+
+LLPersonTabView::~LLPersonTabView()
+{
+
+}
+
+void LLPersonTabView::draw()
+{
+	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonTabView>();
+
+	static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+	static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
+	static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+	static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE);
+
+	const LLFontGL * font = LLFontGL::getFontSansSerif();
+	F32 text_left = (F32)getLabelXPos();
+	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
+	LLColor4 color = sFgColor;
+	F32 right_x  = 0;
+
+	drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
+	
+	updateLabelRotation();
+	drawOpenFolderArrow(default_params, sFgColor);
+
+	drawLabel(font, text_left, y, color, right_x);
+
+	LLView::draw();
+}
+
+//
+// LLPersonView
+// 
+
+
+LLPersonView::Params::Params()
+{}
+
+LLPersonView::LLPersonView(const LLPersonView::Params& p) :
+LLFolderViewItem(p)
+{
+
+}
+
+S32 LLPersonView::getLabelXPos()
+{
+	return getIndentation();
+}
+
+void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
+{
+	LLFolderViewItem::addToFolder(person_folder_view);
+	//Added item to folder, could change folder's mHasVisibleChildren flag so call arrange
+	person_folder_view->requestArrange();
+}
+
+LLPersonView::~LLPersonView()
+{
+
+}
+
+void LLPersonView::draw()
+{
+	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+	static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
+
+	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
+	F32 text_left = (F32)getLabelXPos();
+	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
+	LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor;
+	F32 right_x  = 0;
+
+	drawLabel(font, text_left, y, color, right_x);
+
+	LLView::draw();
+}
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
new file mode 100644
index 0000000000..9aabad26fc
--- /dev/null
+++ b/indra/newview/llpersontabview.h
@@ -0,0 +1,93 @@
+/** 
+* @file   llpersontabview.h
+* @brief  Header file for llpersontabview
+* @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_LLPERSONTABVIEW_H
+#define LL_LLPERSONTABVIEW_H
+
+#include "llavatariconctrl.h"
+#include "llfolderviewitem.h"
+
+class LLPersonTabView : public LLFolderViewFolder
+{
+
+public:
+
+	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
+	{
+		Params();
+	};
+
+	LLPersonTabView(const LLPersonTabView::Params& p);
+	virtual ~LLPersonTabView();
+
+	S32 getLabelXPos();
+
+
+protected:	
+	 void draw();
+
+private:
+};
+
+class LLPersonView : public LLFolderViewItem
+{
+
+public:
+
+	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
+	{
+		Params();
+	};
+
+	LLPersonView(const LLPersonView::Params& p);
+	virtual ~LLPersonView();
+
+	 S32 getLabelXPos();
+	 void addToFolder(LLFolderViewFolder * person_folder_view);
+
+protected:	
+	void draw();
+
+private:
+
+	LLAvatarIconCtrl* mAvatarIcon;
+	LLButton * mInfoBtn;
+
+	typedef enum e_avatar_item_child {
+		ALIC_SPEAKER_INDICATOR,
+		ALIC_INFO_BUTTON,
+		ALIC_COUNT,
+	} EAvatarListItemChildIndex;
+
+	static bool	sStaticInitialized; // this variable is introduced to improve code readability
+	static S32 sChildrenWidths[ALIC_COUNT];
+	//static void initChildrenWidths(LLConversationViewParticipant* self);
+	//void updateChildren();
+	//LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
+};
+
+#endif // LL_LLPERSONTABVIEW_H
+
diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
deleted file mode 100644
index 46857ac700..0000000000
--- a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<conversation_view_session
-  folder_arrow_image="Folder_Arrow"
-  folder_indentation="5"
-  item_height="20" 
-  item_top_pad="3"
-  mouse_opaque="true"
-  follows="left|top|right"
-  text_pad="4"
-  text_pad_left="4"
-  text_pad_right="4"
-  arrow_size="10"
-  max_folder_item_overlap="2"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
new file mode 100644
index 0000000000..46857ac700
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<conversation_view_session
+  folder_arrow_image="Folder_Arrow"
+  folder_indentation="5"
+  item_height="20" 
+  item_top_pad="3"
+  mouse_opaque="true"
+  follows="left|top|right"
+  text_pad="4"
+  text_pad_left="4"
+  text_pad_right="4"
+  arrow_size="10"
+  max_folder_item_overlap="2"/>
-- 
cgit v1.2.3


From 2ca3612dae3258b489df8e47879f8339e24947ba Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Apr 2013 14:02:36 -0700
Subject: ACME-251 Create AvatarFolderItemView: When making the folderview
 using LLPersonModelCommon instead of LLConverationItem. Also the .xml file
 file read in for LLPersonTabView was incorrect, now using
 person_tab_view.xml. And lastly made a new file called llpersonfolderview
 which which be the implementation of folderview.

---
 indra/newview/CMakeLists.txt         |  2 ++
 indra/newview/llpanelpeople.cpp      |  2 +-
 indra/newview/llpersonfolderview.cpp | 32 +++++++++++++++++++++++++++++++
 indra/newview/llpersonfolderview.h   | 37 ++++++++++++++++++++++++++++++++++++
 indra/newview/llpersontabview.cpp    |  2 +-
 5 files changed, 73 insertions(+), 2 deletions(-)
 create mode 100644 indra/newview/llpersonfolderview.cpp
 create mode 100644 indra/newview/llpersonfolderview.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 145affeb60..52ce82560b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -452,6 +452,7 @@ set(viewer_SOURCE_FILES
     llpathfindingobjectlist.cpp
     llpathfindingpathtool.cpp
     llpersistentnotificationstorage.cpp
+    llpersonfolderview.cpp
     llpersonmodelcommon.cpp
     llpersontabview.cpp
     llphysicsmotion.cpp
@@ -1031,6 +1032,7 @@ set(viewer_HEADER_FILES
     llpathfindingobjectlist.h
     llpathfindingpathtool.h
     llpersistentnotificationstorage.h
+    llpersonfolderview.h
     llpersonmodelcommon.h
     llpersontabview.h
     llphysicsmotion.h
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 3f4ff39644..91f7c61088 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -695,7 +695,7 @@ BOOL LLPanelPeople::postBuild()
 	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
 
 	//Create folder view
-	LLConversationItem* base_item = new LLConversationItem(mConversationViewModel);
+	LLPersonModelCommon* base_item = new LLPersonModelCommon(mConversationViewModel);
 
 	LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLFolderView>());
 	folder_view_params.parent_panel = friends_tab;
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
new file mode 100644
index 0000000000..e04eda2658
--- /dev/null
+++ b/indra/newview/llpersonfolderview.cpp
@@ -0,0 +1,32 @@
+/** 
+* @file llpersonfolderview.cpp
+* @brief Implementation of llpersonfolderview
+* @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 "llpersonfolderview.h"
+
+
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
new file mode 100644
index 0000000000..f96e45abc6
--- /dev/null
+++ b/indra/newview/llpersonfolderview.h
@@ -0,0 +1,37 @@
+/** 
+* @file   llpersonfolderview.h
+* @brief  Header file for llpersonfolderview
+* @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_LLPERSONFOLDERVIEW_H
+#define LL_LLPERSONFOLDERVIEW_H
+
+#include "llfolderview.h"
+
+#endif // LL_LLPERSONFOLDERVIEW_H
+
+class LLPersonFolderView : public LLFolderView
+{
+
+};
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 156ff591f9..72a95d3f4c 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -29,7 +29,7 @@
 
 #include "llpersontabview.h"
 
-static LLDefaultChildRegistry::Register<LLPersonTabView> r_person_folder_view("person_folder_view");
+static LLDefaultChildRegistry::Register<LLPersonTabView> r_person_tab_view("person_tab_view");
 
 const LLColor4U DEFAULT_WHITE(255, 255, 255);
 
-- 
cgit v1.2.3


From 1a5ef465ef4059e05a21aae0aa2c6de610f7485f Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Apr 2013 17:14:13 -0700
Subject: ACME-251 Create AvatarFolderItemView: Now the facebook friends tab is
 using LLPersonFolderViewModel instead of mConversationViewModel

---
 indra/newview/llpanelpeople.cpp      |  8 ++--
 indra/newview/llpanelpeople.h        |  4 +-
 indra/newview/llpersonfolderview.cpp | 32 ----------------
 indra/newview/llpersonfolderview.h   | 37 ------------------
 indra/newview/llpersonmodelcommon.h  | 73 ++++++++++++++++++++++++++++++++++++
 5 files changed, 79 insertions(+), 75 deletions(-)
 delete mode 100644 indra/newview/llpersonfolderview.cpp
 delete mode 100644 indra/newview/llpersonfolderview.h

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 91f7c61088..02a286b880 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -695,12 +695,12 @@ BOOL LLPanelPeople::postBuild()
 	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
 
 	//Create folder view
-	LLPersonModelCommon* base_item = new LLPersonModelCommon(mConversationViewModel);
+	LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel);
 
 	LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLFolderView>());
 	folder_view_params.parent_panel = friends_tab;
 	folder_view_params.listener = base_item;
-	folder_view_params.view_model = &mConversationViewModel;
+	folder_view_params.view_model = &mPersonFolderViewModel;
 	folder_view_params.root = NULL;
 	folder_view_params.use_ellipses = false;
 	folder_view_params.options_menu = "menu_conversation.xml";
@@ -725,7 +725,7 @@ BOOL LLPanelPeople::postBuild()
 
 	//Create a session
 	//LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance();
-	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mConversationViewModel);
+	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
 	LLPersonTabView::Params params;
 	params.name = item->getDisplayName();
 	params.root = mConversationsRoot;
@@ -1742,7 +1742,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 {
 	LLPersonModel* person_model = NULL;
 
-	person_model = new LLPersonModel(name, mConversationViewModel);
+	person_model = new LLPersonModel(name, mPersonFolderViewModel);
 	person_folder_model->addParticipant(person_model);
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index d112ac2ec7..f1fa7ec981 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -30,7 +30,7 @@
 #include <llpanel.h>
 
 #include "llcallingcard.h" // for avatar tracker
-#include "llconversationmodel.h"
+#include "llpersonmodelcommon.h"
 #include "llevents.h"
 #include "llfloaterwebcontent.h"
 #include "llvoiceclient.h"
@@ -191,7 +191,7 @@ private:
 
 	person_folder_model_map mPersonFolderModelMap;
 	person_folder_view_map mPersonFolderViewMap;
-	LLConversationViewModel mConversationViewModel;
+	LLPersonFolderViewModel mPersonFolderViewModel;
 	LLFolderView* mConversationsRoot;
 	LLEventStream mConversationsEventStream;
 };
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
deleted file mode 100644
index e04eda2658..0000000000
--- a/indra/newview/llpersonfolderview.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/** 
-* @file llpersonfolderview.cpp
-* @brief Implementation of llpersonfolderview
-* @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 "llpersonfolderview.h"
-
-
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
deleted file mode 100644
index f96e45abc6..0000000000
--- a/indra/newview/llpersonfolderview.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/** 
-* @file   llpersonfolderview.h
-* @brief  Header file for llpersonfolderview
-* @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_LLPERSONFOLDERVIEW_H
-#define LL_LLPERSONFOLDERVIEW_H
-
-#include "llfolderview.h"
-
-#endif // LL_LLPERSONFOLDERVIEW_H
-
-class LLPersonFolderView : public LLFolderView
-{
-
-};
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index 866d863581..f3454df53f 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -127,6 +127,79 @@ private:
 
 };
 
+//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further
+
+class LLPersonViewFilter : public LLFolderViewFilter
+{
+public:
+
+	enum ESortOrderType
+	{
+		SO_NAME = 0,						// Sort by name
+		SO_DATE = 0x1,						// Sort by date (most recent)
+		SO_SESSION_TYPE = 0x2,				// Sort by type (valid only for sessions)
+		SO_DISTANCE = 0x3,					// Sort by distance (valid only for participants in nearby chat)
+	};
+	// Default sort order is by type for sessions and by date for participants
+	static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE);
+
+	LLPersonViewFilter() { mEmpty = ""; }
+	~LLPersonViewFilter() {}
+
+	bool 				check(const LLFolderViewModelItem* item) { return true; }
+	bool				checkFolder(const LLFolderViewModelItem* folder) const { return true; }
+	void 				setEmptyLookupMessage(const std::string& message) { }
+	std::string			getEmptyLookupMessage() const { return mEmpty; }
+	bool				showAllResults() const { return true; }
+	std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; }
+	std::string::size_type getFilterStringSize() const { return 0; }
+
+	bool 				isActive() const { return false; }
+	bool 				isModified() const { return false; }
+	void 				clearModified() { }
+	const std::string& 	getName() const { return mEmpty; }
+	const std::string& 	getFilterText() { return mEmpty; }
+	void 				setModified(EFilterModified behavior = FILTER_RESTART) { }
+
+	void 				setFilterCount(S32 count) { }
+	S32 				getFilterCount() const { return 0; }
+	void 				decrementFilterCount() { }
+
+	bool 				isDefault() const { return true; }
+	bool 				isNotDefault() const { return false; }
+	void 				markDefault() { }
+	void 				resetDefault() { }
+
+	S32 				getCurrentGeneration() const { return 0; }
+	S32 				getFirstSuccessGeneration() const { return 0; }
+	S32 				getFirstRequiredGeneration() const { return 0; }
+private:
+	std::string mEmpty;
+};
+
+class LLPersonViewSort
+{
+public:
+	LLPersonViewSort(U32 order = LLPersonViewFilter::SO_DEFAULT) : mSortOrder(order) { }
+
+	bool operator()(const LLPersonModelCommon* const& a, const LLPersonModelCommon* const& b) const {return false;}
+	operator U32() const { return mSortOrder; }
+private:
+	// Note: we're treating this value as a sort order bitmask as done in other places in the code (e.g. inventory)
+	U32  mSortOrder;
+};
+
+
+class LLPersonFolderViewModel
+	: public  LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter>
+{
+public:
+	typedef LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter> base_t;
+
+	void sort(LLFolderViewFolder* folder) { base_t::sort(folder);}
+	bool startDrag(std::vector<LLFolderViewModelItem*>& items) { return false; } // We do not allow drag of conversation items
+};
+
 
 #endif // LL_LLPERSONMODELCOMMON_H
 
-- 
cgit v1.2.3


From 6aa08021c75d2674002c766b3bc02ea8773ee35f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 23 Apr 2013 17:15:22 -0700
Subject: Fix build failures on Mac : suppress cruft that tripped gcc

---
 indra/newview/llpersontabview.cpp | 2 +-
 indra/newview/llsociallist.cpp    | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 72a95d3f4c..fff72c7758 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -117,7 +117,7 @@ void LLPersonView::draw()
 	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
 	F32 text_left = (F32)getLabelXPos();
 	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
-	LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor;
+	LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor;
 	F32 right_x  = 0;
 
 	drawLabel(font, text_left, y, color, right_x);
diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp
index bcf6d5a63c..9f827cf04f 100644
--- a/indra/newview/llsociallist.cpp
+++ b/indra/newview/llsociallist.cpp
@@ -1,4 +1,3 @@
-sDestroyImmediate
 /** 
 * @file llsociallist.cpp
 * @brief Implementation of llsociallist
@@ -37,7 +36,7 @@ sDestroyImmediate
 #include "llavatarnamecache.h"
 #include "lloutputmonitorctrl.h"
 #include "lltextutil.h"
-    
+
 static LLDefaultChildRegistry::Register<LLSocialList> r("social_list");
 
 LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p)
-- 
cgit v1.2.3


From b9d9a40273dc574c95b3a83587c526eb140c9922 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Apr 2013 17:16:43 -0700
Subject: ACME-251 Create AvatarFolderItemView: forgot to remove deleted files
 from indra/newview/CMakeLists.txt.

---
 indra/newview/CMakeLists.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 52ce82560b..145affeb60 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -452,7 +452,6 @@ set(viewer_SOURCE_FILES
     llpathfindingobjectlist.cpp
     llpathfindingpathtool.cpp
     llpersistentnotificationstorage.cpp
-    llpersonfolderview.cpp
     llpersonmodelcommon.cpp
     llpersontabview.cpp
     llphysicsmotion.cpp
@@ -1032,7 +1031,6 @@ set(viewer_HEADER_FILES
     llpathfindingobjectlist.h
     llpathfindingpathtool.h
     llpersistentnotificationstorage.h
-    llpersonfolderview.h
     llpersonmodelcommon.h
     llpersontabview.h
     llphysicsmotion.h
-- 
cgit v1.2.3


From 955cc72f90413d5c28023d7d6a0a4ac58d04e74a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Apr 2013 18:38:54 -0700
Subject: ACME-251 Create AvatarFolderItemView: Re-adding
 llpersonfolderview.h/cpp and to use a class called LLPersonFolderView to
 manage the creation of subwidgits and selection of tabs.

---
 indra/newview/CMakeLists.txt         |  2 +
 indra/newview/llpanelpeople.cpp      | 58 +++---------------------
 indra/newview/llpanelpeople.h        | 19 +-------
 indra/newview/llpersonfolderview.cpp | 88 ++++++++++++++++++++++++++++++++++++
 indra/newview/llpersonfolderview.h   | 63 ++++++++++++++++++++++++++
 5 files changed, 161 insertions(+), 69 deletions(-)
 create mode 100644 indra/newview/llpersonfolderview.cpp
 create mode 100644 indra/newview/llpersonfolderview.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 145affeb60..52ce82560b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -452,6 +452,7 @@ set(viewer_SOURCE_FILES
     llpathfindingobjectlist.cpp
     llpathfindingpathtool.cpp
     llpersistentnotificationstorage.cpp
+    llpersonfolderview.cpp
     llpersonmodelcommon.cpp
     llpersontabview.cpp
     llphysicsmotion.cpp
@@ -1031,6 +1032,7 @@ set(viewer_HEADER_FILES
     llpathfindingobjectlist.h
     llpathfindingpathtool.h
     llpersistentnotificationstorage.h
+    llpersonfolderview.h
     llpersonmodelcommon.h
     llpersontabview.h
     llphysicsmotion.h
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 02a286b880..c4ce56cb4f 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -63,6 +63,7 @@
 #include "llnetmap.h"
 #include "llpanelpeoplemenus.h"
 #include "llparticipantlist.h"
+#include "llpersonfolderview.h"
 #include "llpersonmodelcommon.h"
 #include "llpersontabview.h"
 #include "llsidetraypanelcontainer.h"
@@ -549,7 +550,6 @@ LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
 		mConnectedToFbc(false),
 		mConversationsRoot(NULL),
-		mConversationsEventStream("ConversationsEventsTwo"),
 		mTryToConnectToFbc(true),
 		mTabContainer(NULL),
 		mOnlineFriendList(NULL),
@@ -605,8 +605,6 @@ LLPanelPeople::~LLPanelPeople()
 	}
 
 	if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die();
-
-	mConversationsEventStream.stopListening("ConversationsRefresh");
 }
 
 void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
@@ -697,7 +695,7 @@ BOOL LLPanelPeople::postBuild()
 	//Create folder view
 	LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel);
 
-	LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLFolderView>());
+	LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLPersonFolderView>());
 	folder_view_params.parent_panel = friends_tab;
 	folder_view_params.listener = base_item;
 	folder_view_params.view_model = &mPersonFolderViewModel;
@@ -705,8 +703,7 @@ BOOL LLPanelPeople::postBuild()
 	folder_view_params.use_ellipses = false;
 	folder_view_params.options_menu = "menu_conversation.xml";
 	folder_view_params.name = "fbcfolderview";
-	mConversationsRoot = LLUICtrlFactory::create<LLFolderView>(folder_view_params);
-	mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPanelPeople::onConversationModelEvent, this, _1));
+	mConversationsRoot = LLUICtrlFactory::create<LLPersonFolderView>(folder_view_params);
 
 	//Create scroller
 	LLRect scroller_view_rect = socialtwo_tab->getRect();
@@ -734,8 +731,8 @@ BOOL LLPanelPeople::postBuild()
 	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
 	widget->addToFolder(mConversationsRoot);
 
-	mPersonFolderModelMap[item->getID()] = item;
-	mPersonFolderViewMap[item->getID()] = widget;
+	mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
+	mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
 	
 	gIdleCallbacks.addFunction(idle, this);
 
@@ -1653,49 +1650,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
-bool LLPanelPeople::onConversationModelEvent(const LLSD& event)
-{
-	std::string type = event.get("type").asString();
-	LLUUID folder_id = event.get("folder_id").asUUID();
-	LLUUID person_id = event.get("person_id").asUUID();
-
-	if(type == "add_participant")
-	{
-		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
-		LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[person_id]);
-		
-		if(person_folder_model)
-		{
-			LLPersonModel * person_model = person_folder_model->findParticipant(person_id);
-
-			if(person_model)
-			{
-				LLPersonView * participant_view = createConversationViewParticipant(person_model);
-				participant_view->addToFolder(person_folder_view);
-			}
-		}
-	}
-
-	return false;
-}
-
-LLPersonView * LLPanelPeople::createConversationViewParticipant(LLPersonModel * item)
-{
-	LLPersonView::Params params;
-	LLRect panel_rect = getChild<LLPanel>(FBCTESTTWO_TAB_NAME)->getRect();
-
-	params.name = item->getDisplayName();
-	params.root = mConversationsRoot;
-	params.listener = item;
-
-	//24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml.
-	params.rect = LLRect (0, 24, panel_rect.getWidth(), 0);
-	params.tool_tip = params.name;
-	params.folder_indentation = 2;
-
-	return LLUICtrlFactory::create<LLPersonView>(params);
-}
-
 void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 {
 	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
@@ -1733,7 +1687,7 @@ void LLPanelPeople::addTestParticipant()
 {
 	for(int i = 0; i < 300; ++i)
 	{
-		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap.begin()->second);
+		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mConversationsRoot->mPersonFolderModelMap.begin()->second);
 		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy");
 	}
 }
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index f1fa7ec981..a448b7935e 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -31,7 +31,6 @@
 
 #include "llcallingcard.h" // for avatar tracker
 #include "llpersonmodelcommon.h"
-#include "llevents.h"
 #include "llfloaterwebcontent.h"
 #include "llvoiceclient.h"
 
@@ -40,18 +39,10 @@ class LLAvatarListSocial;
 class LLAvatarName;
 class LLFilterEditor;
 class LLGroupList;
+class LLPersonFolderView;
 class LLSocialList;
 class LLMenuButton;
 class LLTabContainer;
-class LLFolderView;
-
-class LLPersonTabModel;
-class LLPersonTabView;
-class LLPersonView;
-class LLPersonModel;
-
-typedef std::map<LLUUID, LLPersonTabModel *> person_folder_model_map;
-typedef std::map<LLUUID, LLPersonTabView *> person_folder_view_map;
 
 class LLPanelPeople 
 	: public LLPanel
@@ -164,9 +155,6 @@ private:
 	bool					isAccordionCollapsedByUser(LLUICtrl* acc_tab);
 	bool					isAccordionCollapsedByUser(const std::string& name);
 
-	bool					onConversationModelEvent(const LLSD& event);
-	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
-
 	LLTabContainer*			mTabContainer;
 	LLAvatarList*			mOnlineFriendList;
 	LLAvatarList*			mAllFriendList;
@@ -189,11 +177,8 @@ private:
 	LLMenuButton*			mFBCGearButton;
     LLHandle< LLFloater >	mPicker;
 
-	person_folder_model_map mPersonFolderModelMap;
-	person_folder_view_map mPersonFolderViewMap;
 	LLPersonFolderViewModel mPersonFolderViewModel;
-	LLFolderView* mConversationsRoot;
-	LLEventStream mConversationsEventStream;
+	LLPersonFolderView* mConversationsRoot;
 };
 
 #endif //LL_LLPANELPEOPLE_H
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
new file mode 100644
index 0000000000..d94c8cf32f
--- /dev/null
+++ b/indra/newview/llpersonfolderview.cpp
@@ -0,0 +1,88 @@
+/** 
+* @file llpersonfolderview.cpp
+* @brief Implementation of llpersonfolderview
+* @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 "llpersonfolderview.h"
+
+#include "llpersontabview.h"
+#include "llpersonmodelcommon.h"
+
+
+LLPersonFolderView::LLPersonFolderView(const Params &p) : 
+LLFolderView(p),
+	mConversationsEventStream("ConversationsEventsTwo")
+{
+	mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1));
+}
+
+LLPersonFolderView::~LLPersonFolderView()
+{
+	mConversationsEventStream.stopListening("ConversationsRefresh");
+}
+
+bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
+{
+	std::string type = event.get("type").asString();
+	LLUUID folder_id = event.get("folder_id").asUUID();
+	LLUUID person_id = event.get("person_id").asUUID();
+
+	if(type == "add_participant")
+	{
+		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
+		LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[person_id]);
+
+		if(person_folder_model)
+		{
+			LLPersonModel * person_model = person_folder_model->findParticipant(person_id);
+
+			if(person_model)
+			{
+				LLPersonView * participant_view = createConversationViewParticipant(person_model);
+				participant_view->addToFolder(person_folder_view);
+			}
+		}
+	}
+
+	return false;
+}
+
+LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonModel * item)
+{
+	LLPersonView::Params params;
+
+	params.name = item->getDisplayName();
+	params.root = this;
+	params.listener = item;
+
+	//24 should be loaded from .xml somehow
+	params.rect = LLRect (0, 24, getRect().getWidth(), 0);
+	params.tool_tip = params.name;
+	params.folder_indentation = 2;
+
+	return LLUICtrlFactory::create<LLPersonView>(params);
+}
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
new file mode 100644
index 0000000000..60260dc5ea
--- /dev/null
+++ b/indra/newview/llpersonfolderview.h
@@ -0,0 +1,63 @@
+/** 
+* @file   llpersonfolderview.h
+* @brief  Header file for llpersonfolderview
+* @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_LLPERSONFOLDERVIEW_H
+#define LL_LLPERSONFOLDERVIEW_H
+
+class LLPersonTabModel;
+class LLPersonTabView;
+class LLPersonView;
+class LLPersonModel;
+
+typedef std::map<LLUUID, LLPersonTabModel *> person_folder_model_map;
+typedef std::map<LLUUID, LLPersonTabView *> person_folder_view_map;
+
+#include "llevents.h"
+#include "llfolderview.h"
+
+class LLPersonFolderView : public LLFolderView
+{
+public:
+	struct Params : public LLInitParam::Block<Params, LLFolderView::Params>
+	{
+		Params()
+		{}
+	};
+
+	LLPersonFolderView(const Params &p);
+	~LLPersonFolderView();
+
+	bool onConversationModelEvent(const LLSD &event);
+
+	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
+
+	person_folder_model_map mPersonFolderModelMap;
+	person_folder_view_map mPersonFolderViewMap;
+	LLEventStream mConversationsEventStream;
+};
+
+#endif // LL_LLPERSONFOLDERVIEW_H
+
-- 
cgit v1.2.3


From 4921c654939d118cb4f9847512d6e3008c67428f Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 25 Apr 2013 00:10:09 +0100
Subject: added SLApp for fbc

---
 indra/newview/llpanelpeople.cpp | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index c4ce56cb4f..04881a12f1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -75,6 +75,8 @@
 #include "llsociallist.h"
 #include "llspeakers.h"
 #include "llfloaterwebcontent.h"
+#include "llurlaction.h"
+#include "llcommandhandler.h"
 
 #define FRIEND_LIST_UPDATE_TIMEOUT	0.5
 #define NEARBY_LIST_UPDATE_INTERVAL 1
@@ -92,6 +94,36 @@ static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc";
 static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect";
 
+class LLFacebookConnectHandler : public LLCommandHandler
+{
+public:
+	LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE), mPanelPeople(NULL) { }
+
+	LLPanelPeople* mPanelPeople;
+
+	bool handle(const LLSD& tokens, const LLSD& query_map,
+				LLMediaCtrl* web)
+	{
+		if (tokens.size() > 0)
+		{
+			if (tokens[0].asString() == "connect")
+			{
+				if (query_map.has("code"))
+				{
+					if (mPanelPeople)
+					{
+						mPanelPeople->connectToFacebook(query_map["code"]);
+						return true;
+					}
+				}
+			}
+		}
+
+		return false;
+	}
+};
+LLFacebookConnectHandler gFacebookConnectHandler;
+
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
 {
@@ -1652,6 +1684,9 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 
 void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
 {
+	gFacebookConnectHandler.mPanelPeople = this;
+	LLUrlAction::openURLExternal(p.url);
+	
 	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
 
 	if (browser)
-- 
cgit v1.2.3


From 1787988c47921478598c5f47828f3dde8922ffa6 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 24 Apr 2013 17:41:49 -0700
Subject: ACME-251 Create AvatarFolderItemView: Adding in code to make the
 persontab's function more like accordiontabs

---
 indra/newview/llpanelpeople.cpp      | 13 ++++++++++++-
 indra/newview/llpersonfolderview.cpp | 19 +++++++++++++++++++
 indra/newview/llpersonfolderview.h   |  3 ++-
 indra/newview/llpersontabview.cpp    | 17 +++++++++++++++--
 indra/newview/llpersontabview.h      |  2 ++
 5 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 04881a12f1..16dc252946 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -753,7 +753,6 @@ BOOL LLPanelPeople::postBuild()
 	mConversationsRoot->setFollowsAll();
 
 	//Create a session
-	//LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance();
 	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
 	LLPersonTabView::Params params;
 	params.name = item->getDisplayName();
@@ -763,6 +762,18 @@ BOOL LLPanelPeople::postBuild()
 	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
 	widget->addToFolder(mConversationsRoot);
 
+	mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
+	mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
+
+	//Create a session
+	item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel);
+	params.name = item->getDisplayName();
+	params.root = mConversationsRoot;
+	params.listener = item;
+	params.tool_tip = params.name;
+	widget = LLUICtrlFactory::create<LLPersonTabView>(params);
+	widget->addToFolder(mConversationsRoot);
+
 	mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
 	mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
 	
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index d94c8cf32f..dac3dd03c7 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -45,6 +45,25 @@ LLPersonFolderView::~LLPersonFolderView()
 	mConversationsEventStream.stopListening("ConversationsRefresh");
 }
 
+BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+	LLFolderViewItem * prior_item = getCurSelectedItem();
+	LLFolderViewItem * current_item;
+
+	bool selected_item = LLFolderView::handleMouseDown(x, y, mask);
+
+	current_item = getCurSelectedItem();
+	
+	LLPersonTabView * prior_folder = dynamic_cast<LLPersonTabView *>(prior_item);
+
+	if(prior_folder && current_item != prior_folder)
+	{
+		prior_folder->highlight = false;
+	}
+
+	return selected_item;
+}
+
 bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
 {
 	std::string type = event.get("type").asString();
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
index 60260dc5ea..74e9142a7c 100644
--- a/indra/newview/llpersonfolderview.h
+++ b/indra/newview/llpersonfolderview.h
@@ -51,9 +51,10 @@ public:
 	~LLPersonFolderView();
 
 	bool onConversationModelEvent(const LLSD &event);
-
 	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
 
+	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
+
 	person_folder_model_map mPersonFolderModelMap;
 	person_folder_view_map mPersonFolderViewMap;
 	LLEventStream mConversationsEventStream;
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index fff72c7758..20db0572fc 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -37,7 +37,8 @@ LLPersonTabView::Params::Params()
 {}
 
 LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) :
-LLFolderViewFolder(p)
+LLFolderViewFolder(p),
+highlight(false)
 {
 
 }
@@ -52,6 +53,18 @@ LLPersonTabView::~LLPersonTabView()
 
 }
 
+BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+	bool selected_item = LLFolderViewFolder::handleMouseDown(x, y, mask);
+
+	if(selected_item)
+	{
+		highlight = true;
+	}
+
+	return selected_item;
+}
+
 void LLPersonTabView::draw()
 {
 	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
@@ -68,7 +81,7 @@ void LLPersonTabView::draw()
 	LLColor4 color = sFgColor;
 	F32 right_x  = 0;
 
-	drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
+	drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
 	
 	updateLabelRotation();
 	drawOpenFolderArrow(default_params, sFgColor);
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 9aabad26fc..df3f786c69 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -44,7 +44,9 @@ public:
 	virtual ~LLPersonTabView();
 
 	S32 getLabelXPos();
+	bool highlight;
 
+	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
 
 protected:	
 	 void draw();
-- 
cgit v1.2.3


From 06e1b03362d021e5bdce25a20a78663fdaf7650f Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 25 Apr 2013 11:33:58 -0700
Subject: ACME-251: Create AvatarFolderItemView: Fixed a bug that was causing
 facebook friends to not be inserted into the proper friends tab.

---
 indra/newview/llpersonfolderview.cpp  | 2 +-
 indra/newview/llpersonmodelcommon.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index dac3dd03c7..97f5d5a03a 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -73,7 +73,7 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
 	if(type == "add_participant")
 	{
 		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
-		LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[person_id]);
+		LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[folder_id]);
 
 		if(person_folder_model)
 		{
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 764dd08115..bea7f3d45e 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -38,7 +38,8 @@
 
 LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) :
 LLFolderViewModelItemCommon(root_view_model),
-	mName(display_name)
+	mName(display_name),
+	mID(LLUUID().generateNewID())
 {
 }
 
-- 
cgit v1.2.3


From 4562efdc7418923caa88bcf0c68a177f772c044b Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 25 Apr 2013 16:29:02 -0700
Subject: ACME-251: This should be final commit for this task, now the
 peopletab looks like the accordion tab.

---
 indra/newview/llpersonfolderview.cpp               | 25 ++++++----
 indra/newview/llpersontabview.cpp                  | 58 ++++++++++++++++++++--
 indra/newview/llpersontabview.h                    |  7 +++
 .../default/xui/en/widgets/person_tab_view.xml     |  4 +-
 4 files changed, 77 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 97f5d5a03a..8141eecc35 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -47,21 +47,24 @@ LLPersonFolderView::~LLPersonFolderView()
 
 BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
 {
-	LLFolderViewItem * prior_item = getCurSelectedItem();
-	LLFolderViewItem * current_item;
+	LLFolderViewItem * item = getCurSelectedItem();
 
-	bool selected_item = LLFolderView::handleMouseDown(x, y, mask);
-
-	current_item = getCurSelectedItem();
-	
-	LLPersonTabView * prior_folder = dynamic_cast<LLPersonTabView *>(prior_item);
-
-	if(prior_folder && current_item != prior_folder)
+	//Will disable highlight on tab
+	if(item)
 	{
-		prior_folder->highlight = false;
+		LLPersonTabView * person_tab= dynamic_cast<LLPersonTabView *>(item);
+		if(person_tab)
+		{
+			person_tab->highlight = false;
+		}
+		else
+		{
+			person_tab = dynamic_cast<LLPersonTabView *>(item->getParent());
+			person_tab->highlight = false;
+		}
 	}
 
-	return selected_item;
+	return LLFolderView::handleMouseDown(x, y, mask);
 }
 
 bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 20db0572fc..3556878b91 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -38,9 +38,11 @@ LLPersonTabView::Params::Params()
 
 LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) :
 LLFolderViewFolder(p),
-highlight(false)
+highlight(false),
+mImageHeader(LLUI::getUIImage("Accordion_Off")),
+mImageHeaderOver(LLUI::getUIImage("Accordion_Over")),
+mImageHeaderFocused(LLUI::getUIImage("Accordion_Selected"))
 {
-
 }
 
 S32 LLPersonTabView::getLabelXPos()
@@ -73,7 +75,7 @@ void LLPersonTabView::draw()
 	static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
 	static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
 	static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
-	static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE);
+	
 
 	const LLFontGL * font = LLFontGL::getFontSansSerif();
 	F32 text_left = (F32)getLabelXPos();
@@ -81,8 +83,9 @@ void LLPersonTabView::draw()
 	LLColor4 color = sFgColor;
 	F32 right_x  = 0;
 
-	drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
+	//drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
 	
+	drawHighlight();
 	updateLabelRotation();
 	drawOpenFolderArrow(default_params, sFgColor);
 
@@ -91,6 +94,53 @@ void LLPersonTabView::draw()
 	LLView::draw();
 }
 
+void LLPersonTabView::drawHighlight()
+{
+	S32 width = getRect().getWidth();
+	S32 height = mItemHeight;
+	S32 x = 1;
+	S32 y = getRect().getHeight() - mItemHeight;
+
+	//const S32 FOCUS_LEFT = 1;
+	//const S32 focus_top = getRect().getHeight();
+	//const S32 focus_bottom = getRect().getHeight() - mItemHeight;
+	//static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE);
+	//static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+
+	if(highlight)
+	{
+		//reference will remove
+		/*gl_rect_2d(FOCUS_LEFT,
+			focus_top,
+			getRect().getWidth() - 2,
+			focus_bottom,
+			sMouseOverColor, TRUE);*/
+		mImageHeaderFocused->draw(x,y,width,height);
+	}
+	else
+	{
+		//reference will remove
+		/*gl_rect_2d(FOCUS_LEFT,
+			focus_top,
+			getRect().getWidth() - 2,
+			focus_bottom,
+			bgColor, TRUE);*/
+		mImageHeader->draw(x,y,width,height);
+	}
+
+	if(mIsMouseOverTitle)
+	{
+		//reference will remove
+		/*gl_rect_2d(FOCUS_LEFT,
+			focus_top,
+			getRect().getWidth() - 2,
+			focus_bottom,
+			sMouseOverColor, TRUE);*/
+		mImageHeaderOver->draw(x,y,width,height);
+	}
+
+}
+
 //
 // LLPersonView
 // 
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index df3f786c69..35cb219ce2 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -50,8 +50,15 @@ public:
 
 protected:	
 	 void draw();
+	 void drawHighlight();
 
 private:
+
+	// Background images
+	LLPointer<LLUIImage> mImageHeader;
+	LLPointer<LLUIImage> mImageHeaderOver;
+	LLPointer<LLUIImage> mImageHeaderFocused;
+
 };
 
 class LLPersonView : public LLFolderViewItem
diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
index 46857ac700..b36011763a 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
@@ -2,11 +2,11 @@
 <conversation_view_session
   folder_arrow_image="Folder_Arrow"
   folder_indentation="5"
-  item_height="20" 
+  item_height="24" 
   item_top_pad="3"
   mouse_opaque="true"
   follows="left|top|right"
-  text_pad="4"
+  text_pad="5"
   text_pad_left="4"
   text_pad_right="4"
   arrow_size="10"
-- 
cgit v1.2.3


From 7902e05c9f52e16d3e505f9d7a8852743a212586 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 25 Apr 2013 17:38:54 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now the sub items of the
 persontab are drawn with different highlights depending on if they are
 selected or moused over.

---
 indra/newview/llpersontabview.cpp                  | 63 +++++++++++-----------
 indra/newview/llpersontabview.h                    |  4 ++
 .../default/xui/en/widgets/person_tab_view.xml     |  2 +-
 .../skins/default/xui/en/widgets/person_view.xml   | 13 +++++
 4 files changed, 49 insertions(+), 33 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/widgets/person_view.xml

diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 3556878b91..dc55f627d6 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -72,19 +72,12 @@ void LLPersonTabView::draw()
 	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
 	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonTabView>();
 
-	static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
-	static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
-	static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
-	
-
 	const LLFontGL * font = LLFontGL::getFontSansSerif();
 	F32 text_left = (F32)getLabelXPos();
 	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
 	LLColor4 color = sFgColor;
 	F32 right_x  = 0;
 
-	//drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
-	
 	drawHighlight();
 	updateLabelRotation();
 	drawOpenFolderArrow(default_params, sFgColor);
@@ -101,41 +94,17 @@ void LLPersonTabView::drawHighlight()
 	S32 x = 1;
 	S32 y = getRect().getHeight() - mItemHeight;
 
-	//const S32 FOCUS_LEFT = 1;
-	//const S32 focus_top = getRect().getHeight();
-	//const S32 focus_bottom = getRect().getHeight() - mItemHeight;
-	//static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE);
-	//static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
-
 	if(highlight)
 	{
-		//reference will remove
-		/*gl_rect_2d(FOCUS_LEFT,
-			focus_top,
-			getRect().getWidth() - 2,
-			focus_bottom,
-			sMouseOverColor, TRUE);*/
 		mImageHeaderFocused->draw(x,y,width,height);
 	}
 	else
 	{
-		//reference will remove
-		/*gl_rect_2d(FOCUS_LEFT,
-			focus_top,
-			getRect().getWidth() - 2,
-			focus_bottom,
-			bgColor, TRUE);*/
 		mImageHeader->draw(x,y,width,height);
 	}
 
 	if(mIsMouseOverTitle)
 	{
-		//reference will remove
-		/*gl_rect_2d(FOCUS_LEFT,
-			focus_top,
-			getRect().getWidth() - 2,
-			focus_bottom,
-			sMouseOverColor, TRUE);*/
 		mImageHeaderOver->draw(x,y,width,height);
 	}
 
@@ -145,12 +114,15 @@ void LLPersonTabView::drawHighlight()
 // LLPersonView
 // 
 
+static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
 
 LLPersonView::Params::Params()
 {}
 
 LLPersonView::LLPersonView(const LLPersonView::Params& p) :
-LLFolderViewItem(p)
+LLFolderViewItem(p),
+mImageOver(LLUI::getUIImage("ListItem_Over")),
+mImageSelected(LLUI::getUIImage("ListItem_Select"))
 {
 
 }
@@ -183,7 +155,34 @@ void LLPersonView::draw()
 	LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor;
 	F32 right_x  = 0;
 
+	drawHighlight();
 	drawLabel(font, text_left, y, color, right_x);
 
 	LLView::draw();
 }
+
+void LLPersonView::drawHighlight()
+{
+	static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE);
+
+	S32 width = getRect().getWidth();
+	S32 height = mItemHeight;
+	S32 x = 1;
+	S32 y = 0;
+
+	if(mIsSelected)
+	{
+		mImageSelected->draw(x, y, width, height);
+		//Need to find a better color that matches the outline in avatarlistitem
+		gl_rect_2d(x, 
+			height, 
+			width,
+			y,
+			outline_color, FALSE);
+	}
+
+	if(mIsMouseOverTitle)
+	{
+		mImageOver->draw(x, y, width, height);
+	}
+}
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 35cb219ce2..b246be288a 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -79,9 +79,13 @@ public:
 
 protected:	
 	void draw();
+	void drawHighlight();
 
 private:
 
+	LLPointer<LLUIImage> mImageOver;
+	LLPointer<LLUIImage> mImageSelected;
+
 	LLAvatarIconCtrl* mAvatarIcon;
 	LLButton * mInfoBtn;
 
diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
index b36011763a..d46938d3b7 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
@@ -6,7 +6,7 @@
   item_top_pad="3"
   mouse_opaque="true"
   follows="left|top|right"
-  text_pad="5"
+  text_pad="6"
   text_pad_left="4"
   text_pad_right="4"
   arrow_size="10"
diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml
new file mode 100644
index 0000000000..d46938d3b7
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<conversation_view_session
+  folder_arrow_image="Folder_Arrow"
+  folder_indentation="5"
+  item_height="24" 
+  item_top_pad="3"
+  mouse_opaque="true"
+  follows="left|top|right"
+  text_pad="6"
+  text_pad_left="4"
+  text_pad_right="4"
+  arrow_size="10"
+  max_folder_item_overlap="2"/>
-- 
cgit v1.2.3


From 228a312cf68088a8388a9318d1c8d23aaa52eaab Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 26 Apr 2013 09:49:48 -0700
Subject: ACME-252 Create AvatarFolderItemView: Corrected person_tab_view.xml
 and person_view.xml to have the proper parent tag. It was
 conversation_view_session for both which was wrong. Also updated the selected
 color for the personview.

---
 indra/newview/llpersontabview.cpp                              | 2 +-
 indra/newview/skins/default/xui/en/widgets/person_tab_view.xml | 2 +-
 indra/newview/skins/default/xui/en/widgets/person_view.xml     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index dc55f627d6..3093ff9015 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -163,7 +163,7 @@ void LLPersonView::draw()
 
 void LLPersonView::drawHighlight()
 {
-	static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE);
+	static LLUIColor outline_color = LLUIColorTable::instance().getColor("EmphasisColor", DEFAULT_WHITE);
 
 	S32 width = getRect().getWidth();
 	S32 height = mItemHeight;
diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
index d46938d3b7..af5aec2c34 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<conversation_view_session
+<person_tab_view
   folder_arrow_image="Folder_Arrow"
   folder_indentation="5"
   item_height="24" 
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 d46938d3b7..13aa26959f 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<conversation_view_session
+<person_view
   folder_arrow_image="Folder_Arrow"
   folder_indentation="5"
   item_height="24" 
-- 
cgit v1.2.3


From a246717b8126f0d4aec9144029c9daba793063d8 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 26 Apr 2013 10:10:31 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now when connecting to facebook
 using the + button the fctest two tab is populated.

---
 indra/newview/llpanelpeople.cpp | 40 ++++++++++++++++++++--------------------
 indra/newview/llpanelpeople.h   |  2 +-
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 16dc252946..ab8d090cb6 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -581,7 +581,7 @@ private:
 LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
 		mConnectedToFbc(false),
-		mConversationsRoot(NULL),
+		mPersonFolderView(NULL),
 		mTryToConnectToFbc(true),
 		mTabContainer(NULL),
 		mOnlineFriendList(NULL),
@@ -735,7 +735,7 @@ BOOL LLPanelPeople::postBuild()
 	folder_view_params.use_ellipses = false;
 	folder_view_params.options_menu = "menu_conversation.xml";
 	folder_view_params.name = "fbcfolderview";
-	mConversationsRoot = LLUICtrlFactory::create<LLPersonFolderView>(folder_view_params);
+	mPersonFolderView = LLUICtrlFactory::create<LLPersonFolderView>(folder_view_params);
 
 	//Create scroller
 	LLRect scroller_view_rect = socialtwo_tab->getRect();
@@ -747,35 +747,35 @@ BOOL LLPanelPeople::postBuild()
 
 	LLScrollContainer* scroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
 	socialtwo_tab->addChildInBack(scroller);
-	scroller->addChild(mConversationsRoot);
+	scroller->addChild(mPersonFolderView);
 	scroller->setFollowsAll();
-	mConversationsRoot->setScrollContainer(scroller);
-	mConversationsRoot->setFollowsAll();
+	mPersonFolderView->setScrollContainer(scroller);
+	mPersonFolderView->setFollowsAll();
 
 	//Create a session
 	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
 	LLPersonTabView::Params params;
 	params.name = item->getDisplayName();
-	params.root = mConversationsRoot;
+	params.root = mPersonFolderView;
 	params.listener = item;
 	params.tool_tip = params.name;
 	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
-	widget->addToFolder(mConversationsRoot);
+	widget->addToFolder(mPersonFolderView);
 
-	mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
-	mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
+	mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
+	mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
 
 	//Create a session
 	item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel);
 	params.name = item->getDisplayName();
-	params.root = mConversationsRoot;
+	params.root = mPersonFolderView;
 	params.listener = item;
 	params.tool_tip = params.name;
 	widget = LLUICtrlFactory::create<LLPersonTabView>(params);
-	widget->addToFolder(mConversationsRoot);
+	widget->addToFolder(mPersonFolderView);
 
-	mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
-	mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
+	mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
+	mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
 	
 	gIdleCallbacks.addFunction(idle, this);
 
@@ -865,7 +865,7 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI,
 void LLPanelPeople::idle(void * user_data)
 {
 	LLPanelPeople * self = static_cast<LLPanelPeople *>(user_data);
-	self->mConversationsRoot->update();
+	self->mPersonFolderView->update();
 }
 
 void LLPanelPeople::updateFriendListHelpText()
@@ -1721,11 +1721,11 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		mFacebookFriends->addNewItem(agent_id, name, false);
 
 		//Add to folder view
-		//LLConversationItemSession * session_model = dynamic_cast<LLConversationItemSession *>(mConversationsItems[LLUUID(NULL)]);
-		//if(session_model)
-		//{
-		//	addParticipantToModel(session_model, agent_id, name);
-		//}
+		LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
+		if(session_model)
+		{
+			addParticipantToModel(session_model, agent_id, name);
+		}
 	}
 }
 
@@ -1733,7 +1733,7 @@ void LLPanelPeople::addTestParticipant()
 {
 	for(int i = 0; i < 300; ++i)
 	{
-		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mConversationsRoot->mPersonFolderModelMap.begin()->second);
+		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
 		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy");
 	}
 }
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index a448b7935e..497871bedb 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -178,7 +178,7 @@ private:
     LLHandle< LLFloater >	mPicker;
 
 	LLPersonFolderViewModel mPersonFolderViewModel;
-	LLPersonFolderView* mConversationsRoot;
+	LLPersonFolderView* mPersonFolderView;
 };
 
 #endif //LL_LLPANELPEOPLE_H
-- 
cgit v1.2.3


From e1dbbd0213dd96e28aec2c5e6d9fd821ab144e48 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 26 Apr 2013 21:26:38 +0100
Subject: removed internal browser hack for getting auth code in favor of
 SLApp-only approach

---
 indra/newview/llappviewer.cpp   | 15 ++++-----
 indra/newview/llpanelpeople.cpp | 67 +++++------------------------------------
 indra/newview/llpanelpeople.h   |  2 +-
 3 files changed, 16 insertions(+), 68 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 53c694eaca..31f7f61396 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2577,19 +2577,20 @@ bool LLAppViewer::initConfiguration()
     // What can happen is that someone can use IE (or potentially 
     // other browsers) and do the rough equivalent of command 
     // injection and steal passwords. Phoenix. SL-55321
+	LLSLURL option_slurl;
     if(clp.hasOption("url"))
     {
-		LLStartUp::setStartSLURL(LLSLURL(clp.getOption("url")[0]));
+		option_slurl = LLSLURL(clp.getOption("url")[0]);
+		LLStartUp::setStartSLURL(option_slurl);
 		if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION) 
 		{  
 			LLGridManager::getInstance()->setGridChoice(LLStartUp::getStartSLURL().getGrid());
-			
-		}  
+		}
     }
     else if(clp.hasOption("slurl"))
     {
-		LLSLURL start_slurl(clp.getOption("slurl")[0]);
-		LLStartUp::setStartSLURL(start_slurl);
+		option_slurl = LLSLURL(clp.getOption("slurl")[0]);
+		LLStartUp::setStartSLURL(option_slurl);
     }
 
 	const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent");
@@ -2686,10 +2687,10 @@ bool LLAppViewer::initConfiguration()
 	// it relies on checking a marker file which will not work when running
 	// out of different directories
 
-	if (LLStartUp::getStartSLURL().isValid() &&
+	if (option_slurl.isValid() &&
 		(gSavedSettings.getBOOL("SLURLPassToOtherInstance")))
 	{
-		if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString()))
+		if (sendURLToOtherInstance(option_slurl.getSLURLString()))
 		{
 			// successfully handed off URL to existing instance, exit
 			return false;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ab8d090cb6..86303cee70 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -113,6 +113,7 @@ public:
 					if (mPanelPeople)
 					{
 						mPanelPeople->connectToFacebook(query_map["code"]);
+						mPanelPeople = NULL;
 						return true;
 					}
 				}
@@ -970,46 +971,7 @@ void LLPanelPeople::updateRecentList()
 
 void LLPanelPeople::updateFbcTestList()
 {
-	if (mFbcTestBrowserHandle.get())
-	{
-		// get the current browser url (from the title bar, of course!)
-		std::string url = mFbcTestBrowserHandle.get()->getTitle();
-
-		// if the browser has redirected from facebook
-		if (url.find(getFacebookRedirectURL()) == 0)
-		{
-			// find the auth code in the url
-			std::string begin_string = "code=";
-			std::string end_string = "#";
-			size_t begin_index = begin_string.length() + url.find(begin_string, getFacebookRedirectURL().length());
-			size_t end_index = url.find(end_string, begin_index);
-
-			// extract the auth code from the url
-			std::string auth_code;
-			if (end_index != std::string::npos)
-			{
-				auth_code = url.substr(begin_index, end_index - begin_index);
-			}
-			else
-			{
-				auth_code = url.substr(begin_index);
-			}
-			llinfos << "extracted code " << auth_code << " from url " << url << llendl;
-			
-			// finish authenticating on the server
-			connectToFacebook(auth_code);
-
-			// close the browser window
-			mFbcTestBrowserHandle.get()->die();
-
-			// get rid of the handle
-			mFbcTestBrowserHandle = LLHandle<LLFloater>();
-			
-			// stop updating
-			mFbcTestListUpdater->setActive(false);
-		}
-	}
-	else if (mTryToConnectToFbc)
+	if (mTryToConnectToFbc)
 	{	
 		// try to reconnect to facebook!
 		tryToReconnectToFacebook();
@@ -1693,19 +1655,10 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
-void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p)
+void LLPanelPeople::openFacebookWeb(std::string url)
 {
 	gFacebookConnectHandler.mPanelPeople = this;
-	LLUrlAction::openURLExternal(p.url);
-	
-	LLFloater* browser = LLFloaterReg::showInstance("web_content", p);
-
-	if (browser)
-	{
-		// start checking the browser to see if the data is available yet
-		mFbcTestBrowserHandle = browser->getHandle();
-		mFbcTestListUpdater->setActive(true);
-	}
+	LLUrlAction::openURLExternal(url);
 }
 
 void LLPanelPeople::showFacebookFriends(const LLSD& friends)
@@ -1827,9 +1780,7 @@ public:
 			// show the facebook login page if not connected yet
 			if (status == 404 && mShowLoginIfNotConnected)
 			{
-				LLFloaterWebContent::Params p;
-				p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL());
-				mPanelPeople->openFacebookWeb(p);
+				mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL());
 			}
 		}
 	}
@@ -1914,16 +1865,12 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
-	LLFloaterWebContent::Params p;
-	p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL());
-	openFacebookWeb(p);
+	openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL());
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
-	LLFloaterWebContent::Params p;
-	p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL());
-	openFacebookWeb(p);
+	openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL());
 }
 
 static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test");
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 497871bedb..95105309d2 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -62,7 +62,7 @@ public:
 
 	static void idle(void * user_data);
 
-	void openFacebookWeb(LLFloaterWebContent::Params& p);
+	void openFacebookWeb(std::string url);
 	void showFacebookFriends(const LLSD& friends);
 	void addTestParticipant();
 	void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
-- 
cgit v1.2.3


From f36171b8cae93bdaf6d3df2bf964313d1da087b6 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 26 Apr 2013 23:35:28 +0100
Subject: made sendURLToOtherInstance() happen before viewer window actually
 appears, in the event of an external browser launching a SLApp

---
 indra/newview/llappviewer.cpp | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 31f7f61396..e97c264af3 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2577,7 +2577,9 @@ bool LLAppViewer::initConfiguration()
     // What can happen is that someone can use IE (or potentially 
     // other browsers) and do the rough equivalent of command 
     // injection and steal passwords. Phoenix. SL-55321
+
 	LLSLURL option_slurl;
+
     if(clp.hasOption("url"))
     {
 		option_slurl = LLSLURL(clp.getOption("url")[0]);
@@ -2592,6 +2594,21 @@ bool LLAppViewer::initConfiguration()
 		option_slurl = LLSLURL(clp.getOption("slurl")[0]);
 		LLStartUp::setStartSLURL(option_slurl);
     }
+	
+	//RN: if we received a URL, hand it off to the existing instance.
+	// don't call anotherInstanceRunning() when doing URL handoff, as
+	// it relies on checking a marker file which will not work when running
+	// out of different directories
+
+	if (option_slurl.isValid() &&
+		(gSavedSettings.getBOOL("SLURLPassToOtherInstance")))
+	{
+		if (sendURLToOtherInstance(option_slurl.getSLURLString()))
+		{
+			// successfully handed off URL to existing instance, exit
+			return false;
+		}
+	}
 
 	const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent");
 	if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString())
@@ -2682,21 +2699,6 @@ bool LLAppViewer::initConfiguration()
 #endif
 	LLStringUtil::truncate(gWindowTitle, 255);
 
-	//RN: if we received a URL, hand it off to the existing instance.
-	// don't call anotherInstanceRunning() when doing URL handoff, as
-	// it relies on checking a marker file which will not work when running
-	// out of different directories
-
-	if (option_slurl.isValid() &&
-		(gSavedSettings.getBOOL("SLURLPassToOtherInstance")))
-	{
-		if (sendURLToOtherInstance(option_slurl.getSLURLString()))
-		{
-			// successfully handed off URL to existing instance, exit
-			return false;
-		}
-	}
-
 	if (!gSavedSettings.getBOOL("AllowMultipleViewers"))
 	{
 	    //
-- 
cgit v1.2.3


From 743720f41454af16193789859a5b2048bad30b7e Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 26 Apr 2013 18:50:45 -0700
Subject: ACME-272 : Add the top toolbar to the FBC panel 2

---
 indra/newview/llpanelpeople.cpp                    |  8 +-
 .../newview/skins/default/xui/en/panel_people.xml  | 92 +++++++++++++++++++++-
 2 files changed, 96 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 86303cee70..12d8f6b83a 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -672,6 +672,7 @@ BOOL LLPanelPeople::postBuild()
 	getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 	getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 	getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+	getChild<LLFilterEditor>("fbc_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
 
 	mTabContainer = getChild<LLTabContainer>("tabs");
 	mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2));
@@ -729,7 +730,8 @@ BOOL LLPanelPeople::postBuild()
 	LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel);
 
 	LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLPersonFolderView>());
-	folder_view_params.parent_panel = friends_tab;
+    
+	folder_view_params.parent_panel = socialtwo_tab;
 	folder_view_params.listener = base_item;
 	folder_view_params.view_model = &mPersonFolderViewModel;
 	folder_view_params.root = NULL;
@@ -740,8 +742,8 @@ BOOL LLPanelPeople::postBuild()
 
 	//Create scroller
 	LLRect scroller_view_rect = socialtwo_tab->getRect();
-	scroller_view_rect.mTop -= 4;
-	scroller_view_rect.mRight -=6;
+	scroller_view_rect.mTop -= 2+27; // 27 is the height of the top toolbar
+	scroller_view_rect.mRight -= 4;
 	scroller_view_rect.mLeft += 2;
 	LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams<LLFolderViewScrollContainer>());
 	scroller_params.rect(scroller_view_rect);
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index c4db547a8e..9bab2ccb0b 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -633,6 +633,9 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            top="0"
            right="-1" />
         </panel>
+        
+<!-- ================================= FBC TEST tab (Temporary) ========================== -->
+        
         <panel
            background_opaque="true"
            background_visible="true"
@@ -725,6 +728,9 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
              />
           </panel>
         </panel>
+        
+<!-- ================================= FBC TEST TWO tab (Final, to be renamed) ========================== -->
+        
         <panel
            background_opaque="true"
            background_visible="true"
@@ -737,6 +743,90 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            left="0"
            help_topic="people_fbctest_tab"
            name="fbctesttwo_panel"
-           top="0"/>      
+           top="0">
+            <panel
+                follows="left|top|right"
+                height="27"
+                label="bottom_panel"
+                layout="topleft"
+                left="0"
+                name="fbc_buttons_panel"
+                right="-1"
+                top="0">
+                <filter_editor
+                follows="left|top|right"
+                height="23"
+                layout="topleft"
+                left="6"
+                label="Filter People"
+                max_length_chars="300"
+                name="fbc_filter_input"
+                text_color="Black"
+                text_pad_left="10"
+                top="4"
+                width="177" />
+                <button
+                commit_callback.function="People.Gear"
+                follows="right"
+                height="25"
+                image_hover_unselected="Toolbar_Middle_Over"
+                image_overlay="OptionsMenu_Off"
+                image_selected="Toolbar_Middle_Selected"
+                image_unselected="Toolbar_Middle_Off"
+                layout="topleft"
+                left_pad="8"
+                name="gear_btn"
+                tool_tip="Actions on selected person"
+                top="3"
+                width="31" />
+                <menu_button
+                follows="right"
+                height="25"
+                image_hover_unselected="Toolbar_Middle_Over"
+                image_overlay="Conv_toolbar_sort"
+                image_selected="Toolbar_Middle_Selected"
+                image_unselected="Toolbar_Middle_Off"
+                layout="topleft"
+                left_pad="2"
+                menu_filename="menu_people_friends_view.xml"
+                menu_position="bottomleft"
+                name="fbc_view_btn"
+                tool_tip="View/sort options"
+                top_delta="0"
+                width="31" />
+                <button
+                    follows="right"
+                    height="25"
+                    image_hover_unselected="Toolbar_Middle_Over"
+                    image_overlay="AddItem_Off"
+                    image_selected="Toolbar_Middle_Selected"
+                    image_unselected="Toolbar_Middle_Off"
+                    layout="topleft"
+                    left_pad="2"
+                    name="fbc_add_btn"
+                    tool_tip="Offer friendship to a resident"
+                    top_delta="0"
+                    width="31">
+                    <commit_callback
+                    function="People.AddFriendWizard" />
+                </button>
+                <dnd_button
+                    follows="right"
+                    height="25"
+                    image_hover_unselected="Toolbar_Middle_Over"
+                    image_overlay="TrashItem_Off"
+                    image_selected="Toolbar_Middle_Selected"
+                    image_unselected="Toolbar_Middle_Off"
+                    left_pad="2"
+                    layout="topleft"
+                    name="fbc_del_btn"
+                    tool_tip="Remove selected person as a friend"
+                    top_delta="0"
+                    width="31">
+                    <commit_callback
+                    function="People.DelFriend" />
+                </dnd_button>
+            </panel>
+        </panel>
     </tab_container>
 </panel>
-- 
cgit v1.2.3


From 59880225108ef807ef58ed98357f0706c045ff61 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 29 Apr 2013 10:59:09 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now the avatar icon will
 display but it is not yet functional

---
 indra/newview/llpanelpeople.cpp                          |  4 ++--
 indra/newview/llpersontabview.cpp                        | 16 +++++++++++++---
 indra/newview/llpersontabview.h                          |  2 ++
 .../newview/skins/default/xui/en/widgets/person_view.xml | 14 +++++++++++++-
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 12d8f6b83a..ef45cc44f7 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -755,7 +755,7 @@ BOOL LLPanelPeople::postBuild()
 	mPersonFolderView->setScrollContainer(scroller);
 	mPersonFolderView->setFollowsAll();
 
-	//Create a session
+	//Create a person tab
 	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
 	LLPersonTabView::Params params;
 	params.name = item->getDisplayName();
@@ -768,7 +768,7 @@ BOOL LLPanelPeople::postBuild()
 	mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
 	mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
 
-	//Create a session
+	//Create a person tab
 	item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel);
 	params.name = item->getDisplayName();
 	params.root = mPersonFolderView;
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 3093ff9015..e0bda32308 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -116,20 +116,22 @@ void LLPersonTabView::drawHighlight()
 
 static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
 
-LLPersonView::Params::Params()
+LLPersonView::Params::Params() :
+avatar_icon("avatar_icon")
 {}
 
 LLPersonView::LLPersonView(const LLPersonView::Params& p) :
 LLFolderViewItem(p),
 mImageOver(LLUI::getUIImage("ListItem_Over")),
-mImageSelected(LLUI::getUIImage("ListItem_Select"))
+mImageSelected(LLUI::getUIImage("ListItem_Select")),
+mAvatarIcon(NULL)
 {
 
 }
 
 S32 LLPersonView::getLabelXPos()
 {
-	return getIndentation();
+	return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;
 }
 
 void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
@@ -186,3 +188,11 @@ void LLPersonView::drawHighlight()
 		mImageOver->draw(x, y, width, height);
 	}
 }
+
+void LLPersonView::initFromParams(const LLPersonView::Params & params)
+{
+	LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon());
+	applyXUILayout(avatar_icon_params, this);
+	mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params);
+	addChild(mAvatarIcon);
+}
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index b246be288a..e1b34e1da4 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -69,6 +69,7 @@ public:
 	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
 	{
 		Params();
+		Optional<LLAvatarIconCtrl::Params> avatar_icon;
 	};
 
 	LLPersonView(const LLPersonView::Params& p);
@@ -76,6 +77,7 @@ public:
 
 	 S32 getLabelXPos();
 	 void addToFolder(LLFolderViewFolder * person_folder_view);
+	 void initFromParams(const LLPersonView::Params & params);
 
 protected:	
 	void draw();
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 13aa26959f..84ad807b83 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -6,8 +6,20 @@
   item_top_pad="3"
   mouse_opaque="true"
   follows="left|top|right"
+  icon_pad="4"
+  icon_width="20"
   text_pad="6"
   text_pad_left="4"
   text_pad_right="4"
   arrow_size="10"
-  max_folder_item_overlap="2"/>
+  max_folder_item_overlap="2">
+    <avatar_icon
+      follows="left"
+      layout="topleft"
+      height="20"
+      default_icon_name="Generic_Person"
+      left="5"
+      top="2"
+      width="20" />
+ </person_view>
+
-- 
cgit v1.2.3


From 0ce0d897f4e8bed87299b88b3ac24812bfe6afbd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 29 Apr 2013 17:01:47 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now the personview contains all
 icons that the avatarlistitem view contains.

---
 indra/newview/llpersonfolderview.cpp               |  1 -
 indra/newview/llpersontabview.cpp                  | 64 +++++++++++++++--
 indra/newview/llpersontabview.h                    | 35 ++++++++--
 .../skins/default/xui/en/widgets/person_view.xml   | 81 ++++++++++++++++++++++
 4 files changed, 172 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 8141eecc35..636d093e0e 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -104,7 +104,6 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod
 	//24 should be loaded from .xml somehow
 	params.rect = LLRect (0, 24, getRect().getWidth(), 0);
 	params.tool_tip = params.name;
-	params.folder_indentation = 2;
 
 	return LLUICtrlFactory::create<LLPersonView>(params);
 }
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index e0bda32308..eaa112e051 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -117,16 +117,32 @@ void LLPersonTabView::drawHighlight()
 static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
 
 LLPersonView::Params::Params() :
-avatar_icon("avatar_icon")
+avatar_icon("avatar_icon"),
+last_interaction_time_textbox("last_interaction_time_textbox"),
+permission_edit_theirs_icon("permission_edit_theirs_icon"),
+permission_edit_mine_icon("permission_edit_mine_icon"),
+permission_map_icon("permission_map_icon"),
+permission_online_icon("permission_online_icon"),
+info_btn("info_btn"),
+profile_btn("profile_btn"),
+output_monitor("output_monitor")
 {}
 
 LLPersonView::LLPersonView(const LLPersonView::Params& p) :
 LLFolderViewItem(p),
 mImageOver(LLUI::getUIImage("ListItem_Over")),
 mImageSelected(LLUI::getUIImage("ListItem_Select")),
-mAvatarIcon(NULL)
+mAvatarIcon(NULL),
+mLastInteractionTimeTextbox(NULL),
+mPermissionEditTheirsIcon(NULL),
+mPermissionEditMineIcon(NULL),
+mPermissionMapIcon(NULL),
+mPermissionOnlineIcon(NULL),
+mInfoBtn(NULL),
+mProfileBtn(NULL),
+mOutputMonitorCtrl(NULL)
 {
-
+	initChildrenWidths(this);
 }
 
 S32 LLPersonView::getLabelXPos()
@@ -175,7 +191,7 @@ void LLPersonView::drawHighlight()
 	if(mIsSelected)
 	{
 		mImageSelected->draw(x, y, width, height);
-		//Need to find a better color that matches the outline in avatarlistitem
+		//Draw outline
 		gl_rect_2d(x, 
 			height, 
 			width,
@@ -195,4 +211,44 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params)
 	applyXUILayout(avatar_icon_params, this);
 	mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params);
 	addChild(mAvatarIcon);
+	
+	LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox());
+	applyXUILayout(last_interaction_time_textbox, this);
+	mLastInteractionTimeTextbox = LLUICtrlFactory::create<LLTextBox>(last_interaction_time_textbox);
+	addChild(mLastInteractionTimeTextbox);
+
+	LLIconCtrl::Params permission_edit_theirs_icon(params.permission_edit_theirs_icon());
+	applyXUILayout(permission_edit_theirs_icon, this);
+	mPermissionEditTheirsIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_theirs_icon);
+	addChild(mPermissionEditTheirsIcon);
+
+	LLIconCtrl::Params permission_map_icon(params.permission_map_icon());
+	applyXUILayout(permission_map_icon, this);
+	mPermissionMapIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_map_icon);
+	addChild(mPermissionMapIcon);
+
+	LLIconCtrl::Params permission_online_icon(params.permission_online_icon());
+	applyXUILayout(permission_online_icon, this);
+	mPermissionOnlineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_online_icon);
+	addChild(mPermissionOnlineIcon);
+
+	LLButton::Params info_btn(params.info_btn());
+	applyXUILayout(info_btn, this);
+	mInfoBtn = LLUICtrlFactory::create<LLButton>(info_btn);
+	addChild(mInfoBtn);
+
+	LLButton::Params profile_btn(params.profile_btn());
+	applyXUILayout(profile_btn, this);
+	mProfileBtn = LLUICtrlFactory::create<LLButton>(profile_btn);
+	addChild(mProfileBtn);
+	
+	LLOutputMonitorCtrl::Params output_monitor(params.output_monitor());
+	applyXUILayout(output_monitor, this);
+	mOutputMonitorCtrl = LLUICtrlFactory::create<LLOutputMonitorCtrl>(output_monitor);
+	addChild(mOutputMonitorCtrl);
+}
+
+void LLPersonView::initChildrenWidths(LLPersonView* self)
+{
+
 }
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index e1b34e1da4..d8d1a65df6 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -28,7 +28,10 @@
 #define LL_LLPERSONTABVIEW_H
 
 #include "llavatariconctrl.h"
+#include "llbutton.h"
 #include "llfolderviewitem.h"
+#include "lloutputmonitorctrl.h"
+#include "lltextbox.h"
 
 class LLPersonTabView : public LLFolderViewFolder
 {
@@ -70,6 +73,14 @@ public:
 	{
 		Params();
 		Optional<LLAvatarIconCtrl::Params> avatar_icon;
+		Optional<LLTextBox::Params> last_interaction_time_textbox;
+		Optional<LLIconCtrl::Params> permission_edit_theirs_icon;
+		Optional<LLIconCtrl::Params> permission_edit_mine_icon;
+		Optional<LLIconCtrl::Params> permission_map_icon;
+		Optional<LLIconCtrl::Params> permission_online_icon;
+		Optional<LLButton::Params> info_btn;
+		Optional<LLButton::Params> profile_btn;
+		Optional<LLOutputMonitorCtrl::Params> output_monitor;
 	};
 
 	LLPersonView(const LLPersonView::Params& p);
@@ -89,18 +100,34 @@ private:
 	LLPointer<LLUIImage> mImageSelected;
 
 	LLAvatarIconCtrl* mAvatarIcon;
+	LLTextBox * mLastInteractionTimeTextbox;
+	LLIconCtrl * mPermissionEditTheirsIcon;
+	LLIconCtrl * mPermissionEditMineIcon;
+	LLIconCtrl * mPermissionMapIcon;
+	LLIconCtrl * mPermissionOnlineIcon;
 	LLButton * mInfoBtn;
+	LLButton * mProfileBtn;
+	LLOutputMonitorCtrl * mOutputMonitorCtrl;
+
+
 
 	typedef enum e_avatar_item_child {
 		ALIC_SPEAKER_INDICATOR,
+		ALIC_PROFILE_BUTTON,
 		ALIC_INFO_BUTTON,
+		ALIC_PERMISSION_ONLINE,
+		ALIC_PERMISSION_MAP,
+		ALIC_PERMISSION_EDIT_MINE,
+		ALIC_PERMISSION_EDIT_THEIRS,
+		ALIC_INTERACTION_TIME,
 		ALIC_COUNT,
 	} EAvatarListItemChildIndex;
 
-	static bool	sStaticInitialized; // this variable is introduced to improve code readability
-	static S32 sChildrenWidths[ALIC_COUNT];
-	//static void initChildrenWidths(LLConversationViewParticipant* self);
-	//void updateChildren();
+	static bool	sStaticInitialized;
+	static S32 sMouseOverChildrenWidths[ALIC_COUNT];
+	static S32 sMouseOverChildren[ALIC_COUNT];
+	static void initChildrenWidths(LLPersonView* self);
+	void updateChildren();
 	//LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
 };
 
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 84ad807b83..d257a5114f 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -21,5 +21,86 @@
       left="5"
       top="2"
       width="20" />
+    <last_interaction_time_textbox
+      layout="topleft"
+      follows="right"
+      font="SansSerifSmall"
+      height="15"
+      left_pad="5"
+      right="-164"
+      name="last_interaction_time_textbox"
+      text_color="LtGray_50"
+      value="0s"
+      width="35" />
+    <permission_edit_theirs_icon
+      layout="topleft"
+      height="16"
+      follows="right"
+      image_name="Permission_Edit_Objects_Theirs"
+      left_pad="3"
+      right="-129"
+      name="permission_edit_theirs_icon"
+      tool_tip="You can edit this friend&apos;s objects"
+      top="4"
+      width="16" />
+    <permission_edit_mine_icon
+      layout="topleft"
+      height="16"
+      follows="right"
+      image_name="Permission_Edit_Objects_Mine"
+      left_pad="3"
+      right="-110"
+      name="permission_edit_mine_icon"
+      tool_tip="This friend can edit, delete or take your objects"
+      width="16" />
+    <permission_map_icon
+      height="16"
+      follows="right"
+      image_name="Permission_Visible_Map"
+      left_pad="3"
+      tool_tip="This friend can locate you on the map"
+      right="-91"
+      name="permission_map_icon"
+      width="16" />
+    <permission_online_icon
+      height="16"
+      follows="right"
+      image_name="Permission_Visible_Online"
+      left_pad="3"
+      right="-72"
+      name="permission_online_icon"
+      tool_tip="This friend can see when you&apos;re online"
+      width="16" />
+    <info_btn
+      follows="right"
+      height="16"
+      image_pressed="Info_Press"
+      image_unselected="Info_Over"
+      left_pad="3"
+      right="-53"
+      name="info_btn"
+      tool_tip="More info"
+      tab_stop="false"
+      width="16" />
+    <profile_btn
+      follows="right"
+      height="20"
+      image_overlay="Web_Profile_Off"
+      left_pad="5"
+      right="-28"
+      name="profile_btn"
+      tab_stop="false"
+      tool_tip="View profile"
+      top_delta="-2"
+      width="20" />
+    <output_monitor
+      auto_update="true"
+      follows="right"
+      draw_border="false"
+      height="16"
+      right="-3"
+      mouse_opaque="true"
+      name="speaking_indicator"
+      width="20" />
  </person_view>
 
-- 
cgit v1.2.3


From 548b75f3fdec08227c5d41424e3af90fbe455208 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 30 Apr 2013 01:40:46 +0100
Subject: updated to grab FB URLs from server

---
 indra/newview/llpanelpeople.cpp | 35 ++++++++++++++++++++---------------
 indra/newview/llpanelpeople.h   |  3 +--
 2 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ef45cc44f7..712a116873 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -91,9 +91,6 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string FBCTESTTWO_TAB_NAME	= "fbctesttwo_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
-static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc";
-static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect";
-
 class LLFacebookConnectHandler : public LLCommandHandler
 {
 public:
@@ -1729,6 +1726,14 @@ public:
 			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
 		}
 	}
+
+	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (status == 302)
+		{
+			mPanelPeople->openFacebookWeb(content["location"]);
+		}
+	}
 };
 
 class FacebookDisconnectResponder : public LLHTTPClient::Responder
@@ -1782,7 +1787,7 @@ public:
 			// show the facebook login page if not connected yet
 			if (status == 404 && mShowLoginIfNotConnected)
 			{
-				mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL());
+				mPanelPeople->connectToFacebook();
 			}
 		}
 	}
@@ -1810,6 +1815,14 @@ public:
 			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
 		}
 	}
+
+	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (status == 302)
+		{
+			mPanelPeople->openFacebookWeb(content["location"]);
+		}
+	}
 };
 
 void LLPanelPeople::loadFacebookFriends()
@@ -1828,8 +1841,9 @@ void LLPanelPeople::tryToReconnectToFacebook()
 void LLPanelPeople::connectToFacebook(const std::string& auth_code)
 {
 	LLSD body;
-	body["code"] = auth_code;
-	body["redirect_uri"] = getFacebookRedirectURL();
+	if (!auth_code.empty())
+		body["code"] = auth_code;
+
 	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this));
 }
 
@@ -1846,13 +1860,6 @@ std::string LLPanelPeople::getFacebookConnectURL(const std::string& route)
 	return url;
 }
 
-std::string LLPanelPeople::getFacebookRedirectURL()
-{
-	static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect");
-	llinfos << sFacebookRedirectUrl << llendl;
-	return sFacebookRedirectUrl;
-}	
-
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
 	if (mConnectedToFbc)
@@ -1867,12 +1874,10 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
-	openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL());
 }
 
 void LLPanelPeople::onFacebookAppSendClicked()
 {
-	openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL());
 }
 
 static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test");
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 95105309d2..943d84ac1d 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -69,11 +69,10 @@ public:
 	void hideFacebookFriends();
 	void loadFacebookFriends();
 	void tryToReconnectToFacebook();
-	void connectToFacebook(const std::string& auth_code);
+	void connectToFacebook(const std::string& auth_code = "");
 	void disconnectFromFacebook();
 	
 	std::string getFacebookConnectURL(const std::string& route = "");
-	std::string getFacebookRedirectURL();
 	
 	bool mConnectedToFbc;
 	bool mTryToConnectToFbc;
-- 
cgit v1.2.3


From a3a0d665022e9b0a9ab99f41d4a989af3fafb122 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 29 Apr 2013 18:55:23 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now mouse over of peopleview
 items show the info button and profile button.

---
 indra/newview/llpersontabview.cpp                  | 77 +++++++++++++++++++++-
 indra/newview/llpersontabview.h                    | 16 +++--
 .../skins/default/xui/en/widgets/person_view.xml   |  9 +++
 3 files changed, 95 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index eaa112e051..fa7bc09e10 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -142,7 +142,6 @@ mInfoBtn(NULL),
 mProfileBtn(NULL),
 mOutputMonitorCtrl(NULL)
 {
-	initChildrenWidths(this);
 }
 
 S32 LLPersonView::getLabelXPos()
@@ -162,6 +161,29 @@ LLPersonView::~LLPersonView()
 
 }
 
+BOOL LLPersonView::postBuild()
+{
+	initChildrenWidths(this);
+	updateChildren();
+	return LLFolderViewItem::postBuild();
+}
+
+void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask)
+{
+	mInfoBtn->setVisible(TRUE);
+	mProfileBtn->setVisible(TRUE);
+	updateChildren();
+	LLFolderViewItem::onMouseEnter(x, y, mask);
+}
+
+void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+	mInfoBtn->setVisible(FALSE);
+	mProfileBtn->setVisible(FALSE);
+	updateChildren();
+	LLFolderViewItem::onMouseLeave(x, y, mask);
+}
+
 void LLPersonView::draw()
 {
 	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
@@ -222,6 +244,11 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params)
 	mPermissionEditTheirsIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_theirs_icon);
 	addChild(mPermissionEditTheirsIcon);
 
+	LLIconCtrl::Params permission_edit_mine_icon(params.permission_edit_mine_icon());
+	applyXUILayout(permission_edit_mine_icon, this);
+	mPermissionEditMineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_mine_icon);
+	addChild(mPermissionEditMineIcon);
+
 	LLIconCtrl::Params permission_map_icon(params.permission_map_icon());
 	applyXUILayout(permission_map_icon, this);
 	mPermissionMapIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_map_icon);
@@ -250,5 +277,53 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params)
 
 void LLPersonView::initChildrenWidths(LLPersonView* self)
 {
+	S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft;
+	S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft;
+	S32 info_btn_width = self->mProfileBtn->getRect().mLeft - self->mInfoBtn->getRect().mLeft;
+	S32 permission_online_icon_width = self->mInfoBtn->getRect().mLeft - self->mPermissionOnlineIcon->getRect().mLeft;
+	S32 permissions_map_icon_width = self->mPermissionOnlineIcon->getRect().mLeft - self->mPermissionMapIcon->getRect().mLeft;
+	S32 permission_edit_mine_icon_width = self->mPermissionMapIcon->getRect().mLeft - self->mPermissionEditMineIcon->getRect().mLeft;
+	S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft;
+	S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft;
+
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mOutputMonitorCtrl, output_monitor_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mProfileBtn, profile_btn_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mInfoBtn, info_btn_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionOnlineIcon, permission_online_icon_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionMapIcon, permissions_map_icon_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionEditMineIcon, permission_edit_mine_icon_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionEditTheirsIcon, permission_edit_theirs_icon_width));
+	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mLastInteractionTimeTextbox, last_interaction_time_textbox_width));
 
 }
+
+void LLPersonView::updateChildren()
+{
+	mLabelPaddingRight = 0;
+	LLView * control;
+	S32 control_width;
+	LLRect control_rect;
+
+	for(S32 i = 0; i < mChildAndWidthVec.size(); ++i)
+	{
+		control = mChildAndWidthVec[i].first;
+
+		if(!control->getVisible())
+		{
+			continue;
+		}
+
+		control_width = mChildAndWidthVec[i].second;
+		mLabelPaddingRight += control_width;
+
+		control_rect = control->getRect();
+		control_rect.setLeftTopAndSize(
+			getLocalRect().getWidth() - mLabelPaddingRight,
+			control_rect.mTop,
+			control_rect.getWidth(),
+			control_rect.getHeight());
+
+		control->setShape(control_rect);
+
+	}
+}
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index d8d1a65df6..56d7f4eade 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -86,11 +86,15 @@ public:
 	LLPersonView(const LLPersonView::Params& p);
 	virtual ~LLPersonView();
 
-	 S32 getLabelXPos();
-	 void addToFolder(LLFolderViewFolder * person_folder_view);
-	 void initFromParams(const LLPersonView::Params & params);
+	S32 getLabelXPos();
+	void addToFolder(LLFolderViewFolder * person_folder_view);
+	void initFromParams(const LLPersonView::Params & params);
+	BOOL postBuild();
+	void onMouseEnter(S32 x, S32 y, MASK mask);
+	void onMouseLeave(S32 x, S32 y, MASK mask);
 
 protected:	
+	
 	void draw();
 	void drawHighlight();
 
@@ -123,12 +127,12 @@ private:
 		ALIC_COUNT,
 	} EAvatarListItemChildIndex;
 
+	typedef std::vector<std::pair<LLView *, S32>> ChildAndWidthVec;
+	ChildAndWidthVec mChildAndWidthVec;
+
 	static bool	sStaticInitialized;
-	static S32 sMouseOverChildrenWidths[ALIC_COUNT];
-	static S32 sMouseOverChildren[ALIC_COUNT];
 	static void initChildrenWidths(LLPersonView* self);
 	void updateChildren();
-	//LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
 };
 
 #endif // LL_LLPERSONTABVIEW_H
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 d257a5114f..d0d87c02c2 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -31,6 +31,7 @@
       name="last_interaction_time_textbox"
       text_color="LtGray_50"
       value="0s"
+      visible="false" 
       width="35" />
     <permission_edit_theirs_icon
       layout="topleft"
@@ -42,6 +43,7 @@
       name="permission_edit_theirs_icon"
       tool_tip="You can edit this friend&apos;s objects"
       top="4"
+      visible="false" 
       width="16" />
     <permission_edit_mine_icon
       layout="topleft"
@@ -52,6 +54,8 @@
       right="-110"
       name="permission_edit_mine_icon"
       tool_tip="This friend can edit, delete or take your objects"
+      top="4"
+      visible="false" 
       width="16" />
     <permission_map_icon
       height="16"
@@ -61,6 +65,7 @@
       tool_tip="This friend can locate you on the map"
       right="-91"
       name="permission_map_icon"
+      visible="false" 
       width="16" />
     <permission_online_icon
       height="16"
@@ -70,6 +75,7 @@
       right="-72"
       name="permission_online_icon"
       tool_tip="This friend can see when you&apos;re online"
+      visible="false" 
       width="16" />
     <info_btn
       follows="right"
@@ -81,6 +87,7 @@
       name="info_btn"
       tool_tip="More info"
       tab_stop="false"
+      visible="false"      
       width="16" />
     <profile_btn
       follows="right"
@@ -92,6 +99,7 @@
       tab_stop="false"
       tool_tip="View profile"
       top_delta="-2"
+      visible="false"
       width="20" />
     <output_monitor
       auto_update="true"
@@ -101,6 +109,7 @@
       right="-3"
       mouse_opaque="true"
       name="speaking_indicator"
+      visible="false"
       width="20" />
  </person_view>
 
-- 
cgit v1.2.3


From 343ad70696349f4b30b7f2f9a6242cdd1035cd21 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 29 Apr 2013 18:57:26 -0700
Subject: ACME-275 : WIP : Starting to write the LLPersonViewerFilter code

---
 indra/newview/llpanelpeople.cpp       | 24 ++++++++------
 indra/newview/llpersonmodelcommon.cpp | 62 +++++++++++++++++++++++++++++++++++
 indra/newview/llpersonmodelcommon.h   | 26 +++++++++------
 3 files changed, 92 insertions(+), 20 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ef45cc44f7..ce31c735e3 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1200,23 +1200,23 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
 	{
 		// store accordion tabs opened/closed state before any manipulation with accordion tabs
 		if (!saved_filter.empty())
-	{
-		notifyChildren(LLSD().with("action","store_state"));
-	}
+        {
+            notifyChildren(LLSD().with("action","store_state"));
+        }
 
 		mOnlineFriendList->setNameFilter(filter);
 		mAllFriendList->setNameFilter(filter);
 
-	setAccordionCollapsedByUser("tab_online", false);
-	setAccordionCollapsedByUser("tab_all", false);
-	showFriendsAccordionsIfNeeded();
+        setAccordionCollapsedByUser("tab_online", false);
+        setAccordionCollapsedByUser("tab_all", false);
+        showFriendsAccordionsIfNeeded();
 
 		// restore accordion tabs state _after_ all manipulations
 		if(saved_filter.empty())
-	{
-		notifyChildren(LLSD().with("action","restore_state"));
-	}
-}
+        {
+            notifyChildren(LLSD().with("action","restore_state"));
+        }
+    }
 	else if (cur_tab == GROUP_TAB_NAME)
 	{
 		mGroupList->setNameFilter(filter);
@@ -1225,6 +1225,10 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
 	{
 		mRecentList->setNameFilter(filter);
 	}
+    else if (cur_tab == FBCTESTTWO_TAB_NAME)
+    {
+        mPersonFolderViewModel.getFilter().setFilterSubString(filter);
+    }
 }
 
 void LLPanelPeople::onTabSelected(const LLSD& param)
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index bea7f3d45e..4e54562f18 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -157,3 +157,65 @@ LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) :
 LLPersonModelCommon(root_view_model)
 {
 }
+
+//
+// LLPersonViewFilter
+//
+
+LLPersonViewFilter::LLPersonViewFilter() :
+    mEmpty(""),
+    mFilterSubString(""),
+    mFilterModified(FILTER_NONE)
+{
+}
+
+void LLPersonViewFilter::setFilterSubString(const std::string& string)
+{
+	std::string filter_sub_string_new = string;
+	LLStringUtil::trimHead(filter_sub_string_new);
+	LLStringUtil::toUpper(filter_sub_string_new);
+    
+	if (mFilterSubString != filter_sub_string_new)
+	{
+		mFilterSubString = filter_sub_string_new;
+	}
+}
+
+std::string::size_type LLPersonViewFilter::getFilterStringSize() const
+{
+	return mFilterSubString.size();
+}
+
+bool LLPersonViewFilter::check(const LLFolderViewModelItem* item)
+{
+	//const LLPersonModelCommon* person = dynamic_cast<const LLPersonModelCommon*>(item);
+	std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
+    
+	return (mFilterSubString.size() == 0 || string_offset != std::string::npos);
+}
+
+bool LLPersonViewFilter::showAllResults() const
+{
+	return mFilterSubString.size() > 0;
+}
+
+std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
+{
+	return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
+}
+
+bool LLPersonViewFilter::isActive() const
+{
+	return mFilterSubString.size();
+}
+
+bool LLPersonViewFilter::isModified() const
+{
+    return isActive();
+}
+
+void LLPersonViewFilter::clearModified()
+{
+    mFilterModified = FILTER_NONE;
+	setFilterSubString("");
+}
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index f3454df53f..bdbee002e6 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -127,7 +127,7 @@ private:
 
 };
 
-//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further
+// Filtering functional object
 
 class LLPersonViewFilter : public LLFolderViewFilter
 {
@@ -143,20 +143,23 @@ public:
 	// Default sort order is by type for sessions and by date for participants
 	static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE);
 
-	LLPersonViewFilter() { mEmpty = ""; }
+	LLPersonViewFilter();
 	~LLPersonViewFilter() {}
 
-	bool 				check(const LLFolderViewModelItem* item) { return true; }
+	void 				setFilterSubString(const std::string& string);
+	std::string::size_type getFilterStringSize() const;
+	bool 				check(const LLFolderViewModelItem* item);
+	bool				showAllResults() const;
+	std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const;
+ 	bool 				isActive() const;
+	bool 				isModified() const;
+	void 				clearModified();
+   
 	bool				checkFolder(const LLFolderViewModelItem* folder) const { return true; }
+    
 	void 				setEmptyLookupMessage(const std::string& message) { }
 	std::string			getEmptyLookupMessage() const { return mEmpty; }
-	bool				showAllResults() const { return true; }
-	std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; }
-	std::string::size_type getFilterStringSize() const { return 0; }
 
-	bool 				isActive() const { return false; }
-	bool 				isModified() const { return false; }
-	void 				clearModified() { }
 	const std::string& 	getName() const { return mEmpty; }
 	const std::string& 	getFilterText() { return mEmpty; }
 	void 				setModified(EFilterModified behavior = FILTER_RESTART) { }
@@ -173,8 +176,11 @@ public:
 	S32 				getCurrentGeneration() const { return 0; }
 	S32 				getFirstSuccessGeneration() const { return 0; }
 	S32 				getFirstRequiredGeneration() const { return 0; }
+    
 private:
-	std::string mEmpty;
+	std::string         mEmpty;
+	std::string			mFilterSubString;
+	EFilterModified 	mFilterModified;
 };
 
 class LLPersonViewSort
-- 
cgit v1.2.3


From 8189c27cfad6f498966dc99dd483df8466330ccd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 30 Apr 2013 11:37:16 -0700
Subject: ACME-252 Create AvatarFolderItemView: Optimization. Now the widths
 for the personview are computed once and stored staticically since they don't
 change per control.

---
 indra/newview/llpersontabview.cpp | 48 ++++++++++++++++++++++++++++-----------
 indra/newview/llpersontabview.h   | 14 ++++++++----
 2 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index fa7bc09e10..2bc436226d 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -116,6 +116,9 @@ void LLPersonTabView::drawHighlight()
 
 static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
 
+bool LLPersonView::sChildrenWidthsInitialized = false;
+ChildWidthVec LLPersonView::mChildWidthVec;
+
 LLPersonView::Params::Params() :
 avatar_icon("avatar_icon"),
 last_interaction_time_textbox("last_interaction_time_textbox"),
@@ -163,7 +166,13 @@ LLPersonView::~LLPersonView()
 
 BOOL LLPersonView::postBuild()
 {
-	initChildrenWidths(this);
+	if(!sChildrenWidthsInitialized)
+	{
+		initChildrenWidthVec(this);
+		sChildrenWidthsInitialized = true;
+	}
+	
+	initChildVec();
 	updateChildren();
 	return LLFolderViewItem::postBuild();
 }
@@ -275,7 +284,7 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params)
 	addChild(mOutputMonitorCtrl);
 }
 
-void LLPersonView::initChildrenWidths(LLPersonView* self)
+void LLPersonView::initChildrenWidthVec(LLPersonView* self)
 {
 	S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft;
 	S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft;
@@ -286,15 +295,26 @@ void LLPersonView::initChildrenWidths(LLPersonView* self)
 	S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft;
 	S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft;
 
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mOutputMonitorCtrl, output_monitor_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mProfileBtn, profile_btn_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mInfoBtn, info_btn_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionOnlineIcon, permission_online_icon_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionMapIcon, permissions_map_icon_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionEditMineIcon, permission_edit_mine_icon_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mPermissionEditTheirsIcon, permission_edit_theirs_icon_width));
-	self->mChildAndWidthVec.push_back(std::pair<LLView *, S32>(self->mLastInteractionTimeTextbox, last_interaction_time_textbox_width));
+	self->mChildWidthVec.push_back(output_monitor_width);
+	self->mChildWidthVec.push_back(profile_btn_width);
+	self->mChildWidthVec.push_back(info_btn_width);
+	self->mChildWidthVec.push_back(permission_online_icon_width);
+	self->mChildWidthVec.push_back(permissions_map_icon_width);
+	self->mChildWidthVec.push_back(permission_edit_mine_icon_width);
+	self->mChildWidthVec.push_back(permission_edit_theirs_icon_width);
+	self->mChildWidthVec.push_back(last_interaction_time_textbox_width);
+}
 
+void LLPersonView::initChildVec()
+{
+	mChildVec.push_back(mOutputMonitorCtrl);
+	mChildVec.push_back(mProfileBtn);
+	mChildVec.push_back(mInfoBtn);
+	mChildVec.push_back(mPermissionOnlineIcon);
+	mChildVec.push_back(mPermissionMapIcon);
+	mChildVec.push_back(mPermissionEditMineIcon);
+	mChildVec.push_back(mPermissionEditTheirsIcon);
+	mChildVec.push_back(mLastInteractionTimeTextbox);
 }
 
 void LLPersonView::updateChildren()
@@ -304,16 +324,18 @@ void LLPersonView::updateChildren()
 	S32 control_width;
 	LLRect control_rect;
 
-	for(S32 i = 0; i < mChildAndWidthVec.size(); ++i)
+	llassert(mChildWidthVec.size() == mChildVec.size());
+
+	for(S32 i = 0; i < mChildWidthVec.size(); ++i)
 	{
-		control = mChildAndWidthVec[i].first;
+		control = mChildVec[i];
 
 		if(!control->getVisible())
 		{
 			continue;
 		}
 
-		control_width = mChildAndWidthVec[i].second;
+		control_width = mChildWidthVec[i];
 		mLabelPaddingRight += control_width;
 
 		control_rect = control->getRect();
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 56d7f4eade..80020073d7 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -64,6 +64,9 @@ private:
 
 };
 
+typedef std::vector<S32> ChildWidthVec;
+typedef std::vector<LLView *> ChildVec;
+
 class LLPersonView : public LLFolderViewItem
 {
 
@@ -127,11 +130,14 @@ private:
 		ALIC_COUNT,
 	} EAvatarListItemChildIndex;
 
-	typedef std::vector<std::pair<LLView *, S32>> ChildAndWidthVec;
-	ChildAndWidthVec mChildAndWidthVec;
+	//Widths of controls are same for every instance so can be static
+	static ChildWidthVec mChildWidthVec;
+	//Control pointers are different for each instance so non-static
+	ChildVec mChildVec;
 
-	static bool	sStaticInitialized;
-	static void initChildrenWidths(LLPersonView* self);
+	static bool	sChildrenWidthsInitialized;
+	static void initChildrenWidthVec(LLPersonView* self);
+	void initChildVec();
 	void updateChildren();
 };
 
-- 
cgit v1.2.3


From 03239c14e82f4d400cefa8c4b418a6192cc08654 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 30 Apr 2013 14:03:04 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now clicking the profile button
 and info button will show a facebook user's SL profile or info respectively.

---
 indra/newview/llpanelpeople.cpp       |  2 +-
 indra/newview/llpersonmodelcommon.cpp | 13 ++++++++++---
 indra/newview/llpersonmodelcommon.h   |  6 ++++--
 indra/newview/llpersontabview.cpp     | 10 ++++++++++
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 609284cdd5..4c044c2471 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1698,7 +1698,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 {
 	LLPersonModel* person_model = NULL;
 
-	person_model = new LLPersonModel(name, mPersonFolderViewModel);
+	person_model = new LLPersonModel(agent_id, name, mPersonFolderViewModel);
 	person_folder_model->addParticipant(person_model);
 }
 
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 4e54562f18..91c3f6a92a 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -148,14 +148,21 @@ LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id)
 // LLPersonModel
 // 
 
-LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(display_name,root_view_model)
+LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(display_name,root_view_model),
+mAgentID(agent_id)
 {
 }
 
 LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(root_view_model)
+LLPersonModelCommon(root_view_model),
+mAgentID(LLUUID(NULL))
+{
+}
+
+LLUUID LLPersonModel::getAgentID()
 {
+	return mAgentID;
 }
 
 //
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index bdbee002e6..4030cd11df 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -120,11 +120,13 @@ private:
 class LLPersonModel : public LLPersonModelCommon
 {
 public:
-	LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model);
+	LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model);
 	LLPersonModel(LLFolderViewModelInterface& root_view_model);
 
-private:
+	LLUUID getAgentID();
 
+private:
+	LLUUID mAgentID;
 };
 
 // Filtering functional object
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 2bc436226d..a0d6b40d08 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -29,6 +29,10 @@
 
 #include "llpersontabview.h"
 
+#include "llavataractions.h"
+#include "llfloaterreg.h"
+#include "llpersonmodelcommon.h"
+
 static LLDefaultChildRegistry::Register<LLPersonTabView> r_person_tab_view("person_tab_view");
 
 const LLColor4U DEFAULT_WHITE(255, 255, 255);
@@ -174,6 +178,12 @@ BOOL LLPersonView::postBuild()
 	
 	initChildVec();
 	updateChildren();
+
+	LLPersonModel * person_model = static_cast<LLPersonModel *>(getViewModelItem());
+
+	mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE));
+	mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID()));
+
 	return LLFolderViewItem::postBuild();
 }
 
-- 
cgit v1.2.3


From f18c5ad3c6cb95ad329ad7147631edd6855f3ac5 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 30 Apr 2013 15:33:40 -0700
Subject: ACME-252 Create AvatarFolderItemView: Now the people view shows both
 the facebook name and the SL name (assuming this connection exists).

---
 indra/newview/llpanelpeople.cpp   | 7 ++++++-
 indra/newview/llpersontabview.cpp | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4c044c2471..a9a024c9ed 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1698,7 +1698,12 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 {
 	LLPersonModel* person_model = NULL;
 
-	person_model = new LLPersonModel(agent_id, name, mPersonFolderViewModel);
+	LLAvatarName avatar_name;
+	bool avatar_name_exists = LLAvatarNameCache::get(agent_id, &avatar_name);
+
+	std::string aggregated_name = avatar_name_exists ? name + " (" + avatar_name.getDisplayName() + ") " : name;
+
+	person_model = new LLPersonModel(agent_id, aggregated_name, mPersonFolderViewModel);
 	person_folder_model->addParticipant(person_model);
 }
 
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index a0d6b40d08..76f3151777 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -181,6 +181,7 @@ BOOL LLPersonView::postBuild()
 
 	LLPersonModel * person_model = static_cast<LLPersonModel *>(getViewModelItem());
 
+	mAvatarIcon->setValue(person_model->getAgentID());
 	mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE));
 	mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID()));
 
-- 
cgit v1.2.3


From 9fdfc8dd5c52e515990f3ef4e552b9084fa66373 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 30 Apr 2013 16:01:31 -0700
Subject: ACME-252 Create AvatarFolderItemView: Slight xml change for person
 view to make the profile button display lower.

---
 indra/newview/skins/default/xui/en/widgets/person_view.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 d0d87c02c2..4a39109f36 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -90,6 +90,7 @@
       visible="false"      
       width="16" />
     <profile_btn
+      layout="topleft"
       follows="right"
       height="20"
       image_overlay="Web_Profile_Off"
@@ -98,7 +99,7 @@
       name="profile_btn"
       tab_stop="false"
       tool_tip="View profile"
-      top_delta="-2"
+      top="2"
       visible="false"
       width="20" />
     <output_monitor
-- 
cgit v1.2.3


From 336efe17d8f24a8445e93645f2cf18b68e18de2e Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 30 Apr 2013 17:18:29 -0700
Subject: ACME-275 : WIP : Write all LLPersonViewerFilter methods and clean up
 interface

---
 indra/newview/llpersonmodelcommon.cpp | 32 ++++++++++++------
 indra/newview/llpersonmodelcommon.h   | 64 +++++++++++++++++++++++------------
 2 files changed, 64 insertions(+), 32 deletions(-)

diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 4e54562f18..32ceef096d 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -163,8 +163,9 @@ LLPersonModelCommon(root_view_model)
 //
 
 LLPersonViewFilter::LLPersonViewFilter() :
-    mEmpty(""),
+    mEmptyLookupMessage(""),
     mFilterSubString(""),
+    mName(""),
     mFilterModified(FILTER_NONE)
 {
 }
@@ -177,31 +178,32 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string)
     
 	if (mFilterSubString != filter_sub_string_new)
 	{
+        // *TODO : Add logic to support more and less restrictive filtering
+        mFilterModified = FILTER_RESTART;
 		mFilterSubString = filter_sub_string_new;
 	}
 }
 
-std::string::size_type LLPersonViewFilter::getFilterStringSize() const
+bool LLPersonViewFilter::showAllResults() const
 {
-	return mFilterSubString.size();
+	return mFilterSubString.size() > 0;
 }
 
 bool LLPersonViewFilter::check(const LLFolderViewModelItem* item)
 {
-	//const LLPersonModelCommon* person = dynamic_cast<const LLPersonModelCommon*>(item);
 	std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
     
 	return (mFilterSubString.size() == 0 || string_offset != std::string::npos);
 }
 
-bool LLPersonViewFilter::showAllResults() const
+std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
 {
-	return mFilterSubString.size() > 0;
+	return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
 }
 
-std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
+std::string::size_type LLPersonViewFilter::getFilterStringSize() const
 {
-	return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
+	return mFilterSubString.size();
 }
 
 bool LLPersonViewFilter::isActive() const
@@ -211,11 +213,21 @@ bool LLPersonViewFilter::isActive() const
 
 bool LLPersonViewFilter::isModified() const
 {
-    return isActive();
+	return mFilterModified != FILTER_NONE;
 }
 
 void LLPersonViewFilter::clearModified()
 {
     mFilterModified = FILTER_NONE;
-	setFilterSubString("");
 }
+
+void LLPersonViewFilter::setEmptyLookupMessage(const std::string& message)
+{
+	mEmptyLookupMessage = message;
+}
+
+std::string LLPersonViewFilter::getEmptyLookupMessage() const
+{
+	return mEmptyLookupMessage;
+}
+
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index bdbee002e6..2ddec3d05e 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -136,49 +136,69 @@ public:
 	enum ESortOrderType
 	{
 		SO_NAME = 0,						// Sort by name
-		SO_DATE = 0x1,						// Sort by date (most recent)
-		SO_SESSION_TYPE = 0x2,				// Sort by type (valid only for sessions)
-		SO_DISTANCE = 0x3,					// Sort by distance (valid only for participants in nearby chat)
+		SO_ONLINE_STATUS = 0x1				// Sort by online status (i.e. online or not)
 	};
-	// Default sort order is by type for sessions and by date for participants
-	static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE);
+	// Default sort order is by name
+	static const U32 SO_DEFAULT = SO_NAME;
 
 	LLPersonViewFilter();
 	~LLPersonViewFilter() {}
 
-	void 				setFilterSubString(const std::string& string);
-	std::string::size_type getFilterStringSize() const;
+	// +-------------------------------------------------------------------+
+	// + Execution And Results
+	// +-------------------------------------------------------------------+
 	bool 				check(const LLFolderViewModelItem* item);
+	bool				checkFolder(const LLFolderViewModelItem* folder) const { return true; }
+    
+	void 				setEmptyLookupMessage(const std::string& message);
+	std::string			getEmptyLookupMessage() const;
+    
 	bool				showAllResults() const;
+    
 	std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const;
+	std::string::size_type getFilterStringSize() const;
+
+ 	// +-------------------------------------------------------------------+
+	// + Status
+	// +-------------------------------------------------------------------+
  	bool 				isActive() const;
 	bool 				isModified() const;
 	void 				clearModified();
-   
-	bool				checkFolder(const LLFolderViewModelItem* folder) const { return true; }
+	const std::string& 	getName() const { return mName; }
+	const std::string& 	getFilterText() { return mName; }
+	void 				setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; }
     
-	void 				setEmptyLookupMessage(const std::string& message) { }
-	std::string			getEmptyLookupMessage() const { return mEmpty; }
-
-	const std::string& 	getName() const { return mEmpty; }
-	const std::string& 	getFilterText() { return mEmpty; }
-	void 				setModified(EFilterModified behavior = FILTER_RESTART) { }
-
+	// +-------------------------------------------------------------------+
+	// + Count
+	// +-------------------------------------------------------------------+
+    // Note : we currently filter the whole person list at once, no need to count then.
 	void 				setFilterCount(S32 count) { }
 	S32 				getFilterCount() const { return 0; }
 	void 				decrementFilterCount() { }
 
-	bool 				isDefault() const { return true; }
-	bool 				isNotDefault() const { return false; }
+	// +-------------------------------------------------------------------+
+	// + Default
+	// +-------------------------------------------------------------------+
+    // Note : we don't support runtime default setting for person filter
+	bool 				isDefault() const  { return !isActive(); }
+	bool 				isNotDefault() const { return isActive(); }
 	void 				markDefault() { }
-	void 				resetDefault() { }
-
+	void 				resetDefault() { setModified(); }
+    
+	// +-------------------------------------------------------------------+
+	// + Generation
+	// +-------------------------------------------------------------------+
+    // Note : unclear if we have to take tab on generation at that point
 	S32 				getCurrentGeneration() const { return 0; }
 	S32 				getFirstSuccessGeneration() const { return 0; }
 	S32 				getFirstRequiredGeneration() const { return 0; }
-    
+
+    // Non Virtual Methods (i.e. specific to this class)
+	void 				setFilterSubString(const std::string& string);
+   
 private:
-	std::string         mEmpty;
+	std::string         mName;
+	std::string         mEmptyLookupMessage;
 	std::string			mFilterSubString;
 	EFilterModified 	mFilterModified;
 };
-- 
cgit v1.2.3


From 4d72a6ea92d87822350be63e235b90daa4727d55 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 30 Apr 2013 18:17:20 -0700
Subject: ACME-252 Create AvatarFolderItemView: Fixed focusing issue when
 hovering over a people view and then selected an icon. Now when selecting the
 icon upon hover the corresponding people view will be selected as well.

---
 indra/newview/llpanelpeople.cpp      |  2 +-
 indra/newview/llpersonfolderview.cpp |  7 ++++++-
 indra/newview/llpersontabview.cpp    | 36 ++++++++++++++++++++++++++++++++++++
 indra/newview/llpersontabview.h      |  1 +
 4 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index a9a024c9ed..77c3430c01 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1690,7 +1690,7 @@ void LLPanelPeople::addTestParticipant()
 	for(int i = 0; i < 300; ++i)
 	{
 		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
-		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy");
+		addParticipantToModel(person_folder_model, gAgent.getID(), "Test Name");
 	}
 }
 
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 636d093e0e..ba1e9d20eb 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -64,7 +64,12 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
 		}
 	}
 
-	return LLFolderView::handleMouseDown(x, y, mask);
+	mKeyboardSelection = FALSE; 
+	mSearchString.clear();
+
+	LLEditMenuHandler::gEditMenuHandler = this;
+
+	return LLView::handleMouseDown( x, y, mask );
 }
 
 bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 76f3151777..fdc024beb8 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -65,6 +65,7 @@ BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask )
 
 	if(selected_item)
 	{
+		gFocusMgr.setKeyboardFocus( this );
 		highlight = true;
 	}
 
@@ -204,6 +205,41 @@ void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask)
 	LLFolderViewItem::onMouseLeave(x, y, mask);
 }
 
+BOOL LLPersonView::handleMouseDown( S32 x, S32 y, MASK mask)
+{
+	if(!LLView::childrenHandleMouseDown(x, y, mask))
+	{
+		gFocusMgr.setMouseCapture( this );
+	}
+
+	if (!mIsSelected)
+	{
+		if(mask & MASK_CONTROL)
+		{
+			getRoot()->changeSelection(this, !mIsSelected);
+		}
+		else if (mask & MASK_SHIFT)
+		{
+			getParentFolder()->extendSelectionTo(this);
+		}
+		else
+		{
+			getRoot()->setSelection(this, FALSE);
+		}
+		make_ui_sound("UISndClick");
+	}
+	else
+	{
+		// If selected, we reserve the decision of deselecting/reselecting to the mouse up moment.
+		// This is necessary so we maintain selection consistent when starting a drag.
+		mSelectPending = TRUE;
+	}
+
+	mDragStartX = x;
+	mDragStartY = y;
+	return TRUE;
+}
+
 void LLPersonView::draw()
 {
 	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 80020073d7..9cce615167 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -95,6 +95,7 @@ public:
 	BOOL postBuild();
 	void onMouseEnter(S32 x, S32 y, MASK mask);
 	void onMouseLeave(S32 x, S32 y, MASK mask);
+	BOOL handleMouseDown( S32 x, S32 y, MASK mask);
 
 protected:	
 	
-- 
cgit v1.2.3


From 145bbacc6c167351357572a5d635f790e6715b86 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 1 May 2013 20:43:49 +0100
Subject: made secondlife:///app/fbc/connect avoid 'the slurl you click on is
 not supported' messages

---
 indra/newview/llpanelpeople.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index a9a024c9ed..640c5e4e4e 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -111,12 +111,11 @@ public:
 					{
 						mPanelPeople->connectToFacebook(query_map["code"]);
 						mPanelPeople = NULL;
-						return true;
 					}
 				}
+				return true;
 			}
 		}
-
 		return false;
 	}
 };
-- 
cgit v1.2.3


From a73305c41d058fc755b824e5a9243afe43b424e1 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 2 May 2013 16:24:09 -0700
Subject: ACME-275 : WIP : Implemented filter(), still arrange() not done
 timely, tweaked test values to allow test of sort and filter

---
 indra/newview/llpanelpeople.cpp       | 14 ++++++++-
 indra/newview/llpersonmodelcommon.cpp | 55 ++++++++++++++++++++++++++++++-----
 indra/newview/llpersonmodelcommon.h   | 18 +++++++-----
 3 files changed, 72 insertions(+), 15 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index a9a024c9ed..9daf441ab3 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1687,10 +1687,22 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 
 void LLPanelPeople::addTestParticipant()
 {
+    std::string suffix("Aa");
+    std::string prefix("EastBayGuy");
 	for(int i = 0; i < 300; ++i)
 	{
 		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
-		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy");
+        std::string name = prefix + " " + suffix;
+		addParticipantToModel(person_folder_model, LLUUID().generateNewID(), name);
+        // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ...
+        suffix[1]+=1;
+        if (suffix[1]=='{')
+        {
+            suffix[1]='a';
+            suffix[0]+=1;
+            if (suffix[0]=='[')
+                suffix[0]='A';
+        }
 	}
 }
 
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 3e9ca9c3b9..9660432b80 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -31,21 +31,23 @@
 
 #include "llevents.h"
 #include "llsdutil.h"
+#include "llstring.h"
 
 //
 // LLPersonModelCommon
 // 
 
 LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) :
-LLFolderViewModelItemCommon(root_view_model),
-	mName(display_name),
+    LLFolderViewModelItemCommon(root_view_model),
 	mID(LLUUID().generateNewID())
 {
+    renameItem(display_name);
 }
 
 LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) :
-LLFolderViewModelItemCommon(root_view_model),
+    LLFolderViewModelItemCommon(root_view_model),
 	mName(""),
+    mSearchableName(""),
 	mID(LLUUID().generateNewID())
 {
 }
@@ -55,6 +57,14 @@ LLPersonModelCommon::~LLPersonModelCommon()
 
 }
 
+BOOL LLPersonModelCommon::renameItem(const std::string& new_name)
+{
+    mName = new_name;
+    mSearchableName = new_name;
+    LLStringUtil::toUpper(mSearchableName);
+    return TRUE;
+}
+
 void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person)
 {
 	LLUUID folder_id = folder->getID();
@@ -84,6 +94,39 @@ void LLPersonModelCommon::showProperties(void)
 {
 }
 
+bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
+{
+    // See LLFolderViewModelItemInventory::filter()
+/*
+    if (!filter.isModified())
+    {
+        llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl;
+        return true;
+    }
+*/        
+    if (!mChildren.empty())
+    {
+        //llinfos << "Merov : LLPersonModelCommon::filter, filtering folder = " << getDisplayName() << llendl;
+        setPassedFilter(1, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize());
+        for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end();
+            iter != end_iter;
+            ++iter)
+        {
+            // LLFolderViewModelItem
+            LLPersonModelCommon* item = dynamic_cast<LLPersonModelCommon*>(*iter);
+            item->filter(filter);
+        }
+    }
+    else
+    {
+        const bool passed_filter = filter.check(this);
+        setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize());
+    }
+    
+    filter.clearModified();
+    return true;
+}
+
 //
 // LLPersonTabModel
 // 
@@ -186,7 +229,7 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string)
 	if (mFilterSubString != filter_sub_string_new)
 	{
         // *TODO : Add logic to support more and less restrictive filtering
-        mFilterModified = FILTER_RESTART;
+        setModified(FILTER_RESTART);
 		mFilterSubString = filter_sub_string_new;
 	}
 }
@@ -198,9 +241,7 @@ bool LLPersonViewFilter::showAllResults() const
 
 bool LLPersonViewFilter::check(const LLFolderViewModelItem* item)
 {
-	std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
-    
-	return (mFilterSubString.size() == 0 || string_offset != std::string::npos);
+	return (mFilterSubString.size() ? (item->getSearchableName().find(mFilterSubString) != std::string::npos) : true);
 }
 
 std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index 9e13a7d7d9..1e9117c2df 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -46,13 +46,14 @@ public:
 	// Stub those things we won't really be using in this conversation context
 	virtual const std::string& getName() const { return mName; }
 	virtual const std::string& getDisplayName() const { return mName; }
-	virtual const std::string& getSearchableName() const { return mName; }
+	virtual const std::string& getSearchableName() const { return mSearchableName; }
+
 	virtual LLPointer<LLUIImage> getIcon() const { return NULL; }
 	virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
 	virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
 	virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
 	virtual BOOL isItemRenameable() const { return TRUE; }
-	virtual BOOL renameItem(const std::string& new_name) { mName = new_name; return TRUE; }
+	virtual BOOL renameItem(const std::string& new_name);
 	virtual BOOL isItemMovable( void ) const { return FALSE; }
 	virtual BOOL isItemRemovable( void ) const { return FALSE; }
 	virtual BOOL isItemInTrash( void) const { return FALSE; }
@@ -70,10 +71,12 @@ public:
 	virtual bool hasChildren() const { return FALSE; }
 
 	virtual bool potentiallyVisible() { return true; }
-	virtual bool filter( LLFolderViewFilter& filter) { return false; }
+    
+	virtual bool filter( LLFolderViewFilter& filter);
+
 	virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; }
-	virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { }
-	virtual bool passedFilter(S32 filter_generation = -1) { return true; }
+//	virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { }
+	virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; }
 
 	// The action callbacks
 	virtual void performAction(LLInventoryModel* model, std::string action);
@@ -97,7 +100,8 @@ public:
 
 protected:
 
-	std::string mName;	// Name of the session or the participant
+	std::string mName;              // Name of the person
+	std::string mSearchableName;	// Name used in string matching for this person
 	LLUUID mID;
 };	
 
@@ -175,7 +179,7 @@ public:
 	// +-------------------------------------------------------------------+
     // Note : we currently filter the whole person list at once, no need to count then.
 	void 				setFilterCount(S32 count) { }
-	S32 				getFilterCount() const { return 0; }
+	S32 				getFilterCount() const { return 1; }
 	void 				decrementFilterCount() { }
 
 	// +-------------------------------------------------------------------+
-- 
cgit v1.2.3


From 933cff41a6b03f2b11403970866db9fbbcf7e85f Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 2 May 2013 16:41:16 -0700
Subject: ACME-307 Fix crash when clicking profile button: The crash was caused
 by existing code which was taking the last focused element and assuming it
 was a pointer to a LLUICtrl. Now assume the pointer is of type LLView since
 there is not need to have it as a LLUICtrl pointer.

---
 indra/llui/llfloater.cpp  | 2 +-
 indra/llui/llfocusmgr.cpp | 4 ++--
 indra/llui/llfocusmgr.h   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 09e27a264a..ef4b1450ca 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1346,7 +1346,7 @@ void LLFloater::setFocus( BOOL b )
 	{
 		return;
 	}
-	LLUICtrl* last_focus = gFocusMgr.getLastFocusForGroup(this);
+	LLView* last_focus = gFocusMgr.getLastFocusForGroup(this);
 	// a descendent already has focus
 	BOOL child_had_focus = hasFocus();
 
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 724d190307..f03c8d444b 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -469,7 +469,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus)
 	mAppHasFocus = focus; 
 }
 
-LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
+LLView* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
 {
 	if (subtree_root)
 	{
@@ -477,7 +477,7 @@ LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
 		if (found_it != mImpl->mFocusHistory.end())
 		{
 			// found last focus for this subtree
-			return static_cast<LLUICtrl*>(found_it->second.get());
+			return found_it->second.get();
 		}
 	}
 	return NULL;
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 25ae1d2579..1c7326260c 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -97,7 +97,7 @@ public:
 	void			triggerFocusFlash();
 	BOOL			getAppHasFocus() const { return mAppHasFocus; }
 	void			setAppHasFocus(BOOL focus);
-	LLUICtrl*		getLastFocusForGroup(LLView* subtree_root) const;
+	LLView*		getLastFocusForGroup(LLView* subtree_root) const;
 	void			clearLastFocusForGroup(LLView* subtree_root);
 
 	// If setKeyboardFocus(NULL) is called, and there is a non-NULL default
-- 
cgit v1.2.3


From 6cce8629b962cd73515e2d0a85620b602e57a0fe Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 2 May 2013 18:47:56 -0700
Subject: CHUI-275 : WIP : Cleaned up comments

---
 indra/newview/llpersonmodelcommon.cpp | 9 +++++----
 indra/newview/llpersonmodelcommon.h   | 8 --------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 9660432b80..6b4c71faa2 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -96,8 +96,8 @@ void LLPersonModelCommon::showProperties(void)
 
 bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
 {
-    // See LLFolderViewModelItemInventory::filter()
 /*
+ Hack: for the moment, we always apply the filter if we're called
     if (!filter.isModified())
     {
         llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl;
@@ -106,19 +106,20 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
 */        
     if (!mChildren.empty())
     {
-        //llinfos << "Merov : LLPersonModelCommon::filter, filtering folder = " << getDisplayName() << llendl;
-        setPassedFilter(1, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize());
+        // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders)
+        setPassedFilter(1, -1);
+        // Call filter recursively on all children
         for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end();
             iter != end_iter;
             ++iter)
         {
-            // LLFolderViewModelItem
             LLPersonModelCommon* item = dynamic_cast<LLPersonModelCommon*>(*iter);
             item->filter(filter);
         }
     }
     else
     {
+        // If there's no children, the current instance is a person and we check and set the passed filter flag on it
         const bool passed_filter = filter.check(this);
         setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize());
     }
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index ffd145b549..f44f619d18 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -174,14 +174,6 @@ public:
 	const std::string& 	getFilterText() { return mName; }
 	void 				setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; }
     
-	// +-------------------------------------------------------------------+
-	// + Count
-	// +-------------------------------------------------------------------+
-    // Note : we currently filter the whole person list at once, no need to count then.
-	//void 				setFilterCount(S32 count) { }
-	//S32 				getFilterCount() const { return 1; }
-	//void 				decrementFilterCount() { }
-
 	// +-------------------------------------------------------------------+
 	// + Time
 	// +-------------------------------------------------------------------+
-- 
cgit v1.2.3


From 1b6d6b7e794ad4401faa91a79774922a5baec968 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 3 May 2013 11:57:59 -0700
Subject: ACME-323 Create a tab for 'Invite people you know to SL': FBC Test
 Two tabs are now named to match UX spec. Also created a function called
 createPersonTabs() which simplifies tab creation. The LLPersonFolderView is
 being turned into the tab manager.

---
 indra/newview/llpanelpeople.cpp      | 25 -------------------------
 indra/newview/llpersonfolderview.cpp | 24 ++++++++++++++++++++++++
 indra/newview/llpersonfolderview.h   |  4 ++++
 3 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 03135ce580..22b79a9380 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -750,31 +750,6 @@ BOOL LLPanelPeople::postBuild()
 	scroller->setFollowsAll();
 	mPersonFolderView->setScrollContainer(scroller);
 	mPersonFolderView->setFollowsAll();
-
-	//Create a person tab
-	LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
-	LLPersonTabView::Params params;
-	params.name = item->getDisplayName();
-	params.root = mPersonFolderView;
-	params.listener = item;
-	params.tool_tip = params.name;
-	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
-	widget->addToFolder(mPersonFolderView);
-
-	mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
-	mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
-
-	//Create a person tab
-	item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel);
-	params.name = item->getDisplayName();
-	params.root = mPersonFolderView;
-	params.listener = item;
-	params.tool_tip = params.name;
-	widget = LLUICtrlFactory::create<LLPersonTabView>(params);
-	widget->addToFolder(mPersonFolderView);
-
-	mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
-	mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
 	
 	gIdleCallbacks.addFunction(idle, this);
 
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index ba1e9d20eb..21578e986b 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -38,6 +38,8 @@ LLFolderView(p),
 	mConversationsEventStream("ConversationsEventsTwo")
 {
 	mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1));
+
+	createPersonTabs();
 }
 
 LLPersonFolderView::~LLPersonFolderView()
@@ -45,6 +47,28 @@ LLPersonFolderView::~LLPersonFolderView()
 	mConversationsEventStream.stopListening("ConversationsRefresh");
 }
 
+void LLPersonFolderView::createPersonTabs()
+{
+	createPersonTab("SL residents you may want to friend");
+	createPersonTab("Invite people you know to SL");
+}
+
+void LLPersonFolderView::createPersonTab(const std::string& tab_name)
+{
+	//Create a person tab
+	LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel);
+	LLPersonTabView::Params params;
+	params.name = item->getDisplayName();
+	params.root = this;
+	params.listener = item;
+	params.tool_tip = params.name;
+	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
+	widget->addToFolder(this);
+
+	mPersonFolderModelMap[item->getID()] = item;
+	mPersonFolderViewMap[item->getID()] = widget;
+}
+
 BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
 {
 	LLFolderViewItem * item = getCurSelectedItem();
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
index 74e9142a7c..1cf597b8c9 100644
--- a/indra/newview/llpersonfolderview.h
+++ b/indra/newview/llpersonfolderview.h
@@ -50,6 +50,10 @@ public:
 	LLPersonFolderView(const Params &p);
 	~LLPersonFolderView();
 
+	
+	void createPersonTabs();
+	void createPersonTab(const std::string& tab_name);
+
 	bool onConversationModelEvent(const LLSD &event);
 	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
 
-- 
cgit v1.2.3


From 0408a984d3efb55cdf88c314e333be3b29c291ea Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 3 May 2013 13:55:12 -0700
Subject: ACME-324 Populate list with FB only friends: When clicking the '+'
 button FB only friends will appear in the second tab titled 'Invite people
 you know to SL'.

---
 indra/newview/llpanelpeople.cpp      | 38 ++++++++++++++++++++++++++++++++----
 indra/newview/llpersonfolderview.cpp |  1 +
 indra/newview/llpersonfolderview.h   |  1 +
 3 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 22b79a9380..e1933c041c 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1641,17 +1641,29 @@ void LLPanelPeople::openFacebookWeb(std::string url)
 void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 {
 	mFacebookFriends->clear();
+	S32 model_index;
 
 	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
 	{
 		std::string name = i->second["name"].asString();
 		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
 		
+		//FB+SL but not SL friend
+		if(agent_id.notNull())
+		{
+			model_index = 0;
+		}
+		//FB only friend
+		else
+		{
+			model_index = 1;
+		}
+
 		//add to avatar list
 		mFacebookFriends->addNewItem(agent_id, name, false);
 
 		//Add to folder view
-		LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
+		LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]);
 		if(session_model)
 		{
 			addParticipantToModel(session_model, agent_id, name);
@@ -1663,11 +1675,29 @@ void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
     std::string prefix("Test Name");
+	LLPersonTabModel * person_folder_model;
+	LLUUID agentID;
+	std::string name;
+	S32 model_index;
+
 	for(int i = 0; i < 300; ++i)
 	{
-		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
-        std::string name = prefix + " " + suffix;
-		addParticipantToModel(person_folder_model, gAgent.getID(), name);
+		//Adds FB+SL people that aren't yet SL friends
+		if(i < 10)
+		{
+			model_index = 0;	
+			agentID = gAgent.getID();
+		}
+		//Adds FB only friends
+		else
+		{
+			model_index = 1;
+			agentID = LLUUID(NULL);
+		}
+
+		person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]);
+        name = prefix + " " + suffix;
+		addParticipantToModel(person_folder_model, agentID, name);
         // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ...
         suffix[1]+=1;
         if (suffix[1]=='{')
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 21578e986b..8f468e6814 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -65,6 +65,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name)
 	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
 	widget->addToFolder(this);
 
+	mPersonTabIDs.push_back(item->getID());
 	mPersonFolderModelMap[item->getID()] = item;
 	mPersonFolderViewMap[item->getID()] = widget;
 }
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
index 1cf597b8c9..3f5f874e0f 100644
--- a/indra/newview/llpersonfolderview.h
+++ b/indra/newview/llpersonfolderview.h
@@ -61,6 +61,7 @@ public:
 
 	person_folder_model_map mPersonFolderModelMap;
 	person_folder_view_map mPersonFolderViewMap;
+	std::vector<LLUUID> mPersonTabIDs;
 	LLEventStream mConversationsEventStream;
 };
 
-- 
cgit v1.2.3


From cca67a38d89da30d2b36690d91eb00cac04384bd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 3 May 2013 16:18:47 -0700
Subject: =?UTF-8?q?ACME-326=20Add=20=E2=80=98connect=20to=20facebook?=
 =?UTF-8?q?=E2=80=99=20on=20menu=20bar=20with=20functionality:=20Now=20the?=
 =?UTF-8?q?=20'SL=20residents=20you=20may=20want=20to=20friend'=20folder?=
 =?UTF-8?q?=20is=20populated=20only=20with=20FB+SL=20users=20who=20are=20n?=
 =?UTF-8?q?ot=20yet=20friends.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 indra/newview/llpanelpeople.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index e1933c041c..f9f4d6d1b6 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1642,14 +1642,18 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 {
 	mFacebookFriends->clear();
 	S32 model_index;
+	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
 
 	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
 	{
 		std::string name = i->second["name"].asString();
 		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
 		
+		//add to avatar list
+		mFacebookFriends->addNewItem(agent_id, name, false);
+
 		//FB+SL but not SL friend
-		if(agent_id.notNull())
+		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
 		{
 			model_index = 0;
 		}
@@ -1659,9 +1663,6 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 			model_index = 1;
 		}
 
-		//add to avatar list
-		mFacebookFriends->addNewItem(agent_id, name, false);
-
 		//Add to folder view
 		LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]);
 		if(session_model)
-- 
cgit v1.2.3


From ad12517329e73abf64ccc926aa49453cb4b73bfc Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 3 May 2013 17:03:37 -0700
Subject: ACME-275 : WIP : Filtering

---
 indra/llui/llfolderview.cpp          |  5 +++++
 indra/llui/llfolderviewitem.cpp      | 16 +++++++++++++++-
 indra/newview/llpanelpeople.cpp      |  1 +
 indra/newview/llpersonfolderview.cpp |  1 +
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index cf449217f5..679a76e26f 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1652,6 +1652,11 @@ void LLFolderView::update()
 	}
 
   BOOL is_visible = isInVisibleChain();
+    
+    if (getName() == "Persons")
+    {
+        llinfos << "Merov : update Persons, is_visible = " << is_visible << llendl;
+    }
 
   // Puts folders/items in proper positions
   // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849)
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 6c147ccc12..88bc0ccfd4 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -953,6 +953,12 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange");
 // * Makes sure that this view and its children are the right size
 S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 {
+    llinfos << "Merov : LLFolderViewFolder::arrange, folder = " << getName() << llendl;
+    if (getName() == "Facebook Friends Tab Two")
+    {
+        llinfos << "Merov : Arranging Facebook Friends Tab Two, needs arrange = " << needsArrange() << ", is open = " << isOpen() << llendl;
+    }
+    
 	// Sort before laying out contents
     // Note that we sort from the root (CHUI-849)
 	getRoot()->getFolderViewModel()->sort(this);
@@ -1109,7 +1115,11 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 
 BOOL LLFolderViewFolder::needsArrange()
 {
-	return mLastArrangeGeneration < getRoot()->getArrangeGeneration(); 
+    if (getName() != "")
+    {
+        llinfos << "Merov : needsArrange for " << getName() << ", last = " << mLastArrangeGeneration << ", current = " << getRoot()->getArrangeGeneration() << ", need = " << (mLastArrangeGeneration < getRoot()->getArrangeGeneration() ? "true" : "false") << llendl;
+    }
+	return mLastArrangeGeneration != getRoot()->getArrangeGeneration();
 }
 
 // Passes selection information on to children and record selection
@@ -1631,6 +1641,10 @@ void LLFolderViewFolder::requestArrange()
 
 void LLFolderViewFolder::toggleOpen()
 {
+    if (getName() == "Facebook Friends Tab Two")
+    {
+        llinfos << "Merov : toggleOpen, currently open is = " << isOpen() << llendl;
+    }
 	setOpen(!isOpen());
 }
 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 03135ce580..66a183d5e5 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1224,6 +1224,7 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
     else if (cur_tab == FBCTESTTWO_TAB_NAME)
     {
         mPersonFolderViewModel.getFilter().setFilterSubString(filter);
+        mPersonFolderView->requestArrange();
     }
 }
 
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index ba1e9d20eb..8d2191aebb 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -37,6 +37,7 @@ LLPersonFolderView::LLPersonFolderView(const Params &p) :
 LLFolderView(p),
 	mConversationsEventStream("ConversationsEventsTwo")
 {
+    rename("Persons");  // For tracking!
 	mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1));
 }
 
-- 
cgit v1.2.3


From e30c0925f517b18830b7a4d520246acd98981ab3 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 6 May 2013 11:31:22 -0700
Subject: ACME-326 Populate the list with FB users who use SL but are not yet
 SL friends: Code cleanup

---
 indra/newview/llpanelpeople.cpp      | 12 +++----
 indra/newview/llpersonfolderview.cpp | 68 +++++++++++++++++++++---------------
 indra/newview/llpersonfolderview.h   |  7 ++--
 3 files changed, 49 insertions(+), 38 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f9f4d6d1b6..56523773b8 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1664,10 +1664,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		}
 
 		//Add to folder view
-		LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]);
-		if(session_model)
+		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(model_index));
+		if(person_tab_model)
 		{
-			addParticipantToModel(session_model, agent_id, name);
+			addParticipantToModel(person_tab_model, agent_id, name);
 		}
 	}
 }
@@ -1676,7 +1676,7 @@ void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
     std::string prefix("Test Name");
-	LLPersonTabModel * person_folder_model;
+	LLPersonTabModel * person_tab_model;
 	LLUUID agentID;
 	std::string name;
 	S32 model_index;
@@ -1696,9 +1696,9 @@ void LLPanelPeople::addTestParticipant()
 			agentID = LLUUID(NULL);
 		}
 
-		person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]);
+		person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(model_index));
         name = prefix + " " + suffix;
-		addParticipantToModel(person_folder_model, agentID, name);
+		addParticipantToModel(person_tab_model, agentID, name);
         // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ...
         suffix[1]+=1;
         if (suffix[1]=='{')
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 8f468e6814..191c7d5bcd 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -47,29 +47,6 @@ LLPersonFolderView::~LLPersonFolderView()
 	mConversationsEventStream.stopListening("ConversationsRefresh");
 }
 
-void LLPersonFolderView::createPersonTabs()
-{
-	createPersonTab("SL residents you may want to friend");
-	createPersonTab("Invite people you know to SL");
-}
-
-void LLPersonFolderView::createPersonTab(const std::string& tab_name)
-{
-	//Create a person tab
-	LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel);
-	LLPersonTabView::Params params;
-	params.name = item->getDisplayName();
-	params.root = this;
-	params.listener = item;
-	params.tool_tip = params.name;
-	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
-	widget->addToFolder(this);
-
-	mPersonTabIDs.push_back(item->getID());
-	mPersonFolderModelMap[item->getID()] = item;
-	mPersonFolderViewMap[item->getID()] = widget;
-}
-
 BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
 {
 	LLFolderViewItem * item = getCurSelectedItem();
@@ -97,6 +74,29 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
 	return LLView::handleMouseDown( x, y, mask );
 }
 
+void LLPersonFolderView::createPersonTabs()
+{
+	createPersonTab("SL residents you may want to friend");
+	createPersonTab("Invite people you know to SL");
+}
+
+void LLPersonFolderView::createPersonTab(const std::string& tab_name)
+{
+	//Create a person tab
+	LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel);
+	LLPersonTabView::Params params;
+	params.name = item->getDisplayName();
+	params.root = this;
+	params.listener = item;
+	params.tool_tip = params.name;
+	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
+	widget->addToFolder(this);
+
+	mIndexToFolderVec.push_back(item->getID());
+	mPersonFolderModelMap[item->getID()] = item;
+	mPersonFolderViewMap[item->getID()] = widget;
+}
+
 bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
 {
 	std::string type = event.get("type").asString();
@@ -105,17 +105,17 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
 
 	if(type == "add_participant")
 	{
-		LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
-		LLPersonTabView * person_folder_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[folder_id]);
+		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
+		LLPersonTabView * person_tab_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[folder_id]);
 
-		if(person_folder_model)
+		if(person_tab_model)
 		{
-			LLPersonModel * person_model = person_folder_model->findParticipant(person_id);
+			LLPersonModel * person_model = person_tab_model->findParticipant(person_id);
 
 			if(person_model)
 			{
-				LLPersonView * participant_view = createConversationViewParticipant(person_model);
-				participant_view->addToFolder(person_folder_view);
+				LLPersonView * person_view = createConversationViewParticipant(person_model);
+				person_view->addToFolder(person_tab_view);
 			}
 		}
 	}
@@ -137,3 +137,13 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod
 
 	return LLUICtrlFactory::create<LLPersonView>(params);
 }
+
+LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index)
+{
+	return mPersonFolderModelMap[mIndexToFolderVec[index]];
+}
+
+LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index)
+{
+	return mPersonFolderViewMap[mIndexToFolderVec[index]];
+}
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
index 3f5f874e0f..3a15f59164 100644
--- a/indra/newview/llpersonfolderview.h
+++ b/indra/newview/llpersonfolderview.h
@@ -50,18 +50,19 @@ public:
 	LLPersonFolderView(const Params &p);
 	~LLPersonFolderView();
 
+	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
 	
 	void createPersonTabs();
 	void createPersonTab(const std::string& tab_name);
-
 	bool onConversationModelEvent(const LLSD &event);
 	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
 
-	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
+	LLPersonTabModel * getPersonTabModelByIndex(const S32 index);
+	LLPersonTabView * getPersonTabViewByIndex(const S32 index);
 
 	person_folder_model_map mPersonFolderModelMap;
 	person_folder_view_map mPersonFolderViewMap;
-	std::vector<LLUUID> mPersonTabIDs;
+	std::vector<LLUUID> mIndexToFolderVec;
 	LLEventStream mConversationsEventStream;
 };
 
-- 
cgit v1.2.3


From f6ad5819c15b1acca1a8b6498bc56adf1c0c3ac9 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 6 May 2013 11:46:16 -0700
Subject: ACME-326 Populate the list with FB users who use SL but are not yet
 SL friends: Code cleanup

---
 indra/newview/llpanelpeople.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 56523773b8..b9afe10d84 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1663,7 +1663,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 			model_index = 1;
 		}
 
-		//Add to folder view
+		//Add to person tab model
 		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(model_index));
 		if(person_tab_model)
 		{
-- 
cgit v1.2.3


From c451672ee7e3bc8229a3e5cba544c93495147024 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 6 May 2013 14:22:46 -0700
Subject: ACME-338 Hide info button for FB only friends: Upon hover of FB only
 friends the info button and profile button are hidden.

---
 indra/newview/llpanelpeople.cpp       | 16 ++++++++--------
 indra/newview/llpersonfolderview.cpp  | 19 +++++++++----------
 indra/newview/llpersonfolderview.h    | 16 ++++++++--------
 indra/newview/llpersonmodelcommon.cpp |  5 +++--
 indra/newview/llpersonmodelcommon.h   | 10 +++++++++-
 indra/newview/llpersontabview.cpp     | 20 +++++++++++++++-----
 indra/newview/llpersontabview.h       |  8 +++++---
 7 files changed, 57 insertions(+), 37 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index b9afe10d84..f7492a51e1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1641,7 +1641,7 @@ void LLPanelPeople::openFacebookWeb(std::string url)
 void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 {
 	mFacebookFriends->clear();
-	S32 model_index;
+	LLPersonTabModel::tab_type tab_type;
 	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
 
 	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
@@ -1655,16 +1655,16 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 		//FB+SL but not SL friend
 		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
 		{
-			model_index = 0;
+			tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
 		}
 		//FB only friend
 		else
 		{
-			model_index = 1;
+			tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
 		}
 
 		//Add to person tab model
-		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(model_index));
+		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
 		if(person_tab_model)
 		{
 			addParticipantToModel(person_tab_model, agent_id, name);
@@ -1679,24 +1679,24 @@ void LLPanelPeople::addTestParticipant()
 	LLPersonTabModel * person_tab_model;
 	LLUUID agentID;
 	std::string name;
-	S32 model_index;
+	LLPersonTabModel::tab_type tab_type;
 
 	for(int i = 0; i < 300; ++i)
 	{
 		//Adds FB+SL people that aren't yet SL friends
 		if(i < 10)
 		{
-			model_index = 0;	
+			tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;	
 			agentID = gAgent.getID();
 		}
 		//Adds FB only friends
 		else
 		{
-			model_index = 1;
+			tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
 			agentID = LLUUID(NULL);
 		}
 
-		person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(model_index));
+		person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
         name = prefix + " " + suffix;
 		addParticipantToModel(person_tab_model, agentID, name);
         // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ...
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index 191c7d5bcd..c22e4f3e58 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -30,7 +30,6 @@
 #include "llpersonfolderview.h"
 
 #include "llpersontabview.h"
-#include "llpersonmodelcommon.h"
 
 
 LLPersonFolderView::LLPersonFolderView(const Params &p) : 
@@ -76,14 +75,14 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
 
 void LLPersonFolderView::createPersonTabs()
 {
-	createPersonTab("SL residents you may want to friend");
-	createPersonTab("Invite people you know to SL");
+	createPersonTab(LLPersonTabModel::FB_SL_NON_SL_FRIEND, "SL residents you may want to friend");
+	createPersonTab(LLPersonTabModel::FB_ONLY_FRIEND, "Invite people you know to SL");
 }
 
-void LLPersonFolderView::createPersonTab(const std::string& tab_name)
+void LLPersonFolderView::createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name)
 {
 	//Create a person tab
-	LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel);
+	LLPersonTabModel* item = new LLPersonTabModel(tab_type, tab_name, *mViewModel);
 	LLPersonTabView::Params params;
 	params.name = item->getDisplayName();
 	params.root = this;
@@ -92,7 +91,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name)
 	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
 	widget->addToFolder(this);
 
-	mIndexToFolderVec.push_back(item->getID());
+	mIndexToFolderMap[tab_type] = item->getID();
 	mPersonFolderModelMap[item->getID()] = item;
 	mPersonFolderViewMap[item->getID()] = widget;
 }
@@ -138,12 +137,12 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod
 	return LLUICtrlFactory::create<LLPersonView>(params);
 }
 
-LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index)
+LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type)
 {
-	return mPersonFolderModelMap[mIndexToFolderVec[index]];
+	return mPersonFolderModelMap[mIndexToFolderMap[tab_type]];
 }
 
-LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index)
+LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type)
 {
-	return mPersonFolderViewMap[mIndexToFolderVec[index]];
+	return mPersonFolderViewMap[mIndexToFolderMap[tab_type]];
 }
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
index 3a15f59164..85dec6515d 100644
--- a/indra/newview/llpersonfolderview.h
+++ b/indra/newview/llpersonfolderview.h
@@ -27,7 +27,10 @@
 #ifndef LL_LLPERSONFOLDERVIEW_H
 #define LL_LLPERSONFOLDERVIEW_H
 
-class LLPersonTabModel;
+#include "llevents.h"
+#include "llfolderview.h"
+#include "llpersonmodelcommon.h"
+
 class LLPersonTabView;
 class LLPersonView;
 class LLPersonModel;
@@ -35,9 +38,6 @@ class LLPersonModel;
 typedef std::map<LLUUID, LLPersonTabModel *> person_folder_model_map;
 typedef std::map<LLUUID, LLPersonTabView *> person_folder_view_map;
 
-#include "llevents.h"
-#include "llfolderview.h"
-
 class LLPersonFolderView : public LLFolderView
 {
 public:
@@ -53,16 +53,16 @@ public:
 	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
 	
 	void createPersonTabs();
-	void createPersonTab(const std::string& tab_name);
+	void createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name);
 	bool onConversationModelEvent(const LLSD &event);
 	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
 
-	LLPersonTabModel * getPersonTabModelByIndex(const S32 index);
-	LLPersonTabView * getPersonTabViewByIndex(const S32 index);
+	LLPersonTabModel * getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type);
+	LLPersonTabView * getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type);
 
 	person_folder_model_map mPersonFolderModelMap;
 	person_folder_view_map mPersonFolderViewMap;
-	std::vector<LLUUID> mIndexToFolderVec;
+	std::map<LLPersonTabModel::tab_type, LLUUID> mIndexToFolderMap;
 	LLEventStream mConversationsEventStream;
 };
 
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 6b4c71faa2..70a24ac77a 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -132,8 +132,9 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
 // LLPersonTabModel
 // 
 
-LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(display_name,root_view_model)
+LLPersonTabModel::LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(display_name,root_view_model),
+mTabType(tab_type)
 {
 
 }
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index f44f619d18..7be3387564 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -108,7 +108,13 @@ protected:
 class LLPersonTabModel : public LLPersonModelCommon
 {
 public:
-	LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model);
+	enum tab_type
+	{
+		FB_SL_NON_SL_FRIEND,
+		FB_ONLY_FRIEND,
+	};
+
+	LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model);
 	LLPersonTabModel(LLFolderViewModelInterface& root_view_model);
 
 	LLPointer<LLUIImage> getIcon() const { return NULL; }
@@ -118,6 +124,8 @@ public:
 	void clearParticipants();
 	LLPersonModel* findParticipant(const LLUUID& person_id);
 
+	tab_type mTabType;
+
 private:
 };
 
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index fdc024beb8..0dfd53705b 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -160,8 +160,10 @@ S32 LLPersonView::getLabelXPos()
 void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
 {
 	LLFolderViewItem::addToFolder(person_folder_view);
-	//Added item to folder, could change folder's mHasVisibleChildren flag so call arrange
+	//Added item to folder could change folder's mHasVisibleChildren flag so call arrange
 	person_folder_view->requestArrange();
+
+	mPersonTabModel = static_cast<LLPersonTabModel *>(getParentFolder()->getViewModelItem());
 }
 
 LLPersonView::~LLPersonView()
@@ -191,16 +193,24 @@ BOOL LLPersonView::postBuild()
 
 void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask)
 {
-	mInfoBtn->setVisible(TRUE);
-	mProfileBtn->setVisible(TRUE);
+	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
+	{
+		mInfoBtn->setVisible(TRUE);
+		mProfileBtn->setVisible(TRUE);
+	}
+
 	updateChildren();
 	LLFolderViewItem::onMouseEnter(x, y, mask);
 }
 
 void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask)
 {
-	mInfoBtn->setVisible(FALSE);
-	mProfileBtn->setVisible(FALSE);
+	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
+	{
+		mInfoBtn->setVisible(FALSE);
+		mProfileBtn->setVisible(FALSE);
+	}
+
 	updateChildren();
 	LLFolderViewItem::onMouseLeave(x, y, mask);
 }
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 9cce615167..9e5fdc3057 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -33,6 +33,8 @@
 #include "lloutputmonitorctrl.h"
 #include "lltextbox.h"
 
+class LLPersonTabModel;
+
 class LLPersonTabView : public LLFolderViewFolder
 {
 
@@ -104,9 +106,11 @@ protected:
 
 private:
 
+	//Short-cut to tab model
+	LLPersonTabModel * mPersonTabModel;
+
 	LLPointer<LLUIImage> mImageOver;
 	LLPointer<LLUIImage> mImageSelected;
-
 	LLAvatarIconCtrl* mAvatarIcon;
 	LLTextBox * mLastInteractionTimeTextbox;
 	LLIconCtrl * mPermissionEditTheirsIcon;
@@ -117,8 +121,6 @@ private:
 	LLButton * mProfileBtn;
 	LLOutputMonitorCtrl * mOutputMonitorCtrl;
 
-
-
 	typedef enum e_avatar_item_child {
 		ALIC_SPEAKER_INDICATOR,
 		ALIC_PROFILE_BUTTON,
-- 
cgit v1.2.3


From 04587bdb9d5e1653d5b19a6ca51e547180994958 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 6 May 2013 17:53:18 -0700
Subject: ACME-340 Get facebook icon from spec and add to viewer: Added a
 facebook icon and the icon appears only for the 'Invite people you know to
 SL' tab.

---
 indra/newview/llpersontabview.cpp                  |  33 +++++++++++++++++++--
 indra/newview/llpersontabview.h                    |   2 ++
 .../skins/default/textures/icons/Facebook.png      | Bin 0 -> 365 bytes
 indra/newview/skins/default/textures/textures.xml  |   2 ++
 .../skins/default/xui/en/widgets/person_view.xml   |  12 ++++++++
 5 files changed, 47 insertions(+), 2 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/icons/Facebook.png

diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 0dfd53705b..6aa51febcb 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -125,6 +125,7 @@ bool LLPersonView::sChildrenWidthsInitialized = false;
 ChildWidthVec LLPersonView::mChildWidthVec;
 
 LLPersonView::Params::Params() :
+facebook_icon("facebook_icon"),
 avatar_icon("avatar_icon"),
 last_interaction_time_textbox("last_interaction_time_textbox"),
 permission_edit_theirs_icon("permission_edit_theirs_icon"),
@@ -140,6 +141,7 @@ LLPersonView::LLPersonView(const LLPersonView::Params& p) :
 LLFolderViewItem(p),
 mImageOver(LLUI::getUIImage("ListItem_Over")),
 mImageSelected(LLUI::getUIImage("ListItem_Select")),
+mFacebookIcon(NULL),
 mAvatarIcon(NULL),
 mLastInteractionTimeTextbox(NULL),
 mPermissionEditTheirsIcon(NULL),
@@ -154,7 +156,19 @@ mOutputMonitorCtrl(NULL)
 
 S32 LLPersonView::getLabelXPos()
 {
-	return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;
+	S32 label_x_pos;
+
+	if(mAvatarIcon->getVisible())
+	{
+		label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;
+	}
+	else
+	{
+		label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad;
+	}
+
+
+	return label_x_pos;
 }
 
 void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
@@ -164,6 +178,16 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
 	person_folder_view->requestArrange();
 
 	mPersonTabModel = static_cast<LLPersonTabModel *>(getParentFolder()->getViewModelItem());
+
+	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
+	{
+		mAvatarIcon->setVisible(TRUE);
+	}
+	else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND)
+	{
+		mFacebookIcon->setVisible(TRUE); 
+	}
+
 }
 
 LLPersonView::~LLPersonView()
@@ -295,11 +319,16 @@ void LLPersonView::drawHighlight()
 
 void LLPersonView::initFromParams(const LLPersonView::Params & params)
 {
+	LLIconCtrl::Params facebook_icon_params(params.facebook_icon());
+	applyXUILayout(facebook_icon_params, this);
+	mFacebookIcon = LLUICtrlFactory::create<LLIconCtrl>(facebook_icon_params);
+	addChild(mFacebookIcon);
+
 	LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon());
 	applyXUILayout(avatar_icon_params, this);
 	mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params);
 	addChild(mAvatarIcon);
-	
+
 	LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox());
 	applyXUILayout(last_interaction_time_textbox, this);
 	mLastInteractionTimeTextbox = LLUICtrlFactory::create<LLTextBox>(last_interaction_time_textbox);
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 9e5fdc3057..9839a1eaaf 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -77,6 +77,7 @@ public:
 	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
 	{
 		Params();
+		Optional<LLIconCtrl::Params> facebook_icon;
 		Optional<LLAvatarIconCtrl::Params> avatar_icon;
 		Optional<LLTextBox::Params> last_interaction_time_textbox;
 		Optional<LLIconCtrl::Params> permission_edit_theirs_icon;
@@ -111,6 +112,7 @@ private:
 
 	LLPointer<LLUIImage> mImageOver;
 	LLPointer<LLUIImage> mImageSelected;
+	LLIconCtrl * mFacebookIcon;
 	LLAvatarIconCtrl* mAvatarIcon;
 	LLTextBox * mLastInteractionTimeTextbox;
 	LLIconCtrl * mPermissionEditTheirsIcon;
diff --git a/indra/newview/skins/default/textures/icons/Facebook.png b/indra/newview/skins/default/textures/icons/Facebook.png
new file mode 100644
index 0000000000..8287d56f88
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Facebook.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 5b17ef94db..18146943a5 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -199,6 +199,8 @@ 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="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" />
   <texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="false" />
   <texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="false" />
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 4a39109f36..006437401c 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -13,6 +13,17 @@
   text_pad_right="4"
   arrow_size="10"
   max_folder_item_overlap="2">
+    <facebook_icon
+      layout="topleft"
+      follows="left"
+      height="16"
+      image_name="Facebook_Icon"
+      left="5"
+      top="5"
+      name="facebook_icon"
+      tool_tip="Facebook User"
+      visible="false"
+      width="16" />
     <avatar_icon
       follows="left"
       layout="topleft"
@@ -20,6 +31,7 @@
       default_icon_name="Generic_Person"
       left="5"
       top="2"
+      visible="false"
       width="20" />
     <last_interaction_time_textbox
       layout="topleft"
-- 
cgit v1.2.3


From 9b849a45e82d359e1066948aa79878c0f26819f7 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 6 May 2013 18:19:08 -0700
Subject: ACME-341 Hide the avatar icon and use the FB icon instead: Adjusted
 positioning of facebook icon to better match spec.

---
 indra/newview/skins/default/xui/en/widgets/person_view.xml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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 006437401c..46c1b7ff75 100644
--- a/indra/newview/skins/default/xui/en/widgets/person_view.xml
+++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml
@@ -14,16 +14,15 @@
   arrow_size="10"
   max_folder_item_overlap="2">
     <facebook_icon
-      layout="topleft"
       follows="left"
-      height="16"
+      height="14"
       image_name="Facebook_Icon"
       left="5"
-      top="5"
+      bottom="6"
       name="facebook_icon"
       tool_tip="Facebook User"
       visible="false"
-      width="16" />
+      width="14" />
     <avatar_icon
       follows="left"
       layout="topleft"
-- 
cgit v1.2.3


From 00275301fc6606c98f77f8fbb8e485b3788831a8 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 6 May 2013 18:31:27 -0700
Subject: ACME-275 : Fixed! Filtering on FB list works (tested with simulated
 data only so far)

---
 indra/llui/llfolderview.cpp           |  5 -----
 indra/llui/llfolderviewitem.cpp       | 16 +---------------
 indra/newview/llpersonmodelcommon.cpp | 28 ++++++++++++++++++++++++----
 indra/newview/llpersonmodelcommon.h   | 14 ++++++++------
 4 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 679a76e26f..9cf822892e 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1653,11 +1653,6 @@ void LLFolderView::update()
 
   BOOL is_visible = isInVisibleChain();
     
-    if (getName() == "Persons")
-    {
-        llinfos << "Merov : update Persons, is_visible = " << is_visible << llendl;
-    }
-
   // Puts folders/items in proper positions
   // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849)
   // It also handles the open/close folder animation
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 88bc0ccfd4..0c0c54c38c 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -953,12 +953,6 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange");
 // * Makes sure that this view and its children are the right size
 S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 {
-    llinfos << "Merov : LLFolderViewFolder::arrange, folder = " << getName() << llendl;
-    if (getName() == "Facebook Friends Tab Two")
-    {
-        llinfos << "Merov : Arranging Facebook Friends Tab Two, needs arrange = " << needsArrange() << ", is open = " << isOpen() << llendl;
-    }
-    
 	// Sort before laying out contents
     // Note that we sort from the root (CHUI-849)
 	getRoot()->getFolderViewModel()->sort(this);
@@ -1115,11 +1109,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 
 BOOL LLFolderViewFolder::needsArrange()
 {
-    if (getName() != "")
-    {
-        llinfos << "Merov : needsArrange for " << getName() << ", last = " << mLastArrangeGeneration << ", current = " << getRoot()->getArrangeGeneration() << ", need = " << (mLastArrangeGeneration < getRoot()->getArrangeGeneration() ? "true" : "false") << llendl;
-    }
-	return mLastArrangeGeneration != getRoot()->getArrangeGeneration();
+	return mLastArrangeGeneration < getRoot()->getArrangeGeneration();
 }
 
 // Passes selection information on to children and record selection
@@ -1641,10 +1631,6 @@ void LLFolderViewFolder::requestArrange()
 
 void LLFolderViewFolder::toggleOpen()
 {
-    if (getName() == "Facebook Friends Tab Two")
-    {
-        llinfos << "Merov : toggleOpen, currently open is = " << isOpen() << llendl;
-    }
 	setOpen(!isOpen());
 }
 
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index 6b4c71faa2..9fefc17345 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -48,6 +48,7 @@ LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_m
     LLFolderViewModelItemCommon(root_view_model),
 	mName(""),
     mSearchableName(""),
+    mPrevPassedAllFilters(false),
 	mID(LLUUID().generateNewID())
 {
 }
@@ -103,11 +104,11 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
         llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl;
         return true;
     }
-*/        
+ */
     if (!mChildren.empty())
     {
         // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders)
-        setPassedFilter(1, -1);
+        setPassedFilter(1, filter.getCurrentGeneration());
         // Call filter recursively on all children
         for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end();
             iter != end_iter;
@@ -121,13 +122,31 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
     {
         // If there's no children, the current instance is a person and we check and set the passed filter flag on it
         const bool passed_filter = filter.check(this);
-        setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize());
+        setPassedFilter(passed_filter, filter.getCurrentGeneration(), filter.getStringMatchOffset(this), filter.getFilterStringSize());
     }
     
     filter.clearModified();
     return true;
 }
 
+void LLPersonModelCommon::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size)
+{
+	LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size);
+	bool before = mPrevPassedAllFilters;
+	mPrevPassedAllFilters = passedFilter(filter_generation);
+    
+    if (before != mPrevPassedAllFilters)
+	{
+        // Need to rearrange the folder if the filtered state of the item changed
+		LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder();
+		if (parent_folder)
+		{
+			parent_folder->requestArrange();
+		}
+	}
+}
+
+
 //
 // LLPersonTabModel
 // 
@@ -217,7 +236,8 @@ LLPersonViewFilter::LLPersonViewFilter() :
     mEmptyLookupMessage(""),
     mFilterSubString(""),
     mName(""),
-    mFilterModified(FILTER_NONE)
+    mFilterModified(FILTER_NONE),
+    mCurrentGeneration(0)
 {
 }
 
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index f44f619d18..1b8197cf6a 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -75,7 +75,7 @@ public:
 	virtual bool filter( LLFolderViewFilter& filter);
 
 	virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; }
-//	virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { }
+	virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0);
 	virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; }
 
 	// The action callbacks
@@ -102,6 +102,7 @@ protected:
 
 	std::string mName;              // Name of the person
 	std::string mSearchableName;	// Name used in string matching for this person
+    bool mPrevPassedAllFilters;
 	LLUUID mID;
 };	
 
@@ -172,7 +173,7 @@ public:
 	void 				clearModified();
 	const std::string& 	getName() const { return mName; }
 	const std::string& 	getFilterText() { return mName; }
-	void 				setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; }
+	void 				setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; mCurrentGeneration++; }
     
 	// +-------------------------------------------------------------------+
 	// + Time
@@ -193,10 +194,10 @@ public:
 	// +-------------------------------------------------------------------+
 	// + Generation
 	// +-------------------------------------------------------------------+
-    // Note : unclear if we have to take tab on generation at that point
-	S32 				getCurrentGeneration() const { return 0; }
-	S32 				getFirstSuccessGeneration() const { return 0; }
-	S32 				getFirstRequiredGeneration() const { return 0; }
+    // Note : For the moment, we do not support restrictive filtering so all generation indexes are pointing to the current generation
+	S32 				getCurrentGeneration() const { return mCurrentGeneration; }
+	S32 				getFirstSuccessGeneration() const { return mCurrentGeneration; }
+	S32 				getFirstRequiredGeneration() const { return mCurrentGeneration; }
 
     // Non Virtual Methods (i.e. specific to this class)
 	void 				setFilterSubString(const std::string& string);
@@ -206,6 +207,7 @@ private:
 	std::string         mEmptyLookupMessage;
 	std::string			mFilterSubString;
 	EFilterModified 	mFilterModified;
+	S32					mCurrentGeneration;
 };
 
 class LLPersonViewSort
-- 
cgit v1.2.3


From 54de882b81083298009e3b4a3d74fa1c7255068d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 7 May 2013 13:47:18 -0700
Subject: ACME-343 : Add Connect to Facebook menu item

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 39e777b246..9ce360415c 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -15,6 +15,13 @@
          function="ShowAgentProfile"
          parameter="agent" />
       </menu_item_call>
+      <menu_item_call
+        label="Connect to Facebook..."
+        name="ConnectToFacebook">
+        <menu_item_call.on_click
+          function="People.loginFBC" />
+      </menu_item_call>
+      <menu_item_separator/>
       <menu_item_call
        label="Appearance..."
        name="ChangeOutfit">
-- 
cgit v1.2.3


From 3a351c4ee548e2bce8ad0d5935377a090591621f Mon Sep 17 00:00:00 2001
From: Don Kjer <don@lindenlab.com>
Date: Wed, 8 May 2013 05:51:28 +0000
Subject: Adding follow_redirects parameter to LLHTTPClient get/head variants. 
 Not following redirects for facebook connect requests.

---
 indra/llmessage/llhttpclient.cpp         | 35 +++++++++++++++++++-------------
 indra/llmessage/llhttpclient.h           | 19 +++++++++++------
 indra/llmessage/llurlrequest.cpp         | 21 +++++++++++++------
 indra/llmessage/llurlrequest.h           |  9 ++++----
 indra/newview/llpanelpeople.cpp          | 15 +++++++++++---
 indra/newview/tests/lltranslate_test.cpp |  4 ++--
 6 files changed, 68 insertions(+), 35 deletions(-)

diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index 3561459bb4..2d16237161 100755
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -217,7 +217,8 @@ static void request(
 	Injector* body_injector,
 	LLCurl::ResponderPtr responder,
 	const F32 timeout = HTTP_REQUEST_EXPIRY_SECS,
-	const LLSD& headers = LLSD()
+	const LLSD& headers = LLSD(),
+	bool follow_redirects = true
     )
 {
 	if (!LLHTTPClient::hasPump())
@@ -231,7 +232,7 @@ static void request(
 	}
 	LLPumpIO::chain_t chain;
 
-	LLURLRequest* req = new LLURLRequest(method, url);
+	LLURLRequest* req = new LLURLRequest(method, url, follow_redirects);
 	if(!req->isValid())//failed
 	{
 		if (responder)
@@ -334,7 +335,8 @@ void LLHTTPClient::getByteRange(
 	S32 bytes,
 	ResponderPtr responder,
 	const LLSD& hdrs,
-	const F32 timeout)
+	const F32 timeout,
+	bool follow_redirects /* = true */)
 {
 	LLSD headers = hdrs;
 	if(offset > 0 || bytes > 0)
@@ -342,37 +344,42 @@ void LLHTTPClient::getByteRange(
 		std::string range = llformat("bytes=%d-%d", offset, offset+bytes-1);
 		headers["Range"] = range;
 	}
-    request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers);
+    request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects);
 }
 
 void LLHTTPClient::head(
 	const std::string& url,
 	ResponderPtr responder,
 	const LLSD& headers,
-	const F32 timeout)
+	const F32 timeout,
+	bool follow_redirects /* = true */)
 {
-	request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers);
+	request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects);
 }
 
-void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout)
+void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout,
+					   bool follow_redirects /* = true */)
 {
-	request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers);
+	request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects);
 }
-void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout)
+void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers,
+								 const F32 timeout, bool follow_redirects /* = true */)
 {
-	request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers);
+	request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects);
 }
-void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout)
+void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout,
+								 bool follow_redirects /* = true */)
 {
-	getHeaderOnly(url, responder, LLSD(), timeout);
+	getHeaderOnly(url, responder, LLSD(), timeout, follow_redirects);
 }
 
-void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers, const F32 timeout)
+void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers,
+					   const F32 timeout, bool follow_redirects /* = true */)
 {
 	LLURI uri;
 	
 	uri = LLURI::buildHTTP(url, LLSD::emptyArray(), query);
-	get(uri.asString(), responder, headers, timeout);
+	get(uri.asString(), responder, headers, timeout, follow_redirects);
 }
 
 // A simple class for managing data returned from a curl http request.
diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h
index a7236ba169..5de257a4f6 100644
--- a/indra/llmessage/llhttpclient.h
+++ b/indra/llmessage/llhttpclient.h
@@ -63,10 +63,15 @@ public:
 		const std::string& url,
 		ResponderPtr,
 		const LLSD& headers = LLSD(),
-		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
-	static void getByteRange(const std::string& url, S32 offset, S32 bytes, ResponderPtr, const LLSD& headers=LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
-	static void get(const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
-	static void get(const std::string& url, const LLSD& query, ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
+		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS,
+		bool follow_redirects = true);
+	static void getByteRange(const std::string& url, S32 offset, S32 bytes, ResponderPtr,
+							 const LLSD& headers=LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS,
+							 bool follow_redirects = true);
+	static void get(const std::string& url, ResponderPtr, const LLSD& headers = LLSD(),
+					const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true);
+	static void get(const std::string& url, const LLSD& query, ResponderPtr, const LLSD& headers = LLSD(),
+					const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true);
 
 	static void put(
 		const std::string& url,
@@ -74,8 +79,10 @@ public:
 		ResponderPtr,
 		const LLSD& headers = LLSD(),
 		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
-	static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
-	static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
+	static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS,
+							  bool follow_redirects = true);
+	static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers,
+							  const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true);
 
 	static void post(
 		const std::string& url,
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 627d591839..49f8144ee7 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -150,16 +150,19 @@ std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action)
 	return VERBS[action];
 }
 
-LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action) :
-	mAction(action)
+LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action, bool follow_redirects /* = true */) :
+	mAction(action),
+	mFollowRedirects(follow_redirects)
 {
 	initialize();
 }
 
 LLURLRequest::LLURLRequest(
 	LLURLRequest::ERequestAction action,
-	const std::string& url) :
-	mAction(action)
+	const std::string& url,
+	bool follow_redirects /* = true */) :
+	mAction(action),
+	mFollowRedirects(follow_redirects)
 {
 	initialize();
 	setURL(url);
@@ -479,12 +482,18 @@ bool LLURLRequest::configure()
 	case HTTP_HEAD:
 		mDetail->mCurlRequest->setopt(CURLOPT_HEADER, 1);
 		mDetail->mCurlRequest->setopt(CURLOPT_NOBODY, 1);
-		mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+		if (mFollowRedirects)
+		{
+			mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+		}
 		rv = true;
 		break;
 	case HTTP_GET:
 		mDetail->mCurlRequest->setopt(CURLOPT_HTTPGET, 1);
-		mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+		if (mFollowRedirects)
+		{
+			mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1);
+		}
 
 		// Set Accept-Encoding to allow response compression
 		mDetail->mCurlRequest->setoptString(CURLOPT_ENCODING, "");
diff --git a/indra/llmessage/llurlrequest.h b/indra/llmessage/llurlrequest.h
index 44d358d906..20d6e30d17 100644
--- a/indra/llmessage/llurlrequest.h
+++ b/indra/llmessage/llurlrequest.h
@@ -95,7 +95,7 @@ public:
 	 *
 	 * @param action One of the ERequestAction enumerations.
 	 */
-	LLURLRequest(ERequestAction action);
+	LLURLRequest(ERequestAction action, bool follow_redirects = true);
 
 	/** 
 	 * @brief Constructor.
@@ -103,7 +103,7 @@ public:
 	 * @param action One of the ERequestAction enumerations.
 	 * @param url The url of the request. It should already be encoded.
 	 */
-	LLURLRequest(ERequestAction action, const std::string& url);
+	LLURLRequest(ERequestAction action, const std::string& url, bool follow_redirects = true);
 
 	/** 
 	 * @brief Destructor.
@@ -219,10 +219,11 @@ protected:
 	};
 	EState mState;
 	ERequestAction mAction;
+	bool mFollowRedirects;
 	LLURLRequestDetail* mDetail;
 	LLIOPipe::ptr_t mCompletionCallback;
-	 S32 mRequestTransferedBytes;
-	 S32 mResponseTransferedBytes;
+	S32 mRequestTransferedBytes;
+	S32 mResponseTransferedBytes;
 
 	static CURLcode _sslCtxCallback(CURL * curl, void *sslctx, void *param);
 	
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index af9ecd743c..479e503ef0 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1854,14 +1854,20 @@ public:
 
 void LLPanelPeople::loadFacebookFriends()
 {
-	LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this));
+	const bool follow_redirects=false;
+	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+	LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this),
+					  LLSD(), timeout, follow_redirects);
 }
 
 void LLPanelPeople::tryToReconnectToFacebook()
 {
 	if (!mConnectedToFbc)
 	{
-		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false));
+		const bool follow_redirects=false;
+		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false),
+						  LLSD(), timeout, follow_redirects);
 	}
 }
 
@@ -1895,7 +1901,10 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 	else
 	{
-		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true));
+		const bool follow_redirects=false;
+		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true),
+						  LLSD(), timeout, follow_redirects);
 	}
 }
 
diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp
index fd9527d631..8ce56326d8 100644
--- a/indra/newview/tests/lltranslate_test.cpp
+++ b/indra/newview/tests/lltranslate_test.cpp
@@ -308,8 +308,8 @@ void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) {
 void LLCurl::Responder::result(LLSD const&) {}
 LLCurl::Responder::~Responder() {}
 
-void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32) {}
-void LLHTTPClient::get(const std::string&, LLPointer<LLCurl::Responder>, const LLSD&, const F32) {}
+void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32, bool) {}
+void LLHTTPClient::get(const std::string&, LLPointer<LLCurl::Responder>, const LLSD&, const F32, bool) {}
 
 LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer)
 :	std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {}
-- 
cgit v1.2.3


From 7d6e3945204c05efe85eadf8a6635d0ca30e9186 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 8 May 2013 19:17:47 +0100
Subject: temporary hack for fb demo to use https://pdp15.lindenlab.com instead
 of going through cap server

---
 indra/newview/llpanelpeople.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 479e503ef0..9956888134 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1887,7 +1887,8 @@ void LLPanelPeople::disconnectFromFacebook()
 
 std::string LLPanelPeople::getFacebookConnectURL(const std::string& route)
 {
-	static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
+	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
+	static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
 	std::string url = sFacebookConnectUrl + route;
 	llinfos << url << llendl;
 	return url;
-- 
cgit v1.2.3


From 2d65482d7152b613409a071e0a117d38f350932a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 8 May 2013 15:26:45 -0700
Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL
 name, FB icon, and FB name: Adjusted personview/personmodel contain a suffix
 which is the FB username for SL+FB users

---
 indra/newview/llpanelpeople.cpp       | 15 ++++++++++-----
 indra/newview/llpersonmodelcommon.cpp | 14 ++++++++++++--
 indra/newview/llpersonmodelcommon.h   |  6 ++++--
 indra/newview/llpersontabview.cpp     | 23 ++++++++++++++++++++++-
 indra/newview/llpersontabview.h       |  1 +
 5 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 9956888134..07a1c46256 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -732,6 +732,7 @@ BOOL LLPanelPeople::postBuild()
 	folder_view_params.view_model = &mPersonFolderViewModel;
 	folder_view_params.root = NULL;
 	folder_view_params.use_ellipses = false;
+	folder_view_params.use_label_suffix = true;
 	folder_view_params.options_menu = "menu_conversation.xml";
 	folder_view_params.name = "fbcfolderview";
 	mPersonFolderView = LLUICtrlFactory::create<LLPersonFolderView>(folder_view_params);
@@ -1676,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
-    std::string prefix("Test Name");
+    std::string prefix("Second Life User Name Goes Here");
 	LLPersonTabModel * person_tab_model;
 	LLUUID agentID;
 	std::string name;
@@ -1717,11 +1718,15 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 	LLPersonModel* person_model = NULL;
 
 	LLAvatarName avatar_name;
-	bool avatar_name_exists = LLAvatarNameCache::get(agent_id, &avatar_name);
-
-	std::string aggregated_name = avatar_name_exists ? name + " (" + avatar_name.getDisplayName() + ") " : name;
+	bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name);
+	std::string avatar_name_string;
+	
+	if(has_name)
+	{
+		avatar_name_string = avatar_name.getDisplayName();
+	}
 
-	person_model = new LLPersonModel(agent_id, aggregated_name, mPersonFolderViewModel);
+	person_model = new LLPersonModel(agent_id, name, avatar_name_string, mPersonFolderViewModel);
 	person_folder_model->addParticipant(person_model);
 }
 
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index b3424cc451..e48eddf05a 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -39,14 +39,24 @@
 
 LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) :
     LLFolderViewModelItemCommon(root_view_model),
+	mLabelSuffix(""),
 	mID(LLUUID().generateNewID())
 {
     renameItem(display_name);
 }
 
+LLPersonModelCommon::LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model) :
+LLFolderViewModelItemCommon(root_view_model),
+	mID(LLUUID().generateNewID())
+{
+	mLabelSuffix = suffix;
+	renameItem(display_name);
+}
+
 LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) :
     LLFolderViewModelItemCommon(root_view_model),
 	mName(""),
+	mLabelSuffix(""),
     mSearchableName(""),
     mPrevPassedAllFilters(false),
 	mID(LLUUID().generateNewID())
@@ -212,8 +222,8 @@ LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id)
 // LLPersonModel
 // 
 
-LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(display_name,root_view_model),
+LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model) :
+LLPersonModelCommon(display_name, suffix, root_view_model),
 mAgentID(agent_id)
 {
 }
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
index 5f3801874d..74598eaee0 100644
--- a/indra/newview/llpersonmodelcommon.h
+++ b/indra/newview/llpersonmodelcommon.h
@@ -40,6 +40,7 @@ class LLPersonModelCommon : public LLFolderViewModelItemCommon
 public:
 
 	LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model);
+	LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model);
 	LLPersonModelCommon(LLFolderViewModelInterface& root_view_model);
 	virtual ~LLPersonModelCommon();
 
@@ -51,7 +52,7 @@ public:
 	virtual LLPointer<LLUIImage> getIcon() const { return NULL; }
 	virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
 	virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
-	virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
+	virtual std::string getLabelSuffix() const { return mLabelSuffix; }
 	virtual BOOL isItemRenameable() const { return TRUE; }
 	virtual BOOL renameItem(const std::string& new_name);
 	virtual BOOL isItemMovable( void ) const { return FALSE; }
@@ -101,6 +102,7 @@ public:
 protected:
 
 	std::string mName;              // Name of the person
+	std::string mLabelSuffix;
 	std::string mSearchableName;	// Name used in string matching for this person
     bool mPrevPassedAllFilters;
 	LLUUID mID;
@@ -133,7 +135,7 @@ private:
 class LLPersonModel : public LLPersonModelCommon
 {
 public:
-	LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model);
+	LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model);
 	LLPersonModel(LLFolderViewModelInterface& root_view_model);
 
 	LLUUID getAgentID();
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 6aa51febcb..16ebb6af90 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -182,6 +182,7 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
 	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
 	{
 		mAvatarIcon->setVisible(TRUE);
+		mFacebookIcon->setVisible(TRUE); 
 	}
 	else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND)
 	{
@@ -286,7 +287,20 @@ void LLPersonView::draw()
 	F32 right_x  = 0;
 
 	drawHighlight();
-	drawLabel(font, text_left, y, color, right_x);
+	drawLabel(mLabel, font, text_left, y, color, right_x);
+
+	if(mLabelSuffix.length())
+	{
+		LLRect mFacebookIconRect = mFacebookIcon->getRect();
+		S32 new_left = right_x + 7;
+		mFacebookIconRect.set(new_left, 
+			mFacebookIconRect.mTop, 
+			new_left + mFacebookIconRect.getWidth(),
+			mFacebookIconRect.mBottom);
+		mFacebookIcon->setRect(mFacebookIconRect);
+	}
+
+	drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x);
 
 	LLView::draw();
 }
@@ -317,6 +331,13 @@ void LLPersonView::drawHighlight()
 	}
 }
 
+void LLPersonView::drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x)
+{
+	font->renderUTF8(text, 0, x, y, color,
+		LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
+		S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE);
+}
+
 void LLPersonView::initFromParams(const LLPersonView::Params & params)
 {
 	LLIconCtrl::Params facebook_icon_params(params.facebook_icon());
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 9839a1eaaf..6f244c2794 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -104,6 +104,7 @@ protected:
 	
 	void draw();
 	void drawHighlight();
+	void drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
 
 private:
 
-- 
cgit v1.2.3


From 14be8efcc6a9797d2041e56addd0897f0b4234ea Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 8 May 2013 16:53:52 -0700
Subject: ACME-348 : WIP : LLFacebookConnect refactoring

---
 indra/newview/CMakeLists.txt        |   2 +
 indra/newview/llfacebookconnect.cpp | 215 ++++++++++++++++++++++++++++++++++++
 indra/newview/llfacebookconnect.h   |  66 +++++++++++
 indra/newview/llpanelpeople.cpp     | 178 -----------------------------
 indra/newview/llpanelpeople.h       |   4 -
 5 files changed, 283 insertions(+), 182 deletions(-)
 create mode 100644 indra/newview/llfacebookconnect.cpp
 create mode 100644 indra/newview/llfacebookconnect.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 6b7fa7d842..44b1604b15 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -185,6 +185,7 @@ set(viewer_SOURCE_FILES
     llexpandabletextbox.cpp
     llexternaleditor.cpp
     llface.cpp
+    llfacebookconnect.cpp
     llfasttimerview.cpp
     llfavoritesbar.cpp
     llfeaturemanager.cpp
@@ -769,6 +770,7 @@ set(viewer_HEADER_FILES
     llexpandabletextbox.h
     llexternaleditor.h
     llface.h
+    llfacebookconnect.h
     llfasttimerview.h
     llfavoritesbar.h
     llfeaturemanager.h
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
new file mode 100644
index 0000000000..1962f6fd97
--- /dev/null
+++ b/indra/newview/llfacebookconnect.cpp
@@ -0,0 +1,215 @@
+/** 
+ * @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"
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookConnectResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookConnectResponder);
+public:
+    
+	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
+			
+			// Grab some graph data now that we are connected
+            LLFacebookConnect::instance().setConnected(true);
+			LLFacebookConnect::instance().loadFacebookFriends();
+		}
+		else
+		{
+			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+		}
+	}
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookDisconnectResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookDisconnectResponder);
+public:
+    
+	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
+			
+			// Hide all the facebook stuff
+            LLFacebookConnect::instance().setConnected(false);
+			LLFacebookConnect::instance().hideFacebookFriends();
+		}
+		else
+		{
+			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+		}
+	}
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookConnectedResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookDisconnectResponder);
+public:
+    
+	LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {}
+    
+	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
+            
+			// Grab some graph data if already connected
+            LLFacebookConnect::instance().setConnected(true);
+			LLFacebookConnect::instance().loadFacebookFriends();
+		}
+		else
+		{
+			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+            
+			// show the facebook login page if not connected yet
+			if ((status == 404) && mShowLoginIfNotConnected)
+			{
+				LLFacebookConnect::instance().connectToFacebook();
+			}
+		}
+	}
+    
+private:
+	bool mShowLoginIfNotConnected;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookFriendsResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookFriendsResponder);
+public:
+
+	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL;
+            
+			// Display the list of friends
+			LLFacebookConnect::instance().showFacebookFriends(content);
+		}
+		else
+		{
+			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+		}
+	}
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+LLFacebookConnect::LLFacebookConnect()
+:	mConnectedToFbc(false)
+{
+}
+
+void LLFacebookConnect::init()
+{
+}
+
+void LLFacebookConnect::loadFacebookFriends()
+{
+	const bool follow_redirects=false;
+	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+	LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this),
+					  LLSD(), timeout, follow_redirects);
+}
+
+void LLFacebookConnect::hideFacebookFriends()
+{
+    // That needs to be done in llpanelpeople...
+	//mFacebookFriends->clear();
+}
+
+void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
+{
+	LLSD body;
+	if (!auth_code.empty())
+		body["code"] = auth_code;
+    
+	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this));
+}
+
+void LLFacebookConnect::showFacebookFriends(const LLSD& friends)
+{
+    /* All that needs to be rewritten to 
+	mFacebookFriends->clear();
+	LLPersonTabModel::tab_type tab_type;
+	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
+    
+	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
+	{
+		std::string name = i->second["name"].asString();
+		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
+		
+		//add to avatar list
+		mFacebookFriends->addNewItem(agent_id, name, false);
+        
+		//FB+SL but not SL friend
+		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
+		{
+			tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+		}
+		//FB only friend
+		else
+		{
+			tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+		}
+        
+		//Add to person tab model
+		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
+		if(person_tab_model)
+		{
+			addParticipantToModel(person_tab_model, agent_id, name);
+		}
+	}
+     */
+}
+
+
+
+
+
+
+
+
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
new file mode 100644
index 0000000000..d60fdacd90
--- /dev/null
+++ b/indra/newview/llfacebookconnect.h
@@ -0,0 +1,66 @@
+/** 
+ * @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"
+
+/**
+ * @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>
+{
+	LOG_CLASS(LLFacebookConnect);
+public:
+	/*
+	 * Performs initial setup, by requesting config data from the web service if
+	 * it has not already been received.
+	 */
+	void init();
+
+    void loadFacebookFriends();
+    void hideFacebookFriends();
+	void connectToFacebook(const std::string& auth_code = "");
+	void showFacebookFriends(const LLSD& friends);
+    
+    void setConnected(bool connected) { mConnectedToFbc = connected; }
+
+private:
+
+	friend class LLSingleton<LLFacebookConnect>;
+
+	LLFacebookConnect();
+	~LLFacebookConnect() {};
+    
+    bool mConnectedToFbc;
+};
+
+#endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 9956888134..ce3ae48aca 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1639,40 +1639,6 @@ void LLPanelPeople::openFacebookWeb(std::string url)
 	LLUrlAction::openURLExternal(url);
 }
 
-void LLPanelPeople::showFacebookFriends(const LLSD& friends)
-{
-	mFacebookFriends->clear();
-	LLPersonTabModel::tab_type tab_type;
-	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
-
-	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
-	{
-		std::string name = i->second["name"].asString();
-		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
-		
-		//add to avatar list
-		mFacebookFriends->addNewItem(agent_id, name, false);
-
-		//FB+SL but not SL friend
-		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
-		{
-			tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
-		}
-		//FB only friend
-		else
-		{
-			tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-		}
-
-		//Add to person tab model
-		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
-		if(person_tab_model)
-		{
-			addParticipantToModel(person_tab_model, agent_id, name);
-		}
-	}
-}
-
 void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
@@ -1725,141 +1691,6 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 	person_folder_model->addParticipant(person_model);
 }
 
-void LLPanelPeople::hideFacebookFriends()
-{
-	mFacebookFriends->clear();
-}
-
-class FacebookConnectResponder : public LLHTTPClient::Responder
-{
-public:
-
-	LLPanelPeople * mPanelPeople;
-
-	FacebookConnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
-
-	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (isGoodStatus(status))
-		{
-			llinfos << content << llendl;
-			
-			// grab some graph data now that we are connected
-			mPanelPeople->mConnectedToFbc = true;
-			mPanelPeople->loadFacebookFriends();
-		}
-		else
-		{
-			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
-		}
-	}
-
-	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (status == 302)
-		{
-			mPanelPeople->openFacebookWeb(content["location"]);
-		}
-	}
-};
-
-class FacebookDisconnectResponder : public LLHTTPClient::Responder
-{
-public:
-
-	LLPanelPeople * mPanelPeople;
-
-	FacebookDisconnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
-
-	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (isGoodStatus(status))
-		{
-			llinfos << content << llendl;
-			
-			// hide all the facebook stuff
-			mPanelPeople->mConnectedToFbc = false;
-			mPanelPeople->hideFacebookFriends();
-		}
-		else
-		{
-			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
-		}
-	}
-};
-
-class FacebookConnectedResponder : public LLHTTPClient::Responder
-{
-public:
-
-	LLPanelPeople * mPanelPeople;
-	bool mShowLoginIfNotConnected;
-
-	FacebookConnectedResponder(LLPanelPeople * panel_people, bool show_login_if_not_connected) : mPanelPeople(panel_people), mShowLoginIfNotConnected(show_login_if_not_connected) {}
-
-	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (isGoodStatus(status))
-		{
-			llinfos << content << llendl;
-
-			// grab some graph data if already connected
-			mPanelPeople->mConnectedToFbc = true;
-			mPanelPeople->loadFacebookFriends();
-		}
-		else
-		{
-			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
-
-			// show the facebook login page if not connected yet
-			if (status == 404 && mShowLoginIfNotConnected)
-			{
-				mPanelPeople->connectToFacebook();
-			}
-		}
-	}
-};
-
-class FacebookFriendsResponder : public LLHTTPClient::Responder
-{
-public:
-
-	LLPanelPeople * mPanelPeople;
-
-	FacebookFriendsResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {}
-
-	/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (isGoodStatus(status))
-		{
-			llinfos << content << llendl;
-
-			// display the list of friends
-			mPanelPeople->showFacebookFriends(content);
-		}
-		else
-		{
-			llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl;
-		}
-	}
-
-	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (status == 302)
-		{
-			mPanelPeople->openFacebookWeb(content["location"]);
-		}
-	}
-};
-
-void LLPanelPeople::loadFacebookFriends()
-{
-	const bool follow_redirects=false;
-	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-	LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this),
-					  LLSD(), timeout, follow_redirects);
-}
-
 void LLPanelPeople::tryToReconnectToFacebook()
 {
 	if (!mConnectedToFbc)
@@ -1871,15 +1702,6 @@ void LLPanelPeople::tryToReconnectToFacebook()
 	}
 }
 
-void LLPanelPeople::connectToFacebook(const std::string& auth_code)
-{
-	LLSD body;
-	if (!auth_code.empty())
-		body["code"] = auth_code;
-
-	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this));
-}
-
 void LLPanelPeople::disconnectFromFacebook()
 {
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this));
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 943d84ac1d..fa354f7ecb 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -63,13 +63,9 @@ public:
 	static void idle(void * user_data);
 
 	void openFacebookWeb(std::string url);
-	void showFacebookFriends(const LLSD& friends);
 	void addTestParticipant();
 	void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
-	void hideFacebookFriends();
-	void loadFacebookFriends();
 	void tryToReconnectToFacebook();
-	void connectToFacebook(const std::string& auth_code = "");
 	void disconnectFromFacebook();
 	
 	std::string getFacebookConnectURL(const std::string& route = "");
-- 
cgit v1.2.3


From 62eda57ea1f4d3e39aa34010f7709908f24fb6e2 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 9 May 2013 10:25:21 -0700
Subject: ACME-348 : WIP : LLFacebookConnect refactorin completed. Not
 functional yet though.

---
 indra/newview/llfacebookconnect.cpp | 92 +++++++++++++++++++++++++++++++++----
 indra/newview/llfacebookconnect.h   |  8 +++-
 indra/newview/llpanelpeople.cpp     | 72 +++--------------------------
 indra/newview/llpanelpeople.h       |  9 +---
 4 files changed, 98 insertions(+), 83 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 1962f6fd97..ec2085c2ac 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -29,6 +29,38 @@
 
 #include "llfacebookconnect.h"
 
+#include "llagent.h"
+#include "llcallingcard.h"			// for LLAvatarTracker
+//#include "llcommandhandler.h"
+#include "llhttpclient.h"
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/*
+class LLFacebookConnectHandler : public LLCommandHandler
+{
+public:
+	LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) { }
+    
+	bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
+	{
+		if (tokens.size() > 0)
+		{
+			if (tokens[0].asString() == "connect")
+			{
+				if (query_map.has("code"))
+				{
+                    LLFacebookConnect::instance().connectToFacebook(query_map["code"]);
+				}
+				return true;
+			}
+		}
+		return false;
+	}
+};
+LLFacebookConnectHandler gFacebookConnectHandler;
+*/
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 class LLFacebookConnectResponder : public LLHTTPClient::Responder
@@ -81,7 +113,7 @@ public:
 //
 class LLFacebookConnectedResponder : public LLHTTPClient::Responder
 {
-	LOG_CLASS(LLFacebookDisconnectResponder);
+	LOG_CLASS(LLFacebookConnectedResponder);
 public:
     
 	LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {}
@@ -147,11 +179,20 @@ void LLFacebookConnect::init()
 {
 }
 
+std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
+{
+	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
+	static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+	std::string url = sFacebookConnectUrl + route;
+	llinfos << url << llendl;
+	return url;
+}
+
 void LLFacebookConnect::loadFacebookFriends()
 {
 	const bool follow_redirects=false;
 	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-	LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this),
+	LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(),
 					  LLSD(), timeout, follow_redirects);
 }
 
@@ -167,15 +208,41 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
 	if (!auth_code.empty())
 		body["code"] = auth_code;
     
-	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this));
+	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder());
+}
+
+void LLFacebookConnect::disconnectFromFacebook()
+{
+	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
+}
+
+void LLFacebookConnect::tryToReconnectToFacebook()
+{
+	if (!mConnectedToFbc)
+	{
+		const bool follow_redirects=false;
+		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+		LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(false),
+						  LLSD(), timeout, follow_redirects);
+	}
+}
+
+void LLFacebookConnect::getConnectionToFacebook()
+{
+    const bool follow_redirects=false;
+    const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+    LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true),
+                  LLSD(), timeout, follow_redirects);
 }
 
 void LLFacebookConnect::showFacebookFriends(const LLSD& friends)
 {
-    /* All that needs to be rewritten to 
-	mFacebookFriends->clear();
-	LLPersonTabModel::tab_type tab_type;
+    /* All that needs to be rewritten a different way */
+    // FOR TESTING ONLY!! Print out the data in the log
+	//mFacebookFriends->clear();
+	//LLPersonTabModel::tab_type tab_type;
 	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
+    llinfos << "LLFacebookConnect::showFacebookFriends" << llendl;
     
 	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
 	{
@@ -183,27 +250,32 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends)
 		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
 		
 		//add to avatar list
-		mFacebookFriends->addNewItem(agent_id, name, false);
+		//mFacebookFriends->addNewItem(agent_id, name, false);
         
 		//FB+SL but not SL friend
+        bool is_SL_friend = false;
 		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
 		{
-			tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+			//tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+            is_SL_friend = false;
 		}
 		//FB only friend
 		else
 		{
-			tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+			//tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+            is_SL_friend = true;
 		}
+        llinfos << "LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl;
         
 		//Add to person tab model
+        /*
 		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
 		if(person_tab_model)
 		{
 			addParticipantToModel(person_tab_model, agent_id, name);
 		}
+         */
 	}
-     */
 }
 
 
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index d60fdacd90..c42d8c8edc 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -49,9 +49,14 @@ public:
     void loadFacebookFriends();
     void hideFacebookFriends();
 	void connectToFacebook(const std::string& auth_code = "");
+	void disconnectFromFacebook();
+	void tryToReconnectToFacebook();
+    void getConnectionToFacebook();
+    
 	void showFacebookFriends(const LLSD& friends);
     
     void setConnected(bool connected) { mConnectedToFbc = connected; }
+    bool getConnected() { return mConnectedToFbc; }
 
 private:
 
@@ -59,7 +64,8 @@ private:
 
 	LLFacebookConnect();
 	~LLFacebookConnect() {};
-    
+ 	std::string getFacebookConnectURL(const std::string& route = "");
+   
     bool mConnectedToFbc;
 };
 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ce3ae48aca..02a254b76c 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -54,8 +54,8 @@
 #include "llcallingcard.h"			// for LLAvatarTracker
 #include "llcallbacklist.h"
 #include "llerror.h"
+#include "llfacebookconnect.h"
 #include "llfloateravatarpicker.h"
-//#include "llfloaterminiinspector.h"
 #include "llfriendcard.h"
 #include "llgroupactions.h"
 #include "llgrouplist.h"
@@ -76,7 +76,6 @@
 #include "llspeakers.h"
 #include "llfloaterwebcontent.h"
 #include "llurlaction.h"
-#include "llcommandhandler.h"
 
 #define FRIEND_LIST_UPDATE_TIMEOUT	0.5
 #define NEARBY_LIST_UPDATE_INTERVAL 1
@@ -91,35 +90,6 @@ static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string FBCTESTTWO_TAB_NAME	= "fbctesttwo_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
-class LLFacebookConnectHandler : public LLCommandHandler
-{
-public:
-	LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE), mPanelPeople(NULL) { }
-
-	LLPanelPeople* mPanelPeople;
-
-	bool handle(const LLSD& tokens, const LLSD& query_map,
-				LLMediaCtrl* web)
-	{
-		if (tokens.size() > 0)
-		{
-			if (tokens[0].asString() == "connect")
-			{
-				if (query_map.has("code"))
-				{
-					if (mPanelPeople)
-					{
-						mPanelPeople->connectToFacebook(query_map["code"]);
-						mPanelPeople = NULL;
-					}
-				}
-				return true;
-			}
-		}
-		return false;
-	}
-};
-LLFacebookConnectHandler gFacebookConnectHandler;
 
 /** Comparator for comparing avatar items by last interaction date */
 class LLAvatarItemRecentComparator : public LLAvatarItemComparator
@@ -577,7 +547,6 @@ private:
 
 LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
-		mConnectedToFbc(false),
 		mPersonFolderView(NULL),
 		mTryToConnectToFbc(true),
 		mTabContainer(NULL),
@@ -947,7 +916,7 @@ void LLPanelPeople::updateFbcTestList()
 	if (mTryToConnectToFbc)
 	{	
 		// try to reconnect to facebook!
-		tryToReconnectToFacebook();
+		LLFacebookConnect::instance().tryToReconnectToFacebook();
 
 		// don't try again
 		mTryToConnectToFbc = false;
@@ -1633,11 +1602,12 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
+/*
 void LLPanelPeople::openFacebookWeb(std::string url)
 {
-	gFacebookConnectHandler.mPanelPeople = this;
 	LLUrlAction::openURLExternal(url);
 }
+*/
 
 void LLPanelPeople::addTestParticipant()
 {
@@ -1691,43 +1661,15 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 	person_folder_model->addParticipant(person_model);
 }
 
-void LLPanelPeople::tryToReconnectToFacebook()
-{
-	if (!mConnectedToFbc)
-	{
-		const bool follow_redirects=false;
-		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false),
-						  LLSD(), timeout, follow_redirects);
-	}
-}
-
-void LLPanelPeople::disconnectFromFacebook()
-{
-	LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this));
-}
-
-std::string LLPanelPeople::getFacebookConnectURL(const std::string& route)
-{
-	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-	static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
-	std::string url = sFacebookConnectUrl + route;
-	llinfos << url << llendl;
-	return url;
-}
-
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	if (mConnectedToFbc)
+	if (LLFacebookConnect::instance().getConnected())
 	{
-		disconnectFromFacebook();
+		LLFacebookConnect::instance().disconnectFromFacebook();
 	}
 	else
 	{
-		const bool follow_redirects=false;
-		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-		LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true),
-						  LLSD(), timeout, follow_redirects);
+        LLFacebookConnect::instance().getConnectionToFacebook();
 	}
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index fa354f7ecb..2f74064327 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -62,16 +62,11 @@ public:
 
 	static void idle(void * user_data);
 
-	void openFacebookWeb(std::string url);
+//	void openFacebookWeb(std::string url);
 	void addTestParticipant();
 	void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
-	void tryToReconnectToFacebook();
-	void disconnectFromFacebook();
 	
-	std::string getFacebookConnectURL(const std::string& route = "");
-	
-	bool mConnectedToFbc;
-	bool mTryToConnectToFbc;
+    bool mTryToConnectToFbc;
 
 	// internals
 	class Updater;
-- 
cgit v1.2.3


From 359c3d520eaf8de818081db32812387416add26a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 9 May 2013 16:02:03 -0700
Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL
 name, FB icon, and FB name: Rendering now matches the UX spec.

---
 indra/llui/llfolderviewitem.cpp   | 12 +++++++++++-
 indra/newview/llpanelpeople.cpp   |  6 +++---
 indra/newview/llpersontabview.cpp | 25 +++++++++++++------------
 3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 0c0c54c38c..f061313645 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -307,7 +307,12 @@ std::set<LLFolderViewItem*> LLFolderViewItem::getSelectionList() const
 // addToFolder() returns TRUE if it succeeds. FALSE otherwise
 void LLFolderViewItem::addToFolder(LLFolderViewFolder* folder)
 {
-	folder->addItem(this);
+	folder->addItem(this); 
+
+	// Compute indentation since parent folder changed
+	mIndentation = (getParentFolder())
+		? getParentFolder()->getIndentation() + mLocalIndentation
+		: 0; 
 }
 
 
@@ -940,6 +945,11 @@ LLFolderViewFolder::~LLFolderViewFolder( void )
 void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder)
 {
 	folder->addFolder(this);
+
+	// Compute indentation since parent folder changed
+	mIndentation = (getParentFolder())
+		? getParentFolder()->getIndentation() + mLocalIndentation
+		: 0; 
 }
 
 static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange");
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 07a1c46256..420225f260 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -731,7 +731,7 @@ BOOL LLPanelPeople::postBuild()
 	folder_view_params.listener = base_item;
 	folder_view_params.view_model = &mPersonFolderViewModel;
 	folder_view_params.root = NULL;
-	folder_view_params.use_ellipses = false;
+	folder_view_params.use_ellipses = true;
 	folder_view_params.use_label_suffix = true;
 	folder_view_params.options_menu = "menu_conversation.xml";
 	folder_view_params.name = "fbcfolderview";
@@ -1677,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
-    std::string prefix("Second Life User Name Goes Here");
+    std::string prefix("Facebook User Name");
 	LLPersonTabModel * person_tab_model;
 	LLUUID agentID;
 	std::string name;
@@ -1726,7 +1726,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 		avatar_name_string = avatar_name.getDisplayName();
 	}
 
-	person_model = new LLPersonModel(agent_id, name, avatar_name_string, mPersonFolderViewModel);
+	person_model = new LLPersonModel(agent_id, avatar_name_string, name, mPersonFolderViewModel);
 	person_folder_model->addParticipant(person_model);
 }
 
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 16ebb6af90..d4c73cd53f 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -173,6 +173,8 @@ S32 LLPersonView::getLabelXPos()
 
 void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
 {
+	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
+
 	LLFolderViewItem::addToFolder(person_folder_view);
 	//Added item to folder could change folder's mHasVisibleChildren flag so call arrange
 	person_folder_view->requestArrange();
@@ -183,6 +185,17 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
 	{
 		mAvatarIcon->setVisible(TRUE);
 		mFacebookIcon->setVisible(TRUE); 
+
+		S32 label_width = font->getWidth(mLabel);
+		F32 text_left = (F32)getLabelXPos();
+
+		LLRect mFacebookIconRect = mFacebookIcon->getRect();
+		S32 new_left = text_left + label_width + 7;
+		mFacebookIconRect.set(new_left, 
+			mFacebookIconRect.mTop, 
+			new_left + mFacebookIconRect.getWidth(),
+			mFacebookIconRect.mBottom);
+		mFacebookIcon->setRect(mFacebookIconRect);
 	}
 	else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND)
 	{
@@ -288,18 +301,6 @@ void LLPersonView::draw()
 
 	drawHighlight();
 	drawLabel(mLabel, font, text_left, y, color, right_x);
-
-	if(mLabelSuffix.length())
-	{
-		LLRect mFacebookIconRect = mFacebookIcon->getRect();
-		S32 new_left = right_x + 7;
-		mFacebookIconRect.set(new_left, 
-			mFacebookIconRect.mTop, 
-			new_left + mFacebookIconRect.getWidth(),
-			mFacebookIconRect.mBottom);
-		mFacebookIcon->setRect(mFacebookIconRect);
-	}
-
 	drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x);
 
 	LLView::draw();
-- 
cgit v1.2.3


From fb27eae15502cbd2a13cde018ae67f961320d0ba Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 9 May 2013 17:36:04 -0700
Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL
 name, FB icon, and FB name: Found a couple bugs that were causing the
 positioning of text to be incorrect in the 'Peope you may want to friend'
 tab.

---
 indra/llui/llfolderview.cpp       |  2 +-
 indra/newview/llpanelpeople.cpp   |  4 ++--
 indra/newview/llpersontabview.cpp | 10 ++++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 9cf822892e..20eade892d 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -185,7 +185,7 @@ LLFolderView::LLFolderView(const Params& p)
 	mAutoOpenCandidate = NULL;
 	mAutoOpenTimer.stop();
 	mKeyboardSelection = FALSE;
-	mIndentation = p.folder_indentation;
+	mIndentation = 	getParentFolder() ? getParentFolder()->getIndentation() + mLocalIndentation : 0;  
 
 	//clear label
 	// go ahead and render root folder as usual
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 420225f260..2bdfdf6687 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1677,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
 void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
-    std::string prefix("Facebook User Name");
+    std::string prefix("FB Name");
 	LLPersonTabModel * person_tab_model;
 	LLUUID agentID;
 	std::string name;
@@ -1718,7 +1718,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 	LLPersonModel* person_model = NULL;
 
 	LLAvatarName avatar_name;
-	bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name);
+	bool has_name = agent_id.notNull() ? LLAvatarNameCache::get(agent_id, &avatar_name) : false;
 	std::string avatar_name_string;
 	
 	if(has_name)
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index d4c73cd53f..34ffc6ffce 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -300,8 +300,14 @@ void LLPersonView::draw()
 	F32 right_x  = 0;
 
 	drawHighlight();
-	drawLabel(mLabel, font, text_left, y, color, right_x);
-	drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x);
+	if(mLabel.length())
+	{
+		drawLabel(mLabel, font, text_left, y, color, right_x);
+	}
+	if(mLabelSuffix.length())
+	{
+		drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x);
+	}
 
 	LLView::draw();
 }
-- 
cgit v1.2.3


From f90d93f75da6481dc1b308dfb76dd767e7623ea5 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 10 May 2013 15:10:53 -0700
Subject: ACME-348 : WIP : Add some traces to work out the protocol (temporary)

---
 indra/newview/llfacebookconnect.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index ec2085c2ac..e7f039aff1 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -173,6 +173,7 @@ public:
 LLFacebookConnect::LLFacebookConnect()
 :	mConnectedToFbc(false)
 {
+    llinfos << "Merov : LLFacebookConnect::LLFacebookConnect" << llendl;
 }
 
 void LLFacebookConnect::init()
@@ -181,6 +182,7 @@ void LLFacebookConnect::init()
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
+    llinfos << "Merov : LLFacebookConnect::getFacebookConnectURL. route = " << route << llendl;
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
 	static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
 	std::string url = sFacebookConnectUrl + route;
@@ -190,6 +192,7 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 
 void LLFacebookConnect::loadFacebookFriends()
 {
+    llinfos << "Merov : LLFacebookConnect::loadFacebookFriends" << llendl;
 	const bool follow_redirects=false;
 	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
 	LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(),
@@ -198,12 +201,14 @@ void LLFacebookConnect::loadFacebookFriends()
 
 void LLFacebookConnect::hideFacebookFriends()
 {
+    llinfos << "Merov : LLFacebookConnect::hideFacebookFriends" << llendl;
     // That needs to be done in llpanelpeople...
 	//mFacebookFriends->clear();
 }
 
 void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
 {
+    llinfos << "Merov : LLFacebookConnect::connectToFacebook" << llendl;
 	LLSD body;
 	if (!auth_code.empty())
 		body["code"] = auth_code;
@@ -213,11 +218,13 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
 
 void LLFacebookConnect::disconnectFromFacebook()
 {
+    llinfos << "Merov : LLFacebookConnect::disconnectFromFacebook" << llendl;
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
 }
 
 void LLFacebookConnect::tryToReconnectToFacebook()
 {
+    llinfos << "Merov : LLFacebookConnect::tryToReconnectToFacebook" << llendl;
 	if (!mConnectedToFbc)
 	{
 		const bool follow_redirects=false;
@@ -229,6 +236,7 @@ void LLFacebookConnect::tryToReconnectToFacebook()
 
 void LLFacebookConnect::getConnectionToFacebook()
 {
+    llinfos << "Merov : LLFacebookConnect::getConnectionToFacebook" << llendl;
     const bool follow_redirects=false;
     const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
     LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true),
@@ -242,7 +250,7 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends)
 	//mFacebookFriends->clear();
 	//LLPersonTabModel::tab_type tab_type;
 	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
-    llinfos << "LLFacebookConnect::showFacebookFriends" << llendl;
+    llinfos << "Merov : LLFacebookConnect::showFacebookFriends" << llendl;
     
 	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
 	{
@@ -257,15 +265,15 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends)
 		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
 		{
 			//tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
-            is_SL_friend = false;
+            is_SL_friend = true;
 		}
 		//FB only friend
 		else
 		{
 			//tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-            is_SL_friend = true;
+            is_SL_friend = false;
 		}
-        llinfos << "LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl;
+        llinfos << "Merov : LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl;
         
 		//Add to person tab model
         /*
-- 
cgit v1.2.3


From 7c4bfc8f55ebc581ddac0c2394b07b24d240d1a6 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 10 May 2013 18:25:45 -0700
Subject: ACME-348 : Completed : Facebook Connect refactored, LLPeoplePanel
 test list hooked correctly.

---
 indra/newview/llfacebookconnect.cpp | 100 ++++++++++--------------------------
 indra/newview/llfacebookconnect.h   |  19 ++++---
 indra/newview/llpanelpeople.cpp     |  54 ++++++++++++++++---
 indra/newview/llpanelpeople.h       |   5 +-
 4 files changed, 88 insertions(+), 90 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index e7f039aff1..7f8e3afe89 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -98,9 +98,9 @@ public:
 		{
 			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
 			
-			// Hide all the facebook stuff
+			// Clear all facebook stuff
             LLFacebookConnect::instance().setConnected(false);
-			LLFacebookConnect::instance().hideFacebookFriends();
+			LLFacebookConnect::instance().clearContent();
 		}
 		else
 		{
@@ -156,9 +156,7 @@ public:
 		if (isGoodStatus(status))
 		{
 			LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL;
-            
-			// Display the list of friends
-			LLFacebookConnect::instance().showFacebookFriends(content);
+			LLFacebookConnect::instance().storeContent(content);
 		}
 		else
 		{
@@ -171,18 +169,14 @@ public:
 ///////////////////////////////////////////////////////////////////////////////
 //
 LLFacebookConnect::LLFacebookConnect()
-:	mConnectedToFbc(false)
-{
-    llinfos << "Merov : LLFacebookConnect::LLFacebookConnect" << llendl;
-}
-
-void LLFacebookConnect::init()
+:	mConnectedToFbc(false),
+    mContent(),
+    mGeneration(0)
 {
 }
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
-    llinfos << "Merov : LLFacebookConnect::getFacebookConnectURL. route = " << route << llendl;
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
 	static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
 	std::string url = sFacebookConnectUrl + route;
@@ -190,25 +184,8 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 	return url;
 }
 
-void LLFacebookConnect::loadFacebookFriends()
-{
-    llinfos << "Merov : LLFacebookConnect::loadFacebookFriends" << llendl;
-	const bool follow_redirects=false;
-	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-	LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(),
-					  LLSD(), timeout, follow_redirects);
-}
-
-void LLFacebookConnect::hideFacebookFriends()
-{
-    llinfos << "Merov : LLFacebookConnect::hideFacebookFriends" << llendl;
-    // That needs to be done in llpanelpeople...
-	//mFacebookFriends->clear();
-}
-
 void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
 {
-    llinfos << "Merov : LLFacebookConnect::connectToFacebook" << llendl;
 	LLSD body;
 	if (!auth_code.empty())
 		body["code"] = auth_code;
@@ -218,13 +195,11 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
 
 void LLFacebookConnect::disconnectFromFacebook()
 {
-    llinfos << "Merov : LLFacebookConnect::disconnectFromFacebook" << llendl;
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
 }
 
 void LLFacebookConnect::tryToReconnectToFacebook()
 {
-    llinfos << "Merov : LLFacebookConnect::tryToReconnectToFacebook" << llendl;
 	if (!mConnectedToFbc)
 	{
 		const bool follow_redirects=false;
@@ -236,54 +211,35 @@ void LLFacebookConnect::tryToReconnectToFacebook()
 
 void LLFacebookConnect::getConnectionToFacebook()
 {
-    llinfos << "Merov : LLFacebookConnect::getConnectionToFacebook" << llendl;
     const bool follow_redirects=false;
     const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
     LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true),
                   LLSD(), timeout, follow_redirects);
 }
 
-void LLFacebookConnect::showFacebookFriends(const LLSD& friends)
+void LLFacebookConnect::loadFacebookFriends()
 {
-    /* All that needs to be rewritten a different way */
-    // FOR TESTING ONLY!! Print out the data in the log
-	//mFacebookFriends->clear();
-	//LLPersonTabModel::tab_type tab_type;
-	LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
-    llinfos << "Merov : LLFacebookConnect::showFacebookFriends" << llendl;
-    
-	for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
-	{
-		std::string name = i->second["name"].asString();
-		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
-		
-		//add to avatar list
-		//mFacebookFriends->addNewItem(agent_id, name, false);
-        
-		//FB+SL but not SL friend
-        bool is_SL_friend = false;
-		if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
-		{
-			//tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
-            is_SL_friend = true;
-		}
-		//FB only friend
-		else
-		{
-			//tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-            is_SL_friend = false;
-		}
-        llinfos << "Merov : LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl;
-        
-		//Add to person tab model
-        /*
-		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
-		if(person_tab_model)
-		{
-			addParticipantToModel(person_tab_model, agent_id, name);
-		}
-         */
-	}
+	const bool follow_redirects=false;
+	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+	LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(),
+					  LLSD(), timeout, follow_redirects);
+}
+
+void LLFacebookConnect::storeContent(const LLSD& content)
+{
+    mGeneration++;
+    mContent = content;
+}
+
+const LLSD& LLFacebookConnect::getContent() const
+{
+    return mContent;
+}
+
+void LLFacebookConnect::clearContent()
+{
+    mGeneration++;
+    mContent = LLSD();
 }
 
 
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index c42d8c8edc..691aaa9131 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -40,24 +40,21 @@ class LLFacebookConnect : public LLSingleton<LLFacebookConnect>
 {
 	LOG_CLASS(LLFacebookConnect);
 public:
-	/*
-	 * Performs initial setup, by requesting config data from the web service if
-	 * it has not already been received.
-	 */
-	void init();
-
-    void loadFacebookFriends();
-    void hideFacebookFriends();
 	void connectToFacebook(const std::string& auth_code = "");
 	void disconnectFromFacebook();
 	void tryToReconnectToFacebook();
     void getConnectionToFacebook();
     
-	void showFacebookFriends(const LLSD& friends);
+    void loadFacebookFriends();
+
+    void clearContent();
+	void storeContent(const LLSD& content);
+    const LLSD& getContent() const;
     
     void setConnected(bool connected) { mConnectedToFbc = connected; }
     bool getConnected() { return mConnectedToFbc; }
-
+    S32  generation() { return mGeneration; }
+    
 private:
 
 	friend class LLSingleton<LLFacebookConnect>;
@@ -67,6 +64,8 @@ private:
  	std::string getFacebookConnectURL(const std::string& route = "");
    
     bool mConnectedToFbc;
+    LLSD mContent;
+    S32  mGeneration;  
 };
 
 #endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 02a254b76c..8648a44c55 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -555,12 +555,13 @@ LLPanelPeople::LLPanelPeople()
 		mNearbyList(NULL),
 		mRecentList(NULL),
 		mGroupList(NULL),
-		mMiniMap(NULL)
+		mMiniMap(NULL),
+        mFacebookListGeneration(0)
 {
 	mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList,	this));
 	mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList,	this));
 	mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList,	this));
-	mFbcTestListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFbcTestList,	this));
+	mFacebookListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFacebookList,	this));
 	mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
 
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
@@ -595,7 +596,7 @@ LLPanelPeople::~LLPanelPeople()
 	delete mNearbyListUpdater;
 	delete mFriendListUpdater;
 	delete mRecentListUpdater;
-	delete mFbcTestListUpdater;
+	delete mFacebookListUpdater;
 
 	if(LLVoiceClient::instanceExists())
 	{
@@ -683,13 +684,17 @@ BOOL LLPanelPeople::postBuild()
 	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 
+    //===Temporary ========================================================================
+
 	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
 	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");
-	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2));
+    // Note: we use the same updater for both test lists (brute force but OK since it's temporary)
+	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2));
 
 	//===Test START========================================================================
 
 	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
+	socialtwo_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2));
 
 	//Create folder view
 	LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel);
@@ -911,7 +916,7 @@ void LLPanelPeople::updateRecentList()
 	mRecentList->setDirty();
 }
 
-void LLPanelPeople::updateFbcTestList()
+void LLPanelPeople::updateFacebookList()
 {
 	if (mTryToConnectToFbc)
 	{	
@@ -922,8 +927,45 @@ void LLPanelPeople::updateFbcTestList()
 		mTryToConnectToFbc = false;
 		
 		// stop updating
-		mFbcTestListUpdater->setActive(false);
+		mFacebookListUpdater->setActive(false);
 	}
+    
+    if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
+    {
+        mFacebookListGeneration = LLFacebookConnect::instance().generation();
+        LLSD friends = LLFacebookConnect::instance().getContent();
+
+        mFacebookFriends->clear();
+        LLPersonTabModel::tab_type tab_type;
+        LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
+        
+        for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
+        {
+            std::string name = i->second["name"].asString();
+            LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
+            
+            //add to avatar list
+            mFacebookFriends->addNewItem(agent_id, name, false);
+            
+            //FB+SL but not SL friend
+            if (agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
+            {
+                tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+            }
+            //FB only friend
+            else
+            {
+                tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+            }
+            
+            //Add to person tab model
+            LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
+            if (person_tab_model)
+            {
+                addParticipantToModel(person_tab_model, agent_id, name);
+            }
+        }
+    }
 }
 
 void LLPanelPeople::updateButtons()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 2f74064327..6b5514deaf 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -88,7 +88,7 @@ private:
 	void					updateFriendList();
 	void					updateNearbyList();
 	void					updateRecentList();
-	void					updateFbcTestList();
+	void					updateFacebookList();
 
 	bool					isItemsFreeOfFriends(const uuid_vec_t& uuids);
 
@@ -152,6 +152,7 @@ private:
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
 	LLSocialList*			mFacebookFriends;
+    S32                     mFacebookListGeneration;
 	LLNetMap*				mMiniMap;
 
 	std::vector<std::string> mSavedOriginalFilters;
@@ -162,7 +163,7 @@ private:
 	Updater*				mFriendListUpdater;
 	Updater*				mNearbyListUpdater;
 	Updater*				mRecentListUpdater;
-	Updater*				mFbcTestListUpdater;
+	Updater*				mFacebookListUpdater;
 	Updater*				mButtonsUpdater;
 	LLMenuButton*			mFBCGearButton;
     LLHandle< LLFloater >	mPicker;
-- 
cgit v1.2.3


From dbef09a2bb629cf6001a3963f6899bcac53b7774 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 13 May 2013 18:29:28 -0700
Subject: ACME-344 : Menu hooked up. Readded the missing completedHeader()
 methods in responder that I mistakenly took out during the refactor.

---
 indra/newview/llfacebookconnect.cpp                | 28 +++++++++++++++++++---
 indra/newview/llfacebookconnect.h                  |  1 +
 indra/newview/llpanelpeople.cpp                    |  8 -------
 indra/newview/llpanelpeople.h                      |  1 -
 indra/newview/llviewermenu.cpp                     | 19 +++++++++++++++
 indra/newview/llviewermenu.h                       |  4 ++++
 indra/newview/skins/default/xui/en/menu_viewer.xml |  2 +-
 7 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 7f8e3afe89..39aa82dc7a 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -31,12 +31,13 @@
 
 #include "llagent.h"
 #include "llcallingcard.h"			// for LLAvatarTracker
-//#include "llcommandhandler.h"
+#include "llcommandhandler.h"
 #include "llhttpclient.h"
+#include "llurlaction.h"
 
 ///////////////////////////////////////////////////////////////////////////////
 //
-/*
+
 class LLFacebookConnectHandler : public LLCommandHandler
 {
 public:
@@ -59,7 +60,6 @@ public:
 	}
 };
 LLFacebookConnectHandler gFacebookConnectHandler;
-*/
 
 ///////////////////////////////////////////////////////////////////////////////
 //
@@ -83,6 +83,15 @@ public:
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
+    
+    void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+    {
+        if (status == 302)
+        {
+            LLFacebookConnect::instance().openFacebookWeb(content["location"]);
+        }
+    }
+    
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -163,6 +172,14 @@ public:
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
+
+    void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+    {
+        if (status == 302)
+        {
+            LLFacebookConnect::instance().openFacebookWeb(content["location"]);
+        }
+    }
 };
 
 
@@ -175,6 +192,11 @@ LLFacebookConnect::LLFacebookConnect()
 {
 }
 
+void LLFacebookConnect::openFacebookWeb(std::string url)
+{
+	LLUrlAction::openURLExternal(url);
+}
+
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 691aaa9131..8036c9ce3e 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -55,6 +55,7 @@ public:
     bool getConnected() { return mConnectedToFbc; }
     S32  generation() { return mGeneration; }
     
+    void openFacebookWeb(std::string url);
 private:
 
 	friend class LLSingleton<LLFacebookConnect>;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 542597f98b..ba7015faf5 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -75,7 +75,6 @@
 #include "llsociallist.h"
 #include "llspeakers.h"
 #include "llfloaterwebcontent.h"
-#include "llurlaction.h"
 
 #define FRIEND_LIST_UPDATE_TIMEOUT	0.5
 #define NEARBY_LIST_UPDATE_INTERVAL 1
@@ -1645,13 +1644,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
-/*
-void LLPanelPeople::openFacebookWeb(std::string url)
-{
-	LLUrlAction::openURLExternal(url);
-}
-*/
-
 void LLPanelPeople::addTestParticipant()
 {
     std::string suffix("Aa");
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 6b5514deaf..be780bec5e 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -62,7 +62,6 @@ public:
 
 	static void idle(void * user_data);
 
-//	void openFacebookWeb(std::string url);
 	void addTestParticipant();
 	void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
 	
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index beca08203f..bb9ad8c606 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -52,6 +52,7 @@
 #include "lldaycyclemanager.h"
 #include "lldebugview.h"
 #include "llenvmanager.h"
+#include "llfacebookconnect.h"
 #include "llfilepicker.h"
 #include "llfirstuse.h"
 #include "llfloaterbuy.h"
@@ -5970,6 +5971,21 @@ void handle_report_abuse()
 	LLFloaterReporter::showFromMenu(COMPLAINT_REPORT);
 }
 
+void handle_facebook_connect()
+{
+	if (LLFacebookConnect::instance().getConnected())
+	{
+		LLFacebookConnect::instance().disconnectFromFacebook();
+	}
+	else
+	{
+        LLFacebookConnect::instance().getConnectionToFacebook();
+	}
+}
+
+//bool is_facebook_connected();
+
+
 void handle_buy_currency()
 {
 	LLBuyCurrencyHTML::openCurrencyFloater();
@@ -8719,4 +8735,7 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");
 	view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
 	view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
+    
+    // Facebook Connect
+	commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
 }
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 143420e227..b916d95b7a 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -135,6 +135,10 @@ bool enable_pay_object();
 bool enable_buy_object();
 bool handle_go_to();
 
+// Facebook Connect
+void handle_facebook_connect();
+//bool is_facebook_connected();
+
 // Export to XML or Collada
 void handle_export_selected( void * );
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 9ce360415c..b34816fb14 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -19,7 +19,7 @@
         label="Connect to Facebook..."
         name="ConnectToFacebook">
         <menu_item_call.on_click
-          function="People.loginFBC" />
+          function="Facebook.Connect" />
       </menu_item_call>
       <menu_item_separator/>
       <menu_item_call
-- 
cgit v1.2.3


From dd8295ab07fec9899e171a4f2ceb1298329ef7b5 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 14 May 2013 13:58:41 -0700
Subject: ACME-324 Populate list with FB only friends: Fixed a bug that was
 causing FB+SL friends to appear within the 'Invite people you know to Second
 Life' tab.

---
 indra/newview/llpanelpeople.cpp | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index ba7015faf5..0847878fb4 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -943,27 +943,31 @@ void LLPanelPeople::updateFacebookList()
         {
             std::string name = i->second["name"].asString();
             LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
-            
+            bool second_life_buddy = agent_id.notNull() ? avatar_tracker.isBuddy(agent_id) : false;
+
             //add to avatar list
             mFacebookFriends->addNewItem(agent_id, name, false);
             
-            //FB+SL but not SL friend
-            if (agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
-            {
-                tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
-            }
-            //FB only friend
-            else
-            {
-                tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-            }
-            
-            //Add to person tab model
-            LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
-            if (person_tab_model)
-            {
-                addParticipantToModel(person_tab_model, agent_id, name);
-            }
+			if(!second_life_buddy)
+			{
+				//FB+SL but not SL friend
+				if (agent_id.notNull())
+				{
+					tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+				}
+				//FB only friend
+				else
+				{
+					tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+				}
+
+				//Add to person tab model
+				LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
+				if (person_tab_model)
+				{
+					addParticipantToModel(person_tab_model, agent_id, name);
+				}
+			}
         }
     }
 }
-- 
cgit v1.2.3


From 7ba7f6d3c2db80e412e5658a5c6ce8755b75997b Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 17 May 2013 13:38:52 -0700
Subject: ACME-275 : Fixed! Use Name and Suffix for person name for filtering
 and search

---
 indra/newview/llpersonmodelcommon.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
index e48eddf05a..73239dcb8d 100644
--- a/indra/newview/llpersonmodelcommon.cpp
+++ b/indra/newview/llpersonmodelcommon.cpp
@@ -71,7 +71,7 @@ LLPersonModelCommon::~LLPersonModelCommon()
 BOOL LLPersonModelCommon::renameItem(const std::string& new_name)
 {
     mName = new_name;
-    mSearchableName = new_name;
+    mSearchableName = new_name + " " + mLabelSuffix;
     LLStringUtil::toUpper(mSearchableName);
     return TRUE;
 }
-- 
cgit v1.2.3


From 53ed2e4ac67088dce27f4c391d3e980e2d63154b Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 20 May 2013 19:32:55 -0700
Subject: ACME-381 : Implement experimental checkin feature (used to test
 publish_actions permissions workflow)

---
 indra/newview/llfacebookconnect.cpp                | 43 ++++++++++++++++++++++
 indra/newview/llfacebookconnect.h                  |  1 +
 indra/newview/llpanelpeople.cpp                    | 13 +++++++
 indra/newview/llpanelpeople.h                      |  1 +
 .../newview/skins/default/xui/en/menu_gear_fbc.xml |  7 ++++
 5 files changed, 65 insertions(+)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 39aa82dc7a..eb70cf4d10 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -94,6 +94,35 @@ public:
     
 };
 
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookPostResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookPostResponder);
+public:
+    
+	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL;
+		}
+		else
+		{
+			LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
+		}
+	}
+    
+    void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+    {
+        if (status == 302)
+        {
+            LLFacebookConnect::instance().openFacebookWeb(content["location"]);
+        }
+    }
+    
+};
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 class LLFacebookDisconnectResponder : public LLHTTPClient::Responder
@@ -247,6 +276,20 @@ void LLFacebookConnect::loadFacebookFriends()
 					  LLSD(), timeout, follow_redirects);
 }
 
+void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url)
+{
+    // Note: We need to improve the API support to provide all the relevant data if possible
+    // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html
+	LLSD body;
+	if (!message.empty())
+		body["message"] = message;
+	if (!url.empty())
+		body["link"] = url;
+    
+    // Note: we can use that route for different publish action. We should be able to use the same responder.
+	LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder());
+}
+
 void LLFacebookConnect::storeContent(const LLSD& content)
 {
     mGeneration++;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 8036c9ce3e..f151dd95c1 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -46,6 +46,7 @@ public:
     void getConnectionToFacebook();
     
     void loadFacebookFriends();
+    void postCheckinMessage(const std::string& message, const std::string& url);
 
     void clearContent();
 	void storeContent(const LLSD& content);
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 0847878fb4..e0b1c3abba 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -76,6 +76,9 @@
 #include "llspeakers.h"
 #include "llfloaterwebcontent.h"
 
+#include "llagentui.h"
+#include "llslurl.h"
+
 #define FRIEND_LIST_UPDATE_TIMEOUT	0.5
 #define NEARBY_LIST_UPDATE_INTERVAL 1
 #define FBCTEST_LIST_UPDATE_INTERVAL 0.25
@@ -568,6 +571,7 @@ LLPanelPeople::LLPanelPeople()
 	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
 	mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this));
 	mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this));
+	mCommitCallbackRegistrar.add("People.testFBCCheckin", boost::bind(&LLPanelPeople::onFacebookCheckinClicked, this));
 
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.AddFriendWizard",	boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked,	this));
@@ -1716,6 +1720,15 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 }
 
+void LLPanelPeople::onFacebookCheckinClicked()
+{
+    // Get the local SLURL 
+	LLSLURL slurl;
+	LLAgentUI::buildSLURL(slurl);
+
+    LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString());
+}
+
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 }
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index be780bec5e..f617517392 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -123,6 +123,7 @@ private:
 	void					onFacebookAppRequestClicked();
 	void					onFacebookAppSendClicked();
 	void					onFacebookTestAddClicked();
+    void                    onFacebookCheckinClicked();
 
 	bool					onFriendsViewSortMenuItemCheck(const LLSD& userdata);
 	bool					onRecentViewSortMenuItemCheck(const LLSD& userdata);
diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
index d73cee344b..2c341b6ecc 100644
--- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
+++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
@@ -41,4 +41,11 @@
     <menu_item_check.on_click
      function="People.testaddFBCFolderView"/>
   </menu_item_check>  
+  <menu_item_check
+   label="Facebook post checkin message"
+   layout="topleft"
+   name="Facebook Checkin">
+   <menu_item_check.on_click
+    function="People.testFBCCheckin"/>
+  </menu_item_check>
 </toggleable_menu>
\ No newline at end of file
-- 
cgit v1.2.3


From 4cf16ffdfbb166fbb3fcf1d7950ca1a240c94ca1 Mon Sep 17 00:00:00 2001
From: Cinders <cinder@cinderblocks.biz>
Date: Wed, 22 May 2013 21:43:32 -0600
Subject: STORM-1888: Hide Spellchecker Settings floater when Preferences
 floater is closed Bonus: Correct the immediately preceding auto replace
 comment

---
 doc/contributions.txt                 | 1 +
 indra/newview/llfloaterpreference.cpp | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 09c0d01b11..28de94f186 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -301,6 +301,7 @@ Ciaran Laval
 Cinder Roxley
     BUG-2326
     STORM-1703
+    STORM-1888
 Clara Young
 Coaldust Numbers
     VWR-1095
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index bbf88060c1..fde98aae9a 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -617,9 +617,12 @@ void LLFloaterPreference::cancel()
 	// hide translation settings floater
 	LLFloaterReg::hideInstance("prefs_translation");
 	
-	// hide translation settings floater
+	// hide autoreplace settings floater
 	LLFloaterReg::hideInstance("prefs_autoreplace");
 	
+	// hide spellchecker settings folder
+	LLFloaterReg::hideInstance("prefs_spellchecker");
+	
 	// cancel hardware menu
 	LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
 	if (hardware_settings)
-- 
cgit v1.2.3


From ff291257886badc495d04d59f78cfc9858964702 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 29 May 2013 01:31:48 +0100
Subject: updated postCheckinMessage to use new parameters and new route path

---
 indra/newview/llfacebookconnect.cpp | 20 +++++++++++++-------
 indra/newview/llfacebookconnect.h   |  2 +-
 indra/newview/llpanelpeople.cpp     |  2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index eb70cf4d10..86da748f0f 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -276,18 +276,24 @@ void LLFacebookConnect::loadFacebookFriends()
 					  LLSD(), timeout, follow_redirects);
 }
 
-void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url)
+void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture)
 {
-    // Note: We need to improve the API support to provide all the relevant data if possible
-    // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html
-	LLSD body;
+    LLSD body;
 	if (!message.empty())
 		body["message"] = message;
-	if (!url.empty())
-		body["link"] = url;
+	if (!link.empty())
+		body["link"] = link;
+	if (!name.empty())
+		body["name"] = name;
+	if (!caption.empty())
+		body["caption"] = caption;
+	if (!description.empty())
+		body["description"] = description;
+	if (!picture.empty())
+		body["picture"] = picture;
     
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder());
 }
 
 void LLFacebookConnect::storeContent(const LLSD& content)
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index f151dd95c1..8886630222 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -46,7 +46,7 @@ public:
     void getConnectionToFacebook();
     
     void loadFacebookFriends();
-    void postCheckinMessage(const std::string& message, const std::string& url);
+    void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture);
 
     void clearContent();
 	void storeContent(const LLSD& content);
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index e0b1c3abba..69b6bdf737 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1726,7 +1726,7 @@ void LLPanelPeople::onFacebookCheckinClicked()
 	LLSLURL slurl;
 	LLAgentUI::buildSLURL(slurl);
 
-    LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString());
+    LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString(), slurl.getRegion(), "", "", "");
 }
 
 void LLPanelPeople::onFacebookAppRequestClicked()
-- 
cgit v1.2.3


From e72a9ebf638db2197920115be57493a40d54d2b6 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 29 May 2013 17:04:42 -0700
Subject: ACME-433 Add a new tab to the bottom of the friends list

---
 indra/newview/skins/default/xui/en/panel_people.xml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 9bab2ccb0b..bc6b82e328 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -365,6 +365,23 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
                          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
+                 allow_select="true"
+                 follows="all"
+                 height="173"
+                 layout="topleft"
+                 left="0"
+                 multi_select="true"
+                 name="suggested_friends"
+                 show_permissions_granted="true"
+                 top="0"
+                 width="307" />
+              </accordion_tab>              
             </accordion>
             <text
              follows="all"
-- 
cgit v1.2.3


From 296377a64f1fee320e4f86a858116e2831c6e4aa Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 30 May 2013 17:03:54 -0700
Subject: ACME-434 When tab becomes visible, pull suggested friends data.

---
 indra/newview/llpanelpeople.cpp | 34 ++++++++++++++++++++++++++++++++++
 indra/newview/llpanelpeople.h   |  2 ++
 2 files changed, 36 insertions(+)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 69b6bdf737..785de6e9c9 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -652,8 +652,11 @@ 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(&Updater::setActive, mFacebookListUpdater, _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");
@@ -895,6 +898,35 @@ void LLPanelPeople::updateFriendList()
 	//update trash and other buttons according to a selected item
 	updateButtons();
 	showFriendsAccordionsIfNeeded();
+
+	updateSuggestedFriendList();
+}
+
+void 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::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
+	{
+		std::string name = i->second["name"].asString();
+		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
+		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);
+			}
+		}
+	}
+
+	mSuggestedFriends->setDirty(true, true);
 }
 
 void LLPanelPeople::updateNearbyList()
@@ -973,6 +1005,8 @@ void LLPanelPeople::updateFacebookList()
 				}
 			}
         }
+
+		updateSuggestedFriendList();
     }
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index f617517392..9cfa6b7cd2 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -85,6 +85,7 @@ private:
 	// methods indirectly called by the updaters
 	void					updateFriendListHelpText();
 	void					updateFriendList();
+	void					updateSuggestedFriendList();
 	void					updateNearbyList();
 	void					updateRecentList();
 	void					updateFacebookList();
@@ -148,6 +149,7 @@ private:
 	LLTabContainer*			mTabContainer;
 	LLAvatarList*			mOnlineFriendList;
 	LLAvatarList*			mAllFriendList;
+	LLAvatarList*			mSuggestedFriends;
 	LLAvatarList*			mNearbyList;
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
-- 
cgit v1.2.3


From 7e2a20308ec3a1d3306a5260461b4c1b5a5314a5 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 31 May 2013 14:55:38 -0700
Subject: ACME-435 Only show the 'People you may want to friend' tab when it is
 populated.

---
 indra/newview/llpanelpeople.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 785de6e9c9..22fbbf0c0e 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -830,7 +830,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();
+	bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches() || mSuggestedFriends->filterHasMatches();
 	no_friends_text->setVisible(!any_friend_exists);
 	if (no_friends_text->getVisible())
 	{
@@ -897,9 +897,8 @@ void LLPanelPeople::updateFriendList()
 	mAllFriendList->setDirty(true, !mAllFriendList->filterHasMatches());
 	//update trash and other buttons according to a selected item
 	updateButtons();
-	showFriendsAccordionsIfNeeded();
-
 	updateSuggestedFriendList();
+	showFriendsAccordionsIfNeeded();
 }
 
 void LLPanelPeople::updateSuggestedFriendList()
@@ -926,7 +925,9 @@ void LLPanelPeople::updateSuggestedFriendList()
 		}
 	}
 
-	mSuggestedFriends->setDirty(true, true);
+	//Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
+	mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
+	showFriendsAccordionsIfNeeded();
 }
 
 void LLPanelPeople::updateNearbyList()
@@ -1007,6 +1008,7 @@ void LLPanelPeople::updateFacebookList()
         }
 
 		updateSuggestedFriendList();
+		showFriendsAccordionsIfNeeded();
     }
 }
 
@@ -1230,9 +1232,11 @@ 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
@@ -1623,6 +1627,7 @@ 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");
-- 
cgit v1.2.3


From 9497a70eb2b3d47d1bfd83ff34bb60d8f490644d Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 31 May 2013 17:53:36 -0700
Subject: ACME-436 Update the list of Suggested Friends when new data arrives

---
 indra/newview/skins/default/xui/en/panel_people.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index bc6b82e328..c21d2abdd7 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -371,6 +371,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
                name="tab_suggested_friends"
                title="People you may want to friend">
                 <avatar_list
+                 ignore_online_status="true"
                  allow_select="true"
                  follows="all"
                  height="173"
-- 
cgit v1.2.3


From bbac06deb72e036b60a73bfb0e50d8f6a6a0fe86 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 1 Jun 2013 01:55:40 +0100
Subject: added LLFacebookConnect::sharePhoto() for ACME-467

---
 indra/newview/llfacebookconnect.cpp | 11 ++++++++++-
 indra/newview/llfacebookconnect.h   |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 86da748f0f..5013a5cb40 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -211,7 +211,6 @@ public:
     }
 };
 
-
 ///////////////////////////////////////////////////////////////////////////////
 //
 LLFacebookConnect::LLFacebookConnect()
@@ -296,6 +295,16 @@ void LLFacebookConnect::postCheckinMessage(const std::string& message, const std
 	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder());
 }
 
+void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption)
+{
+	LLSD body;
+	body["image"] = image_url;
+	body["caption"] = caption;
+	
+    // Note: we can use that route for different publish action. We should be able to use the same responder.
+	LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder());
+}
+
 void LLFacebookConnect::storeContent(const LLSD& content)
 {
     mGeneration++;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 8886630222..faa60b0f34 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -47,6 +47,7 @@ public:
     
     void loadFacebookFriends();
     void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture);
+	void sharePhoto(const std::string& image_url, const std::string& caption);
 
     void clearContent();
 	void storeContent(const LLSD& content);
-- 
cgit v1.2.3


From 0c0f4edb0026b1695655512ebed3a5508919a9b7 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 31 May 2013 18:13:01 -0700
Subject: ACME-484 Add a right click menu to the 'Suggested Friends' tab

---
 indra/newview/llpanelpeople.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 22fbbf0c0e..2a14978a95 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -689,6 +689,7 @@ BOOL LLPanelPeople::postBuild()
 	mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+	mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 
     //===Temporary ========================================================================
 
-- 
cgit v1.2.3


From e17b9de293084da0de0ce12290c9ae1939184337 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 31 May 2013 19:07:09 -0700
Subject: ACME-453, ACME-455, ACME-456, ACME-465 : Duplicate and tweak the
 Snapshot Profile UI to create the Snapshot Facebook UI

---
 indra/newview/CMakeLists.txt                       |   1 +
 indra/newview/llpanelsnapshotfacebook.cpp          | 101 +++++++++++
 indra/newview/llpanelsnapshotoptions.cpp           |   7 +
 indra/newview/skins/default/textures/textures.xml  |   1 +
 .../default/textures/toolbar_icons/facebook.png    | Bin 0 -> 1180 bytes
 .../skins/default/xui/en/floater_snapshot.xml      |  24 ++-
 .../default/xui/en/panel_snapshot_facebook.xml     | 199 +++++++++++++++++++++
 .../default/xui/en/panel_snapshot_options.xml      |  23 ++-
 8 files changed, 351 insertions(+), 5 deletions(-)
 create mode 100755 indra/newview/llpanelsnapshotfacebook.cpp
 create mode 100755 indra/newview/skins/default/textures/toolbar_icons/facebook.png
 create mode 100755 indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 477600ca01..f01c2f714d 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -434,6 +434,7 @@ set(viewer_SOURCE_FILES
     llpanelprimmediacontrols.cpp
     llpanelprofile.cpp
     llpanelsnapshot.cpp
+    llpanelsnapshotfacebook.cpp
     llpanelsnapshotinventory.cpp
     llpanelsnapshotlocal.cpp
     llpanelsnapshotoptions.cpp
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
new file mode 100755
index 0000000000..50c5b62fe7
--- /dev/null
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -0,0 +1,101 @@
+/** 
+ * @file llpanelsnapshotfacebook.cpp
+ * @brief Posts a snapshot to the resident Facebook account.
+ *
+ * $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"
+
+// libs
+#include "llcombobox.h"
+#include "llfloaterreg.h"
+#include "llpanel.h"
+#include "llspinctrl.h"
+
+// newview
+#include "llfloatersnapshot.h"
+#include "llpanelsnapshot.h"
+#include "llsidetraypanelcontainer.h"
+#include "llwebprofile.h"
+
+/**
+ * Posts a snapshot to the resident Facebook account.
+ */
+class LLPanelSnapshotFacebook
+:	public LLPanelSnapshot
+{
+	LOG_CLASS(LLPanelSnapshotFacebook);
+
+public:
+	LLPanelSnapshotFacebook();
+
+	/*virtual*/ BOOL postBuild();
+	/*virtual*/ void onOpen(const LLSD& key);
+
+private:
+	/*virtual*/ std::string getWidthSpinnerName() const		{ return "facebook_snapshot_width"; }
+	/*virtual*/ std::string getHeightSpinnerName() const	{ return "facebook_snapshot_height"; }
+	/*virtual*/ std::string getAspectRatioCBName() const	{ return "facebook_keep_aspect_check"; }
+	/*virtual*/ std::string getImageSizeComboName() const	{ return "facebook_size_combo"; }
+	/*virtual*/ std::string getImageSizePanelName() const	{ return "facebook_image_size_lp"; }
+	/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; }
+	/*virtual*/ void updateControls(const LLSD& info);
+
+	void onSend();
+};
+
+static LLRegisterPanelClassWrapper<LLPanelSnapshotFacebook> panel_class("llpanelsnapshotfacebook");
+
+LLPanelSnapshotFacebook::LLPanelSnapshotFacebook()
+{
+	mCommitCallbackRegistrar.add("PostToFacebook.Send",		boost::bind(&LLPanelSnapshotFacebook::onSend,		this));
+	mCommitCallbackRegistrar.add("PostToFacebook.Cancel",	boost::bind(&LLPanelSnapshotFacebook::cancel,		this));
+}
+
+// virtual
+BOOL LLPanelSnapshotFacebook::postBuild()
+{
+	return LLPanelSnapshot::postBuild();
+}
+
+// virtual
+void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
+{
+	LLPanelSnapshot::onOpen(key);
+}
+
+// virtual
+void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
+{
+	const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
+	getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot);
+}
+
+void LLPanelSnapshotFacebook::onSend()
+{
+	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
+	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
+
+	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location);
+	LLFloaterSnapshot::postSave();
+}
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 554fabe5b3..14953f3cf9 100755
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -51,6 +51,7 @@ private:
 	void updateUploadCost();
 	void openPanel(const std::string& panel_name);
 	void onSaveToProfile();
+	void onSaveToFacebook();
 	void onSaveToEmail();
 	void onSaveToInventory();
 	void onSaveToComputer();
@@ -60,6 +61,7 @@ static LLRegisterPanelClassWrapper<LLPanelSnapshotOptions> panel_class("llpanels
 
 LLPanelSnapshotOptions::LLPanelSnapshotOptions()
 {
+	mCommitCallbackRegistrar.add("Snapshot.SaveToFacebook",		boost::bind(&LLPanelSnapshotOptions::onSaveToFacebook,	this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToProfile",		boost::bind(&LLPanelSnapshotOptions::onSaveToProfile,	this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToEmail",		boost::bind(&LLPanelSnapshotOptions::onSaveToEmail,		this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToInventory",	boost::bind(&LLPanelSnapshotOptions::onSaveToInventory,	this));
@@ -99,6 +101,11 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
 	LLFloaterSnapshot::postPanelSwitch();
 }
 
+void LLPanelSnapshotOptions::onSaveToFacebook()
+{
+	openPanel("panel_snapshot_facebook");
+}
+
 void LLPanelSnapshotOptions::onSaveToProfile()
 {
 	openPanel("panel_snapshot_profile");
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 18146943a5..a0b46bab0b 100755
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -567,6 +567,7 @@ 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/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png
new file mode 100755
index 0000000000..32fe2bf8ac
Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/facebook.png differ
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 49d64767cc..e8e7fb77c1 100755
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -21,7 +21,11 @@
         Sending Email
     </string>
     <string
-     name="profile_progress_str">
+        name="facebook_progress_str">
+        Posting to Facebook
+    </string>
+    <string
+        name="profile_progress_str">
         Posting
     </string>
     <string
@@ -33,7 +37,11 @@
         Saving to Computer
     </string>
  	<string
- 	 name="profile_succeeded_str">
+        name="facebook_succeeded_str">
+ 	    Image uploaded
+ 	</string>
+ 	<string
+        name="profile_succeeded_str">
  	    Image uploaded
  	</string>
  	<string
@@ -49,7 +57,11 @@
  	    Saved to Computer!
  	</string>
  	<string
- 	 name="profile_failed_str">
+        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>
  	<string
@@ -256,6 +268,12 @@
        left="0"
        name="panel_snapshot_options"
        top="0" />
+      <panel
+       class="llpanelsnapshotfacebook"
+       follows="all"
+       layout="topleft"
+       name="panel_snapshot_facebook"
+       filename="panel_snapshot_facebook.xml" />
       <panel
        class="llpanelsnapshotprofile"
        follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
new file mode 100755
index 0000000000..2810f97ca6
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ height="380"
+ layout="topleft"
+ name="panel_snapshot_facebook"
+ width="490">
+    <icon
+     follows="top|left"
+     height="18"
+     image_name="Snapshot_Facebook"
+     layout="topleft"
+     left="12"
+     mouse_opaque="true"
+     name="title_icon"
+     top="5"
+     width="18" />
+    <text
+     follows="top|left|right"
+     font="SansSerifBold"
+     height="20"
+     layout="topleft"
+     left_pad="12"
+     length="1"
+     name="title"
+     right="-10"
+     text_color="white"
+     type="string"
+     top_delta="4">
+        Post to my Facebook timeline
+    </text>
+    <view_border 
+     bevel_style="in"
+     follows="left|top|right" 
+     height="1"
+     left="10"
+     layout="topleft"
+     name="hr"
+     right="-10"
+     top_pad="5"
+     />
+    <combo_box
+     follows="left|top"
+     height="23"
+     label="Resolution"
+     layout="topleft"
+     left_delta="0"
+     name="facebook_size_combo"
+     top_pad="10"
+     width="250">
+        <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="Custom"
+         name="Custom"
+         value="[i-1,i-1]" />
+    </combo_box>
+    <layout_stack
+     animate="false"
+     follows="all"
+     height="270"
+     layout="bottomleft"
+     name="facebook_image_params_ls"
+     left_delta="0"
+     orientation="vertical"
+     top_pad="10"
+     right="-10">
+        <layout_panel
+         follows="top|left|right"
+         height="55"
+         layout="topleft"
+         left="0"
+         name="facebook_image_size_lp"
+         auto_resize="false"
+         top="0"
+         right="-1"
+         visible="true">
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Width"
+             label_width="40"
+             layout="topleft"
+             left="10"
+             max_val="6016"
+             min_val="32"
+             name="facebook_snapshot_width"
+             top_pad="10"
+             width="95" />
+            <spinner
+             allow_text_entry="false"
+             decimal_digits="0"
+             follows="left|top"
+             height="20"
+             increment="32"
+             label="Height"
+             label_width="40"
+             layout="topleft"
+             left_pad="5"
+             max_val="6016"
+             min_val="32"
+             name="facebook_snapshot_height"
+             top_delta="0"
+             width="95" />
+            <check_box
+              height="10"
+             bottom_delta="20"
+             label="Constrain proportions"
+             layout="topleft"
+             left="10"
+             name="facebook_keep_aspect_check" />
+        </layout_panel>
+        <layout_panel
+         follows="top|left|right"
+         height="200"
+         layout="topleft"
+         left="0"
+         name="facebook_image_metadata_lp"
+         auto_resize="true"
+         top="0"
+         right="-1"
+         visible="true">
+            <text
+             length="1"
+             follows="top|left|right"
+             font="SansSerif"
+             height="16"
+             layout="topleft"
+             left="0"
+             name="caption_label"
+             right="-10"
+             top_pad="0"
+             type="string">
+                Caption:
+            </text>
+            <text_editor
+             follows="all"
+             height="155"
+             layout="topleft"
+             left_delta="0"
+             length="1"
+             max_length="700"
+             name="caption"
+             right="-10"
+             top_pad="5"
+             type="string"
+             word_wrap="true">
+            </text_editor>
+            <check_box
+             follows="left|bottom"
+             initial_value="true"
+             label="Include location"
+             layout="topleft"
+             left_delta="0"
+             name="add_location_cb"
+             top_pad="15" />
+        </layout_panel>
+    </layout_stack>
+    <button
+     follows="right|bottom"
+     height="23"
+     label="Cancel"
+     layout="topleft"
+     name="cancel_btn"
+     right="-32"
+     top="350"
+     width="100">
+      <button.commit_callback
+       function="PostToFacebook.Cancel" />
+    </button>
+    <button
+     follows="right|bottom"
+     height="23"
+     label="Post"
+     layout="topleft"
+     left_delta="-106"
+     name="post_btn"
+     top_delta="0"
+     width="100">
+      <button.commit_callback
+       function="PostToFacebook.Send" />
+    </button>
+</panel>
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 d2f29ade44..8cf5bfb426 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -5,6 +5,25 @@
  layout="topleft"
  name="panel_snapshot_options"
  width="490">
+ <button
+  follows="left|top|right"
+  font="SansSerif"
+  halign="left"
+  height="38"
+  image_overlay="Snapshot_Facebook"
+  image_overlay_alignment="left"
+  image_top_pad="-2"
+  imgoverlay_label_space="10"
+  label="Post to my Facebook timeline"
+  layout="topleft"
+  left="10"
+  name="save_to_facebook_btn"
+  pad_left="10"
+  right="-10"
+  top="5">
+  <button.commit_callback
+   function="Snapshot.SaveToFacebook" />
+  </button>
   <button
    follows="left|top|right"
    font="SansSerif"
@@ -16,11 +35,11 @@
    imgoverlay_label_space="10"
    label="Post to My Profile Feed"
    layout="topleft"
-   left="10"
+   left_delta="0"
    name="save_to_profile_btn"
    pad_left="10"
    right="-10"
-   top="5">
+   top_pad="10">
     <button.commit_callback
      function="Snapshot.SaveToProfile" />
   </button>
-- 
cgit v1.2.3


From 6bf2dad1cc8df2769a0833786bc16eea96649d6d Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 4 Jun 2013 14:05:13 -0700
Subject: ACME-484: Right-click menu only has 'Add Friend' and 'View Profile'
 options. Also multi-select is disabled.

---
 indra/newview/llpanelpeople.cpp                    |  2 +-
 indra/newview/llpanelpeoplemenus.cpp               | 33 ++++++++++++++++++++++
 indra/newview/llpanelpeoplemenus.h                 | 13 +++++++++
 .../newview/skins/default/xui/en/panel_people.xml  |  1 -
 4 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2a14978a95..5bc645bcfd 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -689,7 +689,7 @@ BOOL LLPanelPeople::postBuild()
 	mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
-	mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+	mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
 
     //===Temporary ========================================================================
 
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 49f7361c4a..313056f06a 100755
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -47,6 +47,7 @@ namespace LLPanelPeopleMenus
 
 PeopleContextMenu gPeopleContextMenu;
 NearbyPeopleContextMenu gNearbyPeopleContextMenu;
+SuggestedFriendsContextMenu gSuggestedFriendsContextMenu;
 
 //== PeopleContextMenu ===============================================================
 
@@ -301,4 +302,36 @@ 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 0a1dcef303..5367eca0d3 100755
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -58,8 +58,21 @@ 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/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index c21d2abdd7..451095c7d8 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -377,7 +377,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
                  height="173"
                  layout="topleft"
                  left="0"
-                 multi_select="true"
                  name="suggested_friends"
                  show_permissions_granted="true"
                  top="0"
-- 
cgit v1.2.3


From f3a72799b01ad2449ae24e86169b994c696c1b4a Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 5 Jun 2013 01:03:33 +0100
Subject: added call to sharePhoto() with placeholder image for ACME-467

---
 indra/newview/llpanelsnapshotfacebook.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 50c5b62fe7..200c64f16b 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -38,6 +38,8 @@
 #include "llsidetraypanelcontainer.h"
 #include "llwebprofile.h"
 
+#include "llfacebookconnect.h"
+
 /**
  * Posts a snapshot to the resident Facebook account.
  */
@@ -98,4 +100,7 @@ void LLPanelSnapshotFacebook::onSend()
 
 	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location);
 	LLFloaterSnapshot::postSave();
+
+	// test with a placeholder image, until we can figure out a way to grab the uploaded image url
+	LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
 }
-- 
cgit v1.2.3


From abcb3e85628712da4d61fda6e68bb86a29e1f965 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 4 Jun 2013 18:39:41 -0700
Subject: ACME-471: Once connected to facebook, a user can use the 'Check in to
 Facebook' button under the 'Me' menu to make a check in post to Facebook

---
 indra/newview/llfacebookconnect.cpp                | 18 +++++++++++++++++
 indra/newview/llfacebookconnect.h                  |  1 +
 indra/newview/llviewermenu.cpp                     | 23 ++++++++++++++++++++++
 indra/newview/llviewermenu.h                       |  4 +++-
 indra/newview/skins/default/xui/en/menu_viewer.xml |  6 ++++++
 5 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 5013a5cb40..668ba04406 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -275,6 +275,24 @@ void LLFacebookConnect::loadFacebookFriends()
 					  LLSD(), timeout, follow_redirects);
 }
 
+void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message)
+{
+	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;
+
+	// Note: we can use that route for different publish action. We should be able to use the same responder.
+	LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookPostResponder());
+}
+
 void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture)
 {
     LLSD body;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index faa60b0f34..2dba182267 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -46,6 +46,7 @@ public:
     void getConnectionToFacebook();
     
     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 postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture);
 	void sharePhoto(const std::string& image_url, const std::string& caption);
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index bb9ad8c606..eb100a3f9b 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -45,6 +45,7 @@
 #include "llagent.h"
 #include "llagentaccess.h"
 #include "llagentcamera.h"
+#include "llagentui.h"
 #include "llagentwearables.h"
 #include "llagentpilot.h"
 #include "llcompilequeue.h"
@@ -5983,6 +5984,26 @@ void handle_facebook_connect()
 	}
 }
 
+void handle_facebook_checkin()
+{
+
+	// Get the location SLURL 
+	LLSLURL slurl;
+	LLAgentUI::buildSLURL(slurl);
+	std::string slurl_string = slurl.getSLURLString();
+
+	//Get the location name
+	LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance();
+	std::string parcel_string = parcel->getAgentParcelName();
+
+	//Get the location description
+	LLVector3 agent_pos = gAgent.getPositionAgent();
+	std::string description;
+	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos);
+
+	LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", "");
+}
+
 //bool is_facebook_connected();
 
 
@@ -8738,4 +8759,6 @@ void initialize_menus()
     
     // Facebook Connect
 	commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
+	// Facebook Checkin
+	commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
 }
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index b916d95b7a..9c3f13f843 100755
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -137,7 +137,9 @@ bool handle_go_to();
 
 // Facebook Connect
 void handle_facebook_connect();
-//bool is_facebook_connected();
+
+//Facebook Checkin
+void handle_facebook_checkin();
 
 // Export to XML or Collada
 void handle_export_selected( void * );
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index b34816fb14..5061842c7f 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -21,6 +21,12 @@
         <menu_item_call.on_click
           function="Facebook.Connect" />
       </menu_item_call>
+      <menu_item_call
+        label="Check in to Facebook"
+        name="CheckinToFacebook">
+        <menu_item_call.on_click
+          function="Facebook.Checkin" />
+      </menu_item_call>      
       <menu_item_separator/>
       <menu_item_call
        label="Appearance..."
-- 
cgit v1.2.3


From 1734cabbcc15411afa4bd52e370290d6fbc487ba Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 5 Jun 2013 00:32:15 -0700
Subject: ACME-471: In last commit was not using the correct name and location.
 Now using the proper name and location.

---
 indra/newview/llviewermenu.cpp | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index eb100a3f9b..bd5a37876f 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5992,16 +5992,40 @@ void handle_facebook_checkin()
 	LLAgentUI::buildSLURL(slurl);
 	std::string slurl_string = slurl.getSLURLString();
 
-	//Get the location name
+	std::string region_name = gAgent.getRegion()->getName();
+
+	//Get the parcel name
 	LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance();
-	std::string parcel_string = parcel->getAgentParcelName();
+	std::string parcel_title = parcel->getAgentParcelName();
+
+	//Create the location
+	LLVector3 agent_pos_region = gAgent.getPositionAgent();
+	S32 pos_x = S32(agent_pos_region.mV[VX]);
+	S32 pos_y = S32(agent_pos_region.mV[VY]);
+	S32 pos_z = S32(agent_pos_region.mV[VZ]);
+
+	// Round the numbers based on the velocity
+	F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared();
+
+	const F32 FLY_CUTOFF = 6.f;		// meters/sec
+	const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF;
+	const F32 WALK_CUTOFF = 1.5f;	// meters/sec
+	const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF;
+
+	if (velocity_mag_sq > FLY_CUTOFF_SQ)
+	{
+		pos_x -= pos_x % 4;
+		pos_y -= pos_y % 4;
+	}
+	else if (velocity_mag_sq > WALK_CUTOFF_SQ)
+	{
+		pos_x -= pos_x % 2;
+		pos_y -= pos_y % 2;
+	}
 
-	//Get the location description
-	LLVector3 agent_pos = gAgent.getPositionAgent();
-	std::string description;
-	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos);
+	std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z);
 
-	LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", "");
+	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", "");
 }
 
 //bool is_facebook_connected();
-- 
cgit v1.2.3


From ec52db8d0c4099dd5e3b476f7b44a4ebda7cb676 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Wed, 5 Jun 2013 17:32:10 -0400
Subject: STORM-1838 Slowly reappling changes to work with CHUI

---
 indra/newview/llavataractions.cpp                         |  1 +
 indra/newview/llconversationloglist.cpp                   |  1 +
 indra/newview/llconversationmodel.cpp                     |  1 +
 indra/newview/llfloaterimcontainer.cpp                    |  4 ++++
 indra/newview/llpanelpeoplemenus.cpp                      | 13 ++++++++++++-
 indra/newview/llpanelpeoplemenus.h                        |  1 +
 indra/newview/skins/default/xui/en/menu_conversation.xml  |  9 +++++++++
 indra/newview/skins/default/xui/en/menu_people_nearby.xml |  9 +++++++++
 8 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 45992b8c83..285e70c8ea 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -443,6 +443,7 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
 // static
 void LLAvatarActions::teleportRequest(const LLUUID& id)
 {
+llwarns << "DBG " << llendl;
 	std::string name;
 	gCacheName->getFullName(id, name);
 	gCacheName->cleanFullName(name);
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index 5ab108b39f..cf9c9b3415 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -311,6 +311,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata)
 	}
 	else if ("offer_teleport" == command_name)
 	{
+llwarns << "DBG " << llendl;
 		LLAvatarActions::offerTeleport(selected_conversation_participant_id);
 	}
 	else if("add_friend" == command_name)
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index c74ce24872..b0aaa21ec9 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -132,6 +132,7 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32
 		items.push_back(std::string("view_profile"));
 		items.push_back(std::string("im"));
 		items.push_back(std::string("offer_teleport"));
+		items.push_back(std::string("request_teleport"));
 		items.push_back(std::string("voice_call"));
 		items.push_back(std::string("chat_history"));
 		items.push_back(std::string("separator_chat_history"));
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 5e0cd8ef78..65155041f0 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1007,6 +1007,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
 		{
 			LLAvatarActions::offerTeleport(selectedIDS);
 		}
+		else if ("request_teleport" == command)
+		{
+			LLAvatarActions::teleportRequest(selectedIDS.front());
+		}
 		else if ("voice_call" == command)
 		{
 			LLAvatarActions::startCall(userID);
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index a68772a35d..ddc92f439b 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -74,7 +74,7 @@ LLContextMenu* PeopleContextMenu::createMenu()
 		registrar.add("Avatar.Pay",				boost::bind(&LLAvatarActions::pay,						id));
 		registrar.add("Avatar.BlockUnblock",	boost::bind(&LLAvatarActions::toggleBlock,				id));
 		registrar.add("Avatar.InviteToGroup",	boost::bind(&LLAvatarActions::inviteToGroup,			id));
-		registrar.add("Avatar.TeleportRequest",	boost::bind(&LLAvatarActions::teleportRequest,			id));
+		registrar.add("Avatar.TeleportRequest",	boost::bind(&PeopleContextMenu::requestTeleport,		this));
 		registrar.add("Avatar.Calllog",			boost::bind(&LLAvatarActions::viewChatHistory,			id));
 
 		enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2));
@@ -126,6 +126,7 @@ void PeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
 		items.push_back(std::string("view_profile"));
 		items.push_back(std::string("im"));
 		items.push_back(std::string("offer_teleport"));
+		items.push_back(std::string("request_teleport"));
 		items.push_back(std::string("voice_call"));
 		items.push_back(std::string("chat_history"));
 		items.push_back(std::string("separator_chat_history"));
@@ -256,10 +257,19 @@ bool PeopleContextMenu::checkContextMenuItem(const LLSD& userdata)
 	return false;
 }
 
+void PeopleContextMenu::requestTeleport()
+{
+	// boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(),
+	// so we have to use a wrapper.
+llwarns << "DBG " << llendl;
+	LLAvatarActions::teleportRequest(mUUIDs.front());
+}
+
 void PeopleContextMenu::offerTeleport()
 {
 	// boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(),
 	// so we have to use a wrapper.
+llwarns << "DBG " << llendl;
 	LLAvatarActions::offerTeleport(mUUIDs);
 }
 
@@ -285,6 +295,7 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
 		items.push_back(std::string("view_profile"));
 		items.push_back(std::string("im"));
 		items.push_back(std::string("offer_teleport"));
+		items.push_back(std::string("request_teleport"));
 		items.push_back(std::string("voice_call"));
 		items.push_back(std::string("chat_history"));
 		items.push_back(std::string("separator_chat_history"));
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index 0a1dcef303..abf5fa05e4 100644
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -47,6 +47,7 @@ private:
 	bool enableContextMenuItem(const LLSD& userdata);
 	bool checkContextMenuItem(const LLSD& userdata);
 	void offerTeleport();
+	void requestTeleport();
 };
 
 /**
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index 5a13ef0a59..c2c15023c5 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -46,6 +46,15 @@
         <on_click function="Avatar.DoToSelected" parameter="offer_teleport"/>
         <on_enable function="Avatar.EnableItem" parameter="can_offer_teleport"/>
     </menu_item_call>
+
+    <menu_item_call
+     label="Request teleport"
+     layout="topleft"
+     name="request_teleport">
+        <on_click function="Avatar.DoToSelected" parameter="request_teleport"/>
+        <on_enable function="Avatar.EnableItem" parameter="can_offer_teleport"/>
+    </menu_item_call>
+
     <menu_item_call
      label="Voice call"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index 25b100bc94..80e8e59076 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -28,6 +28,15 @@
       function="Avatar.EnableItem"
       parameter="can_offer_teleport"/>
     </menu_item_call>
+    <menu_item_call
+    label="Request Teleport"
+    name="request_teleport">
+      <menu_item_call.on_click
+       function="Avatar.TeleportRequest"/>
+      <menu_item_call.on_enable
+      function="Avatar.EnableItem"
+      parameter="can_offer_teleport"/>
+    </menu_item_call>
     <menu_item_call
      label="Voice call"
      layout="topleft"
-- 
cgit v1.2.3


From 3d40f4d82f067421e63ac3719ce22c18e29b0e20 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 5 Jun 2013 14:45:11 -0700
Subject: ACME-471: Code cleanup, instead of duplicating code from
 LLAgentUI::buildLocationString, now calling LLAgentUI::buildLocationString
 with a flag to perform a similar operation.

---
 indra/newview/llagentui.cpp    | 10 ++++++++++
 indra/newview/llagentui.h      |  1 +
 indra/newview/llviewermenu.cpp | 33 ++-------------------------------
 3 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp
index b9ec304b7e..125f911e0d 100755
--- a/indra/newview/llagentui.cpp
+++ b/indra/newview/llagentui.cpp
@@ -130,6 +130,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const
 				sim_access_string.empty() ? "" : " - ",
 				sim_access_string.c_str());
 			break;
+		case LOCATION_FORMAT_NORMAL_COORDS:
+			buffer = llformat("%s (%d, %d, %d)",
+				region_name.c_str(),
+				pos_x, pos_y, pos_z);
+			break;
 		}
 	}
 	else
@@ -164,6 +169,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const
 				sim_access_string.empty() ? "" : " - ",
 				sim_access_string.c_str());
 			break;
+		case LOCATION_FORMAT_NORMAL_COORDS:
+			buffer = llformat("%s (%d, %d, %d)",
+				parcel_name.c_str(),
+				pos_x, pos_y, pos_z);
+			break;
 		}
 	}
 	str = buffer;
diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h
index dda5dc1fd1..bb48dad14c 100755
--- a/indra/newview/llagentui.h
+++ b/indra/newview/llagentui.h
@@ -35,6 +35,7 @@ public:
 	enum ELocationFormat
 	{
 		LOCATION_FORMAT_NORMAL,			// Parcel
+		LOCATION_FORMAT_NORMAL_COORDS,	// Parcel (x, y, z)
 		LOCATION_FORMAT_LANDMARK,		// Parcel, Region
 		LOCATION_FORMAT_NO_MATURITY,	// Parcel, Region (x, y, z)
 		LOCATION_FORMAT_NO_COORDS,		// Parcel, Region - Maturity
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index bd5a37876f..471db8d8fc 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5993,37 +5993,8 @@ void handle_facebook_checkin()
 	std::string slurl_string = slurl.getSLURLString();
 
 	std::string region_name = gAgent.getRegion()->getName();
-
-	//Get the parcel name
-	LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance();
-	std::string parcel_title = parcel->getAgentParcelName();
-
-	//Create the location
-	LLVector3 agent_pos_region = gAgent.getPositionAgent();
-	S32 pos_x = S32(agent_pos_region.mV[VX]);
-	S32 pos_y = S32(agent_pos_region.mV[VY]);
-	S32 pos_z = S32(agent_pos_region.mV[VZ]);
-
-	// Round the numbers based on the velocity
-	F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared();
-
-	const F32 FLY_CUTOFF = 6.f;		// meters/sec
-	const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF;
-	const F32 WALK_CUTOFF = 1.5f;	// meters/sec
-	const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF;
-
-	if (velocity_mag_sq > FLY_CUTOFF_SQ)
-	{
-		pos_x -= pos_x % 4;
-		pos_y -= pos_y % 4;
-	}
-	else if (velocity_mag_sq > WALK_CUTOFF_SQ)
-	{
-		pos_x -= pos_x % 2;
-		pos_y -= pos_y % 2;
-	}
-
-	std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z);
+	std::string description;
+	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
 
 	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", "");
 }
-- 
cgit v1.2.3


From 64f4246f17b8270870fae84eca26e18a567a2174 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 5 Jun 2013 14:54:10 -0700
Subject: ACME-471: Code cleanup, just moving some code.

---
 indra/newview/llagentui.cpp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp
index 125f911e0d..3410a37890 100755
--- a/indra/newview/llagentui.cpp
+++ b/indra/newview/llagentui.cpp
@@ -112,6 +112,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const
 		case LOCATION_FORMAT_NORMAL:
 			buffer = llformat("%s", region_name.c_str());
 			break;
+		case LOCATION_FORMAT_NORMAL_COORDS:
+			buffer = llformat("%s (%d, %d, %d)",
+				region_name.c_str(),
+				pos_x, pos_y, pos_z);
+			break;
 		case LOCATION_FORMAT_NO_COORDS:
 			buffer = llformat("%s%s%s",
 				region_name.c_str(),
@@ -130,11 +135,6 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const
 				sim_access_string.empty() ? "" : " - ",
 				sim_access_string.c_str());
 			break;
-		case LOCATION_FORMAT_NORMAL_COORDS:
-			buffer = llformat("%s (%d, %d, %d)",
-				region_name.c_str(),
-				pos_x, pos_y, pos_z);
-			break;
 		}
 	}
 	else
@@ -148,6 +148,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const
 		case LOCATION_FORMAT_NORMAL:
 			buffer = llformat("%s, %s", parcel_name.c_str(), region_name.c_str());
 			break;
+		case LOCATION_FORMAT_NORMAL_COORDS:
+			buffer = llformat("%s (%d, %d, %d)",
+				parcel_name.c_str(),
+				pos_x, pos_y, pos_z);
+			break;
 		case LOCATION_FORMAT_NO_MATURITY:
 			buffer = llformat("%s, %s (%d, %d, %d)",
 				parcel_name.c_str(),
@@ -169,11 +174,6 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const
 				sim_access_string.empty() ? "" : " - ",
 				sim_access_string.c_str());
 			break;
-		case LOCATION_FORMAT_NORMAL_COORDS:
-			buffer = llformat("%s (%d, %d, %d)",
-				parcel_name.c_str(),
-				pos_x, pos_y, pos_z);
-			break;
 		}
 	}
 	str = buffer;
-- 
cgit v1.2.3


From faf99f2e1c88f281836c555d9fa6886d45f13751 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 5 Jun 2013 15:43:31 -0700
Subject: ACME-485 : Temporary facebook.png icon for the snapshot panel

---
 .../skins/default/textures/toolbar_icons/facebook.png | Bin 1180 -> 2974 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 indra/newview/skins/default/textures/toolbar_icons/facebook.png

diff --git a/indra/newview/skins/default/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png
old mode 100755
new mode 100644
index 32fe2bf8ac..b960b834dc
Binary files a/indra/newview/skins/default/textures/toolbar_icons/facebook.png and b/indra/newview/skins/default/textures/toolbar_icons/facebook.png differ
-- 
cgit v1.2.3


From 4d162e1ec2cd716f40666056bb9e2710958e3360 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 5 Jun 2013 23:52:34 +0100
Subject: added callback to post photo with actual image url

---
 indra/newview/llpanelsnapshotfacebook.cpp | 13 +++++++--
 indra/newview/llwebprofile.cpp            | 48 ++++++++++++++++++++++++-------
 indra/newview/llwebprofile.h              |  5 ++--
 3 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 200c64f16b..954941274a 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -64,6 +64,7 @@ private:
 	/*virtual*/ void updateControls(const LLSD& info);
 
 	void onSend();
+	void onImageUploaded(const std::string& image_url, const std::string& caption);
 };
 
 static LLRegisterPanelClassWrapper<LLPanelSnapshotFacebook> panel_class("llpanelsnapshotfacebook");
@@ -98,9 +99,17 @@ void LLPanelSnapshotFacebook::onSend()
 	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
 	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
 
-	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location);
+	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2));
 	LLFloaterSnapshot::postSave();
 
 	// test with a placeholder image, until we can figure out a way to grab the uploaded image url
-	LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
+	//LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
+}
+
+void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption)
+{
+	if (!image_url.empty())
+	{
+		LLFacebookConnect::instance().sharePhoto(image_url, caption);
+	}
 }
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 641f338f2c..4bc4724753 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLWebProfileResponders::ConfigResponder);
 
 public:
-	ConfigResponder(LLPointer<LLImageFormatted> imagep)
-	:	mImagep(imagep)
+	ConfigResponder(LLPointer<LLImageFormatted> imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb)
+	:	mImagep(imagep), mImageCaption(caption), mImageCallback(cb)
 	{
 	}
 
@@ -113,11 +113,13 @@ public:
 
 		// Do the actual image upload using the configuration.
 		LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
-		LLWebProfile::post(mImagep, config, upload_url);
+		LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback);
 	}
 
 private:
 	LLPointer<LLImageFormatted> mImagep;
+	std::string mImageCaption;
+	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -127,6 +129,22 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
 	LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder);
 
 public:
+	PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb)
+	:	mImageCaption(caption), mImageCallback(cb)
+	{
+	}
+
+	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (status == 200)
+		{
+			std::string image_url = content.get("Location");
+			llinfos << "Image uploaded to " << image_url << llendl;
+			if (!mImageCallback.empty() && !image_url.empty())
+				mImageCallback(image_url, mImageCaption);
+		}
+	}
+
 	/*virtual*/ void completedRaw(
 		U32 status,
 		const std::string& reason,
@@ -148,9 +166,10 @@ public:
 		LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl;
 		LLWebProfile::reportImageUploadStatus(true);
 	}
-
+	
 private:
-	LLPointer<LLImageFormatted> mImagep;
+	std::string mImageCaption;
+	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
 
@@ -161,6 +180,11 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
 	LOG_CLASS(LLWebProfileResponders::PostImageResponder);
 
 public:
+	PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb)
+	:	mImageCaption(caption), mImageCallback(cb)
+	{
+	}
+
 	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
 	{
 		// Viewer seems to fail to follow a 303 redirect on POST request
@@ -172,7 +196,7 @@ public:
 			headers["Cookie"] = LLWebProfile::getAuthCookie();
 			const std::string& redir_url = content["location"];
 			LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl;
-			LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers);
+			LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers);
 		}
 		else
 		{
@@ -188,6 +212,10 @@ public:
 							  const LLIOPipe::buffer_ptr_t& buffer)
 	{
 	}
+	
+private:
+	std::string mImageCaption;
+	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -197,7 +225,7 @@ std::string LLWebProfile::sAuthCookie;
 LLWebProfile::status_callback_t LLWebProfile::mStatusCallback;
 
 // static
-void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location)
+void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, LLWebProfile::image_url_callback_t cb)
 {
 	// Get upload configuration data.
 	std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config");
@@ -207,7 +235,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
 	LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
 	LLSD headers = LLViewerMedia::getHeaders();
 	headers["Cookie"] = getAuthCookie();
-	LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers);
+	LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers);
 }
 
 // static
@@ -218,7 +246,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie)
 }
 
 // static
-void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url)
+void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb)
 {
 	if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
 	{
@@ -284,7 +312,7 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
 	memcpy(data, body.str().data(), size);
 
 	// Send request, successful upload will trigger posting metadata.
-	LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(), headers);
+	LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers);
 }
 
 // static
diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h
index 10279bffac..c1c0c23540 100755
--- a/indra/newview/llwebprofile.h
+++ b/indra/newview/llwebprofile.h
@@ -48,8 +48,9 @@ class LLWebProfile
 
 public:
 	typedef boost::function<void(bool ok)> status_callback_t;
+	typedef boost::function<void(const std::string& image_url, const std::string& caption)> image_url_callback_t;
 
-	static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location);
+	static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t());
 	static void setAuthCookie(const std::string& cookie);
 	static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; }
 
@@ -58,7 +59,7 @@ private:
 	friend class LLWebProfileResponders::PostImageResponder;
 	friend class LLWebProfileResponders::PostImageRedirectResponder;
 
-	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url);
+	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb);
 	static void reportImageUploadStatus(bool ok);
 	static std::string getAuthCookie();
 
-- 
cgit v1.2.3


From 9232d919c8571743d9f5c899b80e2807f131f4d3 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 6 Jun 2013 00:09:59 +0100
Subject: removed unnecessary passing of image caption

---
 indra/newview/llpanelsnapshotfacebook.cpp |  6 +++---
 indra/newview/llwebprofile.cpp            | 27 ++++++++++++---------------
 indra/newview/llwebprofile.h              |  4 ++--
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 954941274a..9bea5aa796 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -64,7 +64,7 @@ private:
 	/*virtual*/ void updateControls(const LLSD& info);
 
 	void onSend();
-	void onImageUploaded(const std::string& image_url, const std::string& caption);
+	void onImageUploaded(const std::string& caption, const std::string& image_url);
 };
 
 static LLRegisterPanelClassWrapper<LLPanelSnapshotFacebook> panel_class("llpanelsnapshotfacebook");
@@ -99,14 +99,14 @@ void LLPanelSnapshotFacebook::onSend()
 	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
 	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
 
-	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2));
+	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
 	LLFloaterSnapshot::postSave();
 
 	// test with a placeholder image, until we can figure out a way to grab the uploaded image url
 	//LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
 }
 
-void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption)
+void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url)
 {
 	if (!image_url.empty())
 	{
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 4bc4724753..6923724de2 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLWebProfileResponders::ConfigResponder);
 
 public:
-	ConfigResponder(LLPointer<LLImageFormatted> imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb)
-	:	mImagep(imagep), mImageCaption(caption), mImageCallback(cb)
+	ConfigResponder(LLPointer<LLImageFormatted> imagep, LLWebProfile::image_url_callback_t cb)
+	:	mImagep(imagep), mImageCallback(cb)
 	{
 	}
 
@@ -113,12 +113,11 @@ public:
 
 		// Do the actual image upload using the configuration.
 		LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
-		LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback);
+		LLWebProfile::post(mImagep, config, upload_url, mImageCallback);
 	}
 
 private:
 	LLPointer<LLImageFormatted> mImagep;
-	std::string mImageCaption;
 	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
@@ -129,8 +128,8 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
 	LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder);
 
 public:
-	PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb)
-	:	mImageCaption(caption), mImageCallback(cb)
+	PostImageRedirectResponder(LLWebProfile::image_url_callback_t cb)
+	:	mImageCallback(cb)
 	{
 	}
 
@@ -141,7 +140,7 @@ public:
 			std::string image_url = content.get("Location");
 			llinfos << "Image uploaded to " << image_url << llendl;
 			if (!mImageCallback.empty() && !image_url.empty())
-				mImageCallback(image_url, mImageCaption);
+				mImageCallback(image_url);
 		}
 	}
 
@@ -168,7 +167,6 @@ public:
 	}
 	
 private:
-	std::string mImageCaption;
 	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
@@ -180,8 +178,8 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
 	LOG_CLASS(LLWebProfileResponders::PostImageResponder);
 
 public:
-	PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb)
-	:	mImageCaption(caption), mImageCallback(cb)
+	PostImageResponder(LLWebProfile::image_url_callback_t cb)
+	:	mImageCallback(cb)
 	{
 	}
 
@@ -196,7 +194,7 @@ public:
 			headers["Cookie"] = LLWebProfile::getAuthCookie();
 			const std::string& redir_url = content["location"];
 			LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl;
-			LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers);
+			LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCallback), headers);
 		}
 		else
 		{
@@ -214,7 +212,6 @@ public:
 	}
 	
 private:
-	std::string mImageCaption;
 	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
@@ -235,7 +232,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
 	LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
 	LLSD headers = LLViewerMedia::getHeaders();
 	headers["Cookie"] = getAuthCookie();
-	LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers);
+	LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, cb), headers);
 }
 
 // static
@@ -246,7 +243,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie)
 }
 
 // static
-void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb)
+void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, LLWebProfile::image_url_callback_t cb)
 {
 	if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
 	{
@@ -312,7 +309,7 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
 	memcpy(data, body.str().data(), size);
 
 	// Send request, successful upload will trigger posting metadata.
-	LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers);
+	LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(cb), headers);
 }
 
 // static
diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h
index c1c0c23540..63dccf80af 100755
--- a/indra/newview/llwebprofile.h
+++ b/indra/newview/llwebprofile.h
@@ -48,7 +48,7 @@ class LLWebProfile
 
 public:
 	typedef boost::function<void(bool ok)> status_callback_t;
-	typedef boost::function<void(const std::string& image_url, const std::string& caption)> image_url_callback_t;
+	typedef boost::function<void(const std::string& image_url)> image_url_callback_t;
 
 	static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t());
 	static void setAuthCookie(const std::string& cookie);
@@ -59,7 +59,7 @@ private:
 	friend class LLWebProfileResponders::PostImageResponder;
 	friend class LLWebProfileResponders::PostImageRedirectResponder;
 
-	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb);
+	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, image_url_callback_t cb);
 	static void reportImageUploadStatus(bool ok);
 	static std::string getAuthCookie();
 
-- 
cgit v1.2.3


From 58177c83b0a81aae363bccc0e5ac2312b083341d Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 6 Jun 2013 00:17:33 +0100
Subject: uncommented the placeholder image upload

---
 indra/newview/llpanelsnapshotfacebook.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 9bea5aa796..56b1f921b9 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -103,7 +103,7 @@ void LLPanelSnapshotFacebook::onSend()
 	LLFloaterSnapshot::postSave();
 
 	// test with a placeholder image, until we can figure out a way to grab the uploaded image url
-	//LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
+	LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
 }
 
 void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url)
-- 
cgit v1.2.3


From cf5cf32ebf3a8eccbaa9e8c092fd23b357a68727 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 5 Jun 2013 16:31:32 -0700
Subject: ACME-471: Now using the actual map top-down image for the checked in
 location.

---
 indra/newview/llviewermenu.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 471db8d8fc..e8c7e0cfdc 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5995,8 +5995,12 @@ void handle_facebook_checkin()
 	std::string region_name = gAgent.getRegion()->getName();
 	std::string description;
 	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
+	LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal();
+	int x_pos = center_agent[0] / 256.0;
+	int y_pos = center_agent[1] / 256.0;
+	std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos);
 
-	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", "");
+	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, "");
 }
 
 //bool is_facebook_connected();
-- 
cgit v1.2.3


From ba90e388855f99ec5b3f1991f2437f616a5d9e62 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 5 Jun 2013 19:40:33 -0700
Subject: ACME-464 : WIP : Make the menu Connect to FB only connect and be
 disabled if the user is already connected

---
 indra/newview/llpanelsnapshotfacebook.cpp          |  3 ++-
 indra/newview/llviewermenu.cpp                     | 17 +++++++++--------
 indra/newview/skins/default/xui/en/menu_viewer.xml |  2 ++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 200c64f16b..27abbfa456 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -90,7 +90,8 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
 void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
 {
 	const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
-	getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot);
+    const bool is_connected = LLFacebookConnect::instance().getConnected();
+	getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot && is_connected);
 }
 
 void LLPanelSnapshotFacebook::onSend()
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 471db8d8fc..bc2e13d77e 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5974,16 +5974,18 @@ void handle_report_abuse()
 
 void handle_facebook_connect()
 {
-	if (LLFacebookConnect::instance().getConnected())
-	{
-		LLFacebookConnect::instance().disconnectFromFacebook();
-	}
-	else
+	if (!LLFacebookConnect::instance().getConnected())
 	{
         LLFacebookConnect::instance().getConnectionToFacebook();
 	}
 }
 
+bool enable_facebook_connect()
+{
+    // The menu item will be disabled if we are already connected
+    return !LLFacebookConnect::instance().getConnected();
+}
+
 void handle_facebook_checkin()
 {
 
@@ -5999,9 +6001,6 @@ void handle_facebook_checkin()
 	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", "");
 }
 
-//bool is_facebook_connected();
-
-
 void handle_buy_currency()
 {
 	LLBuyCurrencyHTML::openCurrencyFloater();
@@ -8754,6 +8753,8 @@ void initialize_menus()
     
     // Facebook Connect
 	commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
+	enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect));
+    
 	// Facebook Checkin
 	commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
 }
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 5061842c7f..e67350722d 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -20,6 +20,8 @@
         name="ConnectToFacebook">
         <menu_item_call.on_click
           function="Facebook.Connect" />
+        <menu_item_call.on_enable
+          function="Facebook.EnableConnect" />
       </menu_item_call>
       <menu_item_call
         label="Check in to Facebook"
-- 
cgit v1.2.3


From 9b1840c1c95a1a4adad913e0c162048fb78c537d Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 6 Jun 2013 16:34:24 -0400
Subject: STORM-1838 Added teleport request to conversation log.  Added xml to
 have message appear in IM window, if open.  Code cleanup.

---
 indra/newview/llavataractions.cpp                              |  1 -
 indra/newview/llconversationloglist.cpp                        |  5 ++++-
 indra/newview/llpanelpeoplemenus.cpp                           |  2 --
 indra/newview/skins/default/xui/en/menu_conversation.xml       |  2 --
 .../skins/default/xui/en/menu_conversation_log_gear.xml        | 10 ++++++++++
 indra/newview/skins/default/xui/en/notifications.xml           |  1 +
 6 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 285e70c8ea..45992b8c83 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -443,7 +443,6 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
 // static
 void LLAvatarActions::teleportRequest(const LLUUID& id)
 {
-llwarns << "DBG " << llendl;
 	std::string name;
 	gCacheName->getFullName(id, name);
 	gCacheName->cleanFullName(name);
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index cf9c9b3415..44212298cf 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -311,9 +311,12 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata)
 	}
 	else if ("offer_teleport" == command_name)
 	{
-llwarns << "DBG " << llendl;
 		LLAvatarActions::offerTeleport(selected_conversation_participant_id);
 	}
+	else if ("request_teleport" == command_name)
+	{
+		LLAvatarActions::teleportRequest(selected_conversation_participant_id);
+	}
 	else if("add_friend" == command_name)
 	{
 		if (!LLAvatarActions::isFriend(selected_conversation_participant_id))
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index ddc92f439b..0b2bf1d2c8 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -261,7 +261,6 @@ void PeopleContextMenu::requestTeleport()
 {
 	// boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(),
 	// so we have to use a wrapper.
-llwarns << "DBG " << llendl;
 	LLAvatarActions::teleportRequest(mUUIDs.front());
 }
 
@@ -269,7 +268,6 @@ void PeopleContextMenu::offerTeleport()
 {
 	// boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(),
 	// so we have to use a wrapper.
-llwarns << "DBG " << llendl;
 	LLAvatarActions::offerTeleport(mUUIDs);
 }
 
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index c2c15023c5..d8eb2f0ffd 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -46,7 +46,6 @@
         <on_click function="Avatar.DoToSelected" parameter="offer_teleport"/>
         <on_enable function="Avatar.EnableItem" parameter="can_offer_teleport"/>
     </menu_item_call>
-
     <menu_item_call
      label="Request teleport"
      layout="topleft"
@@ -54,7 +53,6 @@
         <on_click function="Avatar.DoToSelected" parameter="request_teleport"/>
         <on_enable function="Avatar.EnableItem" parameter="can_offer_teleport"/>
     </menu_item_call>
-
     <menu_item_call
      label="Voice call"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_conversation_log_gear.xml b/indra/newview/skins/default/xui/en/menu_conversation_log_gear.xml
index 8796b87955..a1a3afbf68 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation_log_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation_log_gear.xml
@@ -56,6 +56,16 @@
       function="Calllog.Enable"
       parameter="can_offer_teleport"/>
     </menu_item_call>
+    <menu_item_call
+    label="Request Teleport"
+    name="request_teleport">
+      <on_click
+       function="Calllog.Action"
+       parameter="request_teleport"/>
+      <on_enable
+      function="Calllog.Enable"
+      parameter="can_offer_teleport"/>
+    </menu_item_call>
     <menu_item_separator />
     <menu_item_call
      label="Add Friend"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 31e3e7fc30..3a01084b9a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6630,6 +6630,7 @@ However, this region contains content accessible to adults only.
   <notification
    icon="notify.tga"
    name="TeleportRequest"
+   log_to_im="true"
    type="offer">
 [NAME_SLURL] is requesting to be teleported to your location.
 [MESSAGE]
-- 
cgit v1.2.3


From d233d8836b610b5e5ca76a1e3bb4d63dc3592e66 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 6 Jun 2013 17:16:00 -0400
Subject: STORM-1838 Remove incorrect XML menu text

---
 indra/newview/skins/default/xui/en/menu_people_nearby.xml | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index 80e8e59076..f12226ebeb 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -143,15 +143,4 @@
          function="Avatar.EnableItem"
          parameter="can_block" />
     </menu_item_check>
-    <menu_item_separator />
-    <menu_item_call
-     label="Request Teleport"
-     layout="topleft"
-     name="Request Teleport">
-        <menu_item_call.on_click
-         function="Avatar.TeleportRequest"/>
-        <menu_item_call.on_enable
-         function="Avatar.EnableItem"
-         parameter="can_offer_teleport" />
-    </menu_item_call>
 </context_menu>
-- 
cgit v1.2.3


From 4163603a1118a9c1e220e56f22e757d162932ebe Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 6 Jun 2013 15:06:52 -0700
Subject: ACME-464 : WIP : Post in the snapshot Panel correctly disabled /
 enabled according to FB connection status

---
 indra/newview/llpanelsnapshotfacebook.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index b434741538..faeabf0a07 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -55,6 +55,7 @@ public:
 	/*virtual*/ void onOpen(const LLSD& key);
 
 private:
+	/*virtual*/ void updateCustomResControls(); ///< Show/hide facebook custom controls
 	/*virtual*/ std::string getWidthSpinnerName() const		{ return "facebook_snapshot_width"; }
 	/*virtual*/ std::string getHeightSpinnerName() const	{ return "facebook_snapshot_height"; }
 	/*virtual*/ std::string getAspectRatioCBName() const	{ return "facebook_keep_aspect_check"; }
@@ -84,6 +85,7 @@ BOOL LLPanelSnapshotFacebook::postBuild()
 // virtual
 void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
 {
+	updateControls(key);
 	LLPanelSnapshot::onOpen(key);
 }
 
@@ -95,6 +97,13 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
 	getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot && is_connected);
 }
 
+// virtual
+void LLPanelSnapshotFacebook::updateCustomResControls()
+{
+    const bool is_connected = LLFacebookConnect::instance().getConnected();
+	getChild<LLUICtrl>("post_btn")->setEnabled(is_connected);
+}
+
 void LLPanelSnapshotFacebook::onSend()
 {
 	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
-- 
cgit v1.2.3


From bee5369b2f2fc0208b1a0645c2702ed1cea43c55 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 6 Jun 2013 20:08:46 -0700
Subject: ACME-464 : Fixed : We connect to FB when bringing up the Upload to FB
 Snapshot panel

---
 indra/newview/llfloatersnapshot.cpp       | 12 +++++++++++-
 indra/newview/llpanelsnapshotfacebook.cpp |  5 +++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index d8d62e5bbb..8405d8aeec 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -37,6 +37,7 @@
 #include "llcriticaldamp.h"
 #include "llfloaterperms.h"
 #include "llui.h"
+#include "llfacebookconnect.h"
 #include "llfocusmgr.h"
 #include "llbutton.h"
 #include "llcombobox.h"
@@ -2245,7 +2246,16 @@ void LLFloaterSnapshot::update()
 	{
 		changed |= LLSnapshotLivePreview::onIdle(*iter);
 	}
-	if(changed)
+    
+    // We need to pool on facebook connection as it might change any time
+    static bool s_facebook_connected = false;
+    if (LLFacebookConnect::instance().getConnected() != s_facebook_connected)
+    {
+        s_facebook_connected = LLFacebookConnect::instance().getConnected();
+        changed = true;
+    }
+    
+	if (changed)
 	{
 		lldebugs << "changed" << llendl;
 		inst->impl.updateControls(inst);
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index faeabf0a07..7c8fc044c0 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -85,6 +85,10 @@ BOOL LLPanelSnapshotFacebook::postBuild()
 // virtual
 void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
 {
+	if (!LLFacebookConnect::instance().getConnected())
+	{
+        LLFacebookConnect::instance().getConnectionToFacebook();
+	}
 	updateControls(key);
 	LLPanelSnapshot::onOpen(key);
 }
@@ -100,6 +104,7 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
 // virtual
 void LLPanelSnapshotFacebook::updateCustomResControls()
 {
+    LLPanelSnapshot::updateCustomResControls();
     const bool is_connected = LLFacebookConnect::instance().getConnected();
 	getChild<LLUICtrl>("post_btn")->setEnabled(is_connected);
 }
-- 
cgit v1.2.3


From 5020579a07eca7a719f70b2ae7fde40a2522f124 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 7 Jun 2013 12:34:57 -0700
Subject: ACME-470: Adjusting 'Check in to Facebook' text to 'Check in to
 Facebook...'

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 5061842c7f..97cd01123f 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -22,7 +22,7 @@
           function="Facebook.Connect" />
       </menu_item_call>
       <menu_item_call
-        label="Check in to Facebook"
+        label="Check in to Facebook..."
         name="CheckinToFacebook">
         <menu_item_call.on_click
           function="Facebook.Checkin" />
-- 
cgit v1.2.3


From 54e879cc22ec342f57cec23d38ba269b83489111 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 8 Jun 2013 00:48:46 +0100
Subject: added Facebook status update feature for ACME-502, ACME-503, and
 ACME-504

---
 indra/newview/llfacebookconnect.cpp                 |  9 +++++++++
 indra/newview/llfacebookconnect.h                   |  3 ++-
 indra/newview/llnotificationscripthandler.cpp       |  3 +++
 indra/newview/llviewermenu.cpp                      | 20 ++++++++++++++++++++
 indra/newview/llviewermenu.h                        |  5 ++++-
 indra/newview/skins/default/xui/en/menu_viewer.xml  |  8 +++++++-
 .../newview/skins/default/xui/en/notifications.xml  | 21 +++++++++++++++++++++
 7 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 668ba04406..79e8d98668 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -323,6 +323,15 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri
 	LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder());
 }
 
+void LLFacebookConnect::updateStatus(const std::string& message)
+{
+	LLSD body;
+	body["message"] = message;
+	
+    // Note: we can use that route for different publish action. We should be able to use the same responder.
+	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder());
+}
+
 void LLFacebookConnect::storeContent(const LLSD& content)
 {
     mGeneration++;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 2dba182267..58e2707ba3 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -49,6 +49,7 @@ public:
 	void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
     void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture);
 	void sharePhoto(const std::string& image_url, const std::string& caption);
+	void updateStatus(const std::string& message);
 
     void clearContent();
 	void storeContent(const LLSD& content);
@@ -69,7 +70,7 @@ private:
    
     bool mConnectedToFbc;
     LLSD mContent;
-    S32  mGeneration;  
+    S32  mGeneration;
 };
 
 #endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index 08c98e4f28..2854962922 100755
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -35,6 +35,9 @@
 #include "llnotificationmanager.h"
 #include "llnotifications.h"
 #include "llscriptfloater.h"
+#include "llfacebookconnect.h"
+#include "llavatarname.h"
+#include "llavatarnamecache.h"
 
 using namespace LLNotificationsUI;
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 1bfa5ac2d1..67460c4bc6 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6005,6 +6005,23 @@ void handle_facebook_checkin()
 	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, "");
 }
 
+bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response)
+{
+	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+	if (option == 0)
+	{
+		std::string message = response["message"].asString();
+		if (!message.empty())
+			LLFacebookConnect::instance().updateStatus(message);
+	}
+	return false;
+}
+
+void handle_facebook_status()
+{
+	LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2));
+}
+
 void handle_buy_currency()
 {
 	LLBuyCurrencyHTML::openCurrencyFloater();
@@ -8761,4 +8778,7 @@ void initialize_menus()
     
 	// Facebook Checkin
 	commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
+    
+	// Facebook Status Update
+	commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status));
 }
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 9c3f13f843..e71beef10d 100755
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -138,9 +138,12 @@ bool handle_go_to();
 // Facebook Connect
 void handle_facebook_connect();
 
-//Facebook Checkin
+// Facebook Checkin
 void handle_facebook_checkin();
 
+// Facebook Status Update
+void handle_facebook_status();
+
 // Export to XML or Collada
 void handle_export_selected( void * );
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index e67350722d..2b2ac8c079 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -28,7 +28,13 @@
         name="CheckinToFacebook">
         <menu_item_call.on_click
           function="Facebook.Checkin" />
-      </menu_item_call>      
+      </menu_item_call>
+      <menu_item_call
+        label="Update status on Facebook..."
+        name="UpdateStatusOnFacebook">
+        <menu_item_call.on_click
+          function="Facebook.UpdateStatus" />
+      </menu_item_call>
       <menu_item_separator/>
       <menu_item_call
        label="Appearance..."
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9d1973f267..31b0d20bd8 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -10124,4 +10124,25 @@ Cannot create large prims that intersect other players.  Please re-try when othe
      yestext="OK"/>
   </notification>
   
+  <notification
+   icon="alertmodal.tga"
+   name="FacebookUpdateStatus"
+   type="alertmodal">
+    What's on your mind? (asks Facebook)
+    <tag>confirm</tag>
+    <form name="form">
+      <input name="message" type="text">
+      </input>
+      <button
+       default="true"
+       index="0"
+       name="OK"
+       text="OK"/>
+      <button
+       index="1"
+       name="Cancel"
+       text="Cancel"/>
+    </form>
+  </notification>
+  
 </notifications>
-- 
cgit v1.2.3


From 2b138990f8531df51f38e5e15309e1c92483dd05 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 7 Jun 2013 18:05:14 -0700
Subject: ACME-508 : Surface facebook connection errors in a modal notification
 dialog

---
 indra/newview/llfacebookconnect.cpp                | 29 ++++++++++++++++++++++
 .../newview/skins/default/xui/en/notifications.xml | 11 ++++++++
 2 files changed, 40 insertions(+)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 668ba04406..4c9de17e2e 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -33,6 +33,7 @@
 #include "llcallingcard.h"			// for LLAvatarTracker
 #include "llcommandhandler.h"
 #include "llhttpclient.h"
+#include "llnotificationsutil.h"
 #include "llurlaction.h"
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -80,6 +81,11 @@ public:
 		}
 		else
 		{
+            LLSD args(LLSD::emptyMap());
+            std::stringstream msg;
+            msg << reason << " (Code " << status << ")";
+            args["FAIL_REASON"] = msg.str();
+			LLNotificationsUtil::add("FacebookCannotConnect",args);
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -109,6 +115,11 @@ public:
 		}
 		else
 		{
+            LLSD args(LLSD::emptyMap());
+            std::stringstream msg;
+            msg << reason << " (Code " << status << ")";
+            args["FAIL_REASON"] = msg.str();
+			LLNotificationsUtil::add("FacebookCannotConnect",args);
 			LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -142,6 +153,11 @@ public:
 		}
 		else
 		{
+            LLSD args(LLSD::emptyMap());
+            std::stringstream msg;
+            msg << reason << " (Code " << status << ")";
+            args["FAIL_REASON"] = msg.str();
+			LLNotificationsUtil::add("FacebookCannotConnect",args);
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -175,6 +191,14 @@ public:
 			{
 				LLFacebookConnect::instance().connectToFacebook();
 			}
+            else
+            {
+                LLSD args(LLSD::emptyMap());
+                std::stringstream msg;
+                msg << reason << " (Code " << status << ")";
+                args["FAIL_REASON"] = msg.str();
+                LLNotificationsUtil::add("FacebookCannotConnect",args);
+            }
 		}
 	}
     
@@ -198,6 +222,11 @@ public:
 		}
 		else
 		{
+            LLSD args(LLSD::emptyMap());
+            std::stringstream msg;
+            msg << reason << " (Code " << status << ")";
+            args["FAIL_REASON"] = msg.str();
+			LLNotificationsUtil::add("FacebookCannotConnect",args);
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9d1973f267..b0203b5694 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5439,6 +5439,17 @@ This day cycle file references a missing sky file: [SKY].
 Sorry, the settings couldn't be applied to the region.  Leaving the region and then returning may help rectify the problem.  The reason given was: [FAIL_REASON]
   </notification>
 
+  <notification
+   functor="GenericAcknowledge"
+   icon="alertmodal.tga"
+   name="FacebookCannotConnect"
+   type="alertmodal">
+Connection to Facebook failed. Reason: [FAIL_REASON].
+    <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
+    
   <notification
    functor="GenericAcknowledge"
    icon="alertmodal.tga"
-- 
cgit v1.2.3


From e3f093a87157c012ab4e9d378cc26876b7b91900 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 10 Jun 2013 16:01:41 -0700
Subject: ACME-464, ACME-509 : Skip 302 error when prompting the user for
 errors

---
 indra/newview/llfacebookconnect.cpp | 49 +++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 27 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 1986814815..348e2c2e90 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -36,6 +36,21 @@
 #include "llnotificationsutil.h"
 #include "llurlaction.h"
 
+
+// Local function
+void prompt_user_for_error(U32 status, const std::string& reason)
+{
+    // Note: 302 (redirect) is *not* an error that warrants prompting the user
+    if (status != 302)
+    {
+        LLSD args(LLSD::emptyMap());
+        std::stringstream msg;
+        msg << reason << " (Code " << status << ")";
+        args["FAIL_REASON"] = msg.str();
+        LLNotificationsUtil::add("FacebookCannotConnect",args);
+    }
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 
@@ -81,12 +96,8 @@ public:
 		}
 		else
 		{
-            LLSD args(LLSD::emptyMap());
-            std::stringstream msg;
-            msg << reason << " (Code " << status << ")";
-            args["FAIL_REASON"] = msg.str();
-			LLNotificationsUtil::add("FacebookCannotConnect",args);
-			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+            prompt_user_for_error(status,reason);
+            LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
     
@@ -115,12 +126,8 @@ public:
 		}
 		else
 		{
-            LLSD args(LLSD::emptyMap());
-            std::stringstream msg;
-            msg << reason << " (Code " << status << ")";
-            args["FAIL_REASON"] = msg.str();
-			LLNotificationsUtil::add("FacebookCannotConnect",args);
-			LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
+            prompt_user_for_error(status,reason);
+            LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
     
@@ -153,11 +160,7 @@ public:
 		}
 		else
 		{
-            LLSD args(LLSD::emptyMap());
-            std::stringstream msg;
-            msg << reason << " (Code " << status << ")";
-            args["FAIL_REASON"] = msg.str();
-			LLNotificationsUtil::add("FacebookCannotConnect",args);
+            prompt_user_for_error(status,reason);
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -193,11 +196,7 @@ public:
 			}
             else
             {
-                LLSD args(LLSD::emptyMap());
-                std::stringstream msg;
-                msg << reason << " (Code " << status << ")";
-                args["FAIL_REASON"] = msg.str();
-                LLNotificationsUtil::add("FacebookCannotConnect",args);
+                prompt_user_for_error(status,reason);
             }
 		}
 	}
@@ -222,11 +221,7 @@ public:
 		}
 		else
 		{
-            LLSD args(LLSD::emptyMap());
-            std::stringstream msg;
-            msg << reason << " (Code " << status << ")";
-            args["FAIL_REASON"] = msg.str();
-			LLNotificationsUtil::add("FacebookCannotConnect",args);
+            prompt_user_for_error(status,reason);
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
-- 
cgit v1.2.3


From 933debfc10d09d1d25fd196597904fc9753b4cb0 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 12 Jun 2013 01:16:27 +0100
Subject: cleaned up FBC snapshot feature and made it work with new direct
 upload route on FBC API

---
 indra/newview/llfacebookconnect.cpp                | 107 ++++++++++++++-------
 indra/newview/llfacebookconnect.h                  |  16 ++-
 indra/newview/llfloatersnapshot.cpp                |   3 +-
 indra/newview/llpanelpeople.cpp                    |  10 --
 indra/newview/llpanelpeople.h                      |   1 -
 indra/newview/llpanelsnapshotfacebook.cpp          |  19 +++-
 .../newview/skins/default/xui/en/menu_gear_fbc.xml |   9 +-
 .../newview/skins/default/xui/en/notifications.xml |   2 +-
 8 files changed, 105 insertions(+), 62 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 348e2c2e90..b0b773d508 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -35,19 +35,23 @@
 #include "llhttpclient.h"
 #include "llnotificationsutil.h"
 #include "llurlaction.h"
+#include "llimagepng.h"
 
 
 // Local function
-void prompt_user_for_error(U32 status, const std::string& reason)
+void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description)
 {
     // Note: 302 (redirect) is *not* an error that warrants prompting the user
     if (status != 302)
     {
         LLSD args(LLSD::emptyMap());
         std::stringstream msg;
-        msg << reason << " (Code " << status << ")";
-        args["FAIL_REASON"] = msg.str();
-        LLNotificationsUtil::add("FacebookCannotConnect",args);
+        msg << status;
+        args["STATUS"] = msg.str();
+		args["REASON"] = reason;
+		args["CODE"] = code;
+		args["DESCRIPTION"] = description;
+        LLNotificationsUtil::add("FacebookCannotConnect", args);
     }
 }
 
@@ -96,7 +100,7 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status,reason);
+            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
             LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -113,11 +117,14 @@ public:
 
 ///////////////////////////////////////////////////////////////////////////////
 //
-class LLFacebookPostResponder : public LLHTTPClient::Responder
+class LLFacebookShareResponder : public LLHTTPClient::Responder
 {
-	LOG_CLASS(LLFacebookPostResponder);
+	LOG_CLASS(LLFacebookShareResponder);
 public:
     
+	LLFacebookShareResponder() {}
+	LLFacebookShareResponder(LLFacebookConnect::share_callback_t cb) : mShareCallback(cb) {}
+    
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		if (isGoodStatus(status))
@@ -126,9 +133,14 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status,reason);
+            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
             LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
+		
+		if (mShareCallback)
+		{
+			mShareCallback(isGoodStatus(status));
+		}
 	}
     
     void completedHeader(U32 status, const std::string& reason, const LLSD& content)
@@ -139,6 +151,8 @@ public:
         }
     }
     
+private:
+	LLFacebookConnect::share_callback_t mShareCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -160,7 +174,7 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status,reason);
+            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -196,7 +210,7 @@ public:
 			}
             else
             {
-                prompt_user_for_error(status,reason);
+				prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
             }
 		}
 	}
@@ -221,7 +235,7 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status,reason);
+            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
 	}
@@ -314,27 +328,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri
 		body["message"] = message;
 
 	// Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookPostResponder());
-}
-
-void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture)
-{
-    LLSD body;
-	if (!message.empty())
-		body["message"] = message;
-	if (!link.empty())
-		body["link"] = link;
-	if (!name.empty())
-		body["name"] = name;
-	if (!caption.empty())
-		body["caption"] = caption;
-	if (!description.empty())
-		body["description"] = description;
-	if (!picture.empty())
-		body["picture"] = picture;
-    
-    // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder(mPostCheckinCallback));
 }
 
 void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption)
@@ -344,7 +338,52 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri
 	body["caption"] = caption;
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookShareResponder());
+}
+
+void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption)
+{
+	// All this code is mostly copied from LLWebProfile::post()
+	if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
+	{
+		llwarns << "Image to upload is not a PNG" << llendl;
+		llassert(dynamic_cast<LLImagePNG*>(image.get()) != 0);
+		return;
+	}
+
+	const std::string boundary = "----------------------------0123abcdefab";
+
+	LLSD headers;
+	headers["Content-Type"] = "multipart/form-data; boundary=" + boundary;
+
+	std::ostringstream body;
+
+	// *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=\"snapshot.png\"\r\n"
+			<< "Content-Type: image/png\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";
+
+	// postRaw() takes ownership of the buffer and releases it later.
+	size_t size = body.str().size();
+	U8 *data = new U8[size];
+	memcpy(data, body.str().data(), size);
+	
+    // Note: we can use that route for different publish action. We should be able to use the same responder.
+	LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(mSharePhotoCallback), headers);
 }
 
 void LLFacebookConnect::updateStatus(const std::string& message)
@@ -353,7 +392,7 @@ void LLFacebookConnect::updateStatus(const std::string& message)
 	body["message"] = message;
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder(mUpdateStatusCallback));
 }
 
 void LLFacebookConnect::storeContent(const LLSD& content)
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 58e2707ba3..37b4e2bc94 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -29,6 +29,7 @@
 #define LL_LLFACEBOOKCONNECT_H
 
 #include "llsingleton.h"
+#include "llimage.h"
 
 /**
  * @class LLFacebookConnect
@@ -40,6 +41,8 @@ class LLFacebookConnect : public LLSingleton<LLFacebookConnect>
 {
 	LOG_CLASS(LLFacebookConnect);
 public:
+	typedef boost::function<void(bool ok)> share_callback_t;
+
 	void connectToFacebook(const std::string& auth_code = "");
 	void disconnectFromFacebook();
 	void tryToReconnectToFacebook();
@@ -47,9 +50,13 @@ public:
     
     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 postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture);
-	void sharePhoto(const std::string& image_url, const std::string& caption);
+    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 setPostCheckinCallback(share_callback_t cb) { mPostCheckinCallback = cb; }
+	void setSharePhotoCallback(share_callback_t cb) { mSharePhotoCallback = cb; }
+	void setUpdateStatusCallback(share_callback_t cb) { mUpdateStatusCallback = cb; }
 
     void clearContent();
 	void storeContent(const LLSD& content);
@@ -60,6 +67,7 @@ public:
     S32  generation() { return mGeneration; }
     
     void openFacebookWeb(std::string url);
+
 private:
 
 	friend class LLSingleton<LLFacebookConnect>;
@@ -71,6 +79,10 @@ private:
     bool mConnectedToFbc;
     LLSD mContent;
     S32  mGeneration;
+	
+	share_callback_t mPostCheckinCallback;
+	share_callback_t mSharePhotoCallback;
+	share_callback_t mUpdateStatusCallback;
 };
 
 #endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 8405d8aeec..d60f9a48c4 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -2038,7 +2038,8 @@ BOOL LLFloaterSnapshot::postBuild()
 
 	getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));
 	childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this);
-
+	
+	LLFacebookConnect::instance().setSharePhotoCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
 	LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
 	LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1));
 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 5bc645bcfd..4f91a65dfa 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -571,7 +571,6 @@ LLPanelPeople::LLPanelPeople()
 	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
 	mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this));
 	mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this));
-	mCommitCallbackRegistrar.add("People.testFBCCheckin", boost::bind(&LLPanelPeople::onFacebookCheckinClicked, this));
 
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.AddFriendWizard",	boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked,	this));
@@ -1760,15 +1759,6 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 }
 
-void LLPanelPeople::onFacebookCheckinClicked()
-{
-    // Get the local SLURL 
-	LLSLURL slurl;
-	LLAgentUI::buildSLURL(slurl);
-
-    LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString(), slurl.getRegion(), "", "", "");
-}
-
 void LLPanelPeople::onFacebookAppRequestClicked()
 {
 }
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 9cfa6b7cd2..633f475be7 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -124,7 +124,6 @@ private:
 	void					onFacebookAppRequestClicked();
 	void					onFacebookAppSendClicked();
 	void					onFacebookTestAddClicked();
-    void                    onFacebookCheckinClicked();
 
 	bool					onFriendsViewSortMenuItemCheck(const LLSD& userdata);
 	bool					onRecentViewSortMenuItemCheck(const LLSD& userdata);
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 7c8fc044c0..30ef5f326c 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -39,6 +39,8 @@
 #include "llwebprofile.h"
 
 #include "llfacebookconnect.h"
+#include "llslurl.h"
+#include "llagentui.h"
 
 /**
  * Posts a snapshot to the resident Facebook account.
@@ -113,12 +115,19 @@ void LLPanelSnapshotFacebook::onSend()
 {
 	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
 	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
-
-	LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
+	
+	if (add_location)
+	{
+		LLSLURL slurl;
+		LLAgentUI::buildSLURL(slurl);
+		if (caption.empty())
+			caption = slurl.getSLURLString();
+		else
+			caption = caption + " " + slurl.getSLURLString();
+	}
+	LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption);
+	//LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
 	LLFloaterSnapshot::postSave();
-
-	// test with a placeholder image, until we can figure out a way to grab the uploaded image url
-	LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption);
 }
 
 void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url)
diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
index 2c341b6ecc..cf27f528ee 100644
--- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
+++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
@@ -40,12 +40,5 @@
    name="Facebook App Add">
     <menu_item_check.on_click
      function="People.testaddFBCFolderView"/>
-  </menu_item_check>  
-  <menu_item_check
-   label="Facebook post checkin message"
-   layout="topleft"
-   name="Facebook Checkin">
-   <menu_item_check.on_click
-    function="People.testFBCCheckin"/>
   </menu_item_check>
-</toggleable_menu>
\ No newline at end of file
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d69f1bb4d5..d1d8291c90 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5444,7 +5444,7 @@ Sorry, the settings couldn't be applied to the region.  Leaving the region and t
    icon="alertmodal.tga"
    name="FacebookCannotConnect"
    type="alertmodal">
-Connection to Facebook failed. Reason: [FAIL_REASON].
+Connection to Facebook failed. Reason: [STATUS] [REASON] ([CODE] - [DESCRIPTION])
     <usetemplate
      name="okbutton"
      yestext="OK"/>
-- 
cgit v1.2.3


From f5fb235aac7bb437416d5c665ff43ed5685a6755 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 13 Jun 2013 16:57:04 -0700
Subject: ACME-537: Prevented error code for showing up when disconnected from
 FB and opening the 'Friends' tab of the people panel.

---
 indra/newview/llfacebookconnect.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index b0b773d508..3de2351d78 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -187,7 +187,10 @@ class LLFacebookConnectedResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLFacebookConnectedResponder);
 public:
     
-	LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {}
+	LLFacebookConnectedResponder(bool show_login_if_not_connected, bool show_error_if_not_connected) 
+		: mShowLoginIfNotConnected(show_login_if_not_connected),
+			mShowErrorIfNotConnected(show_error_if_not_connected)
+		{}
     
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
@@ -208,7 +211,7 @@ public:
 			{
 				LLFacebookConnect::instance().connectToFacebook();
 			}
-            else
+            else if(mShowErrorIfNotConnected)
             {
 				prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
             }
@@ -217,6 +220,7 @@ public:
     
 private:
 	bool mShowLoginIfNotConnected;
+	bool mShowErrorIfNotConnected;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -292,7 +296,7 @@ void LLFacebookConnect::tryToReconnectToFacebook()
 	{
 		const bool follow_redirects=false;
 		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-		LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(false),
+		LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(false, false),
 						  LLSD(), timeout, follow_redirects);
 	}
 }
@@ -301,7 +305,7 @@ void LLFacebookConnect::getConnectionToFacebook()
 {
     const bool follow_redirects=false;
     const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-    LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true),
+    LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true, true),
                   LLSD(), timeout, follow_redirects);
 }
 
-- 
cgit v1.2.3


From 37dcc335321fb7a16b99fe4f159aa68ad8ec5d76 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 14 Jun 2013 16:07:03 -0700
Subject: ACME-558 Update LLPanelPeople to use the friends list callback and
 remove the timer dependencies

---
 indra/newview/llfacebookconnect.cpp |   5 +
 indra/newview/llfacebookconnect.h   |   3 +
 indra/newview/llpanelpeople.cpp     | 198 +++++++++++++++---------------------
 indra/newview/llpanelpeople.h       |   2 +-
 4 files changed, 91 insertions(+), 117 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 3de2351d78..6b9d753721 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -403,6 +403,11 @@ void LLFacebookConnect::storeContent(const LLSD& content)
 {
     mGeneration++;
     mContent = content;
+
+	if(mContentUpdatedCallback)
+	{
+		mContentUpdatedCallback();
+	}
 }
 
 const LLSD& LLFacebookConnect::getContent() const
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 37b4e2bc94..c694a82a95 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -42,6 +42,7 @@ class LLFacebookConnect : public LLSingleton<LLFacebookConnect>
 	LOG_CLASS(LLFacebookConnect);
 public:
 	typedef boost::function<void(bool ok)> share_callback_t;
+	typedef boost::function<void()> content_updated_callback_t;
 
 	void connectToFacebook(const std::string& auth_code = "");
 	void disconnectFromFacebook();
@@ -57,6 +58,7 @@ public:
 	void setPostCheckinCallback(share_callback_t cb) { mPostCheckinCallback = cb; }
 	void setSharePhotoCallback(share_callback_t cb) { mSharePhotoCallback = cb; }
 	void setUpdateStatusCallback(share_callback_t cb) { mUpdateStatusCallback = cb; }
+	void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;}
 
     void clearContent();
 	void storeContent(const LLSD& content);
@@ -83,6 +85,7 @@ private:
 	share_callback_t mPostCheckinCallback;
 	share_callback_t mSharePhotoCallback;
 	share_callback_t mUpdateStatusCallback;
+	content_updated_callback_t mContentUpdatedCallback;
 };
 
 #endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4f91a65dfa..d099746e45 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -81,7 +81,6 @@
 
 #define FRIEND_LIST_UPDATE_TIMEOUT	0.5
 #define NEARBY_LIST_UPDATE_INTERVAL 1
-#define FBCTEST_LIST_UPDATE_INTERVAL 0.25
 
 static const std::string NEARBY_TAB_NAME	= "nearby_panel";
 static const std::string FRIENDS_TAB_NAME	= "friends_panel";
@@ -506,45 +505,6 @@ public:
 	}
 };
 
-/**
- * Periodically updates the FBC test list after a login is initiated.
- * 
- * The period is defined by FBCTEST_LIST_UPDATE_INTERVAL constant.
- */
-class LLFbcTestListUpdater : public LLAvatarListUpdater
-{
-	LOG_CLASS(LLFbcTestListUpdater);
-
-public:
-	LLFbcTestListUpdater(callback_t cb)
-	:	LLAvatarListUpdater(cb, FBCTEST_LIST_UPDATE_INTERVAL)
-	{
-		setActive(false);
-	}
-
-	/*virtual*/ void setActive(bool val)
-	{
-		if (val)
-		{
-			// update immediately and start regular updates
-			update();
-			mEventTimer.start(); 
-		}
-		else
-		{
-			// stop regular updates
-			mEventTimer.stop();
-		}
-	}
-
-	/*virtual*/ BOOL tick()
-	{
-		update();
-		return FALSE;
-	}
-private:
-};
-
 //=============================================================================
 
 LLPanelPeople::LLPanelPeople()
@@ -563,7 +523,6 @@ LLPanelPeople::LLPanelPeople()
 	mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList,	this));
 	mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList,	this));
 	mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList,	this));
-	mFacebookListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFacebookList,	this));
 	mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
 
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
@@ -598,7 +557,6 @@ LLPanelPeople::~LLPanelPeople()
 	delete mNearbyListUpdater;
 	delete mFriendListUpdater;
 	delete mRecentListUpdater;
-	delete mFacebookListUpdater;
 
 	if(LLVoiceClient::instanceExists())
 	{
@@ -651,7 +609,7 @@ 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(&Updater::setActive, mFacebookListUpdater, _2));
+	friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2));
 
 	mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online");
 	mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all");
@@ -695,12 +653,12 @@ BOOL LLPanelPeople::postBuild()
 	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
 	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");
     // Note: we use the same updater for both test lists (brute force but OK since it's temporary)
-	social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2));
+	social_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2));
 
 	//===Test START========================================================================
 
 	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
-	socialtwo_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2));
+	socialtwo_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2));
 
 	//Create folder view
 	LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel);
@@ -903,31 +861,75 @@ void LLPanelPeople::updateFriendList()
 
 void 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::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
+	if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
 	{
-		std::string name = i->second["name"].asString();
-		LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
-		bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false;
+		mFacebookListGeneration = LLFacebookConnect::instance().generation();
 
-		if(!second_life_buddy)
+		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::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
 		{
-			//FB+SL but not SL friend
-			if (agent_id.notNull())
+			std::string name = i->second["name"].asString();
+			LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
+			bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false;
+
+			if(!second_life_buddy)
 			{
-				suggested_friends.push_back(agent_id);
+				//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();
+		//Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
+		mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
+		showFriendsAccordionsIfNeeded();
+
+
+
+		//TODO Gilbert: Below code will eventually be deprecated
+		mFacebookFriends->clear();
+		LLPersonTabModel::tab_type tab_type;
+		LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
+
+		for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
+		{
+			std::string name = i->second["name"].asString();
+			LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
+			bool second_life_buddy = agent_id.notNull() ? avatar_tracker.isBuddy(agent_id) : false;
+
+			//add to avatar list
+			mFacebookFriends->addNewItem(agent_id, name, false);
+
+			if(!second_life_buddy)
+			{
+				//FB+SL but not SL friend
+				if (agent_id.notNull())
+				{
+					tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+				}
+				//FB only friend
+				else
+				{
+					tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+				}
+
+				//Add to person tab model
+				LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
+				if (person_tab_model)
+				{
+					addParticipantToModel(person_tab_model, agent_id, name);
+				}
+			}
+		}
+
+	}
 }
 
 void LLPanelPeople::updateNearbyList()
@@ -953,63 +955,27 @@ void LLPanelPeople::updateRecentList()
 	mRecentList->setDirty();
 }
 
-void LLPanelPeople::updateFacebookList()
+void LLPanelPeople::updateFacebookList(bool visible)
 {
-	if (mTryToConnectToFbc)
-	{	
-		// try to reconnect to facebook!
-		LLFacebookConnect::instance().tryToReconnectToFacebook();
-
-		// don't try again
-		mTryToConnectToFbc = false;
-		
-		// stop updating
-		mFacebookListUpdater->setActive(false);
-	}
-    
-    if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
-    {
-        mFacebookListGeneration = LLFacebookConnect::instance().generation();
-        LLSD friends = LLFacebookConnect::instance().getContent();
-
-        mFacebookFriends->clear();
-        LLPersonTabModel::tab_type tab_type;
-        LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
-        
-        for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
-        {
-            std::string name = i->second["name"].asString();
-            LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
-            bool second_life_buddy = agent_id.notNull() ? avatar_tracker.isBuddy(agent_id) : false;
-
-            //add to avatar list
-            mFacebookFriends->addNewItem(agent_id, name, false);
-            
-			if(!second_life_buddy)
-			{
-				//FB+SL but not SL friend
-				if (agent_id.notNull())
-				{
-					tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
-				}
-				//FB only friend
-				else
-				{
-					tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-				}
+	if(visible)
+	{
+		LLFacebookConnect::instance().setContentUpdatedCallback(boost::bind(&LLPanelPeople::updateSuggestedFriendList, this));
 
-				//Add to person tab model
-				LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
-				if (person_tab_model)
-				{
-					addParticipantToModel(person_tab_model, agent_id, name);
-				}
-			}
-        }
+		if (mTryToConnectToFbc)
+		{	
+			// try to reconnect to facebook!
+			LLFacebookConnect::instance().tryToReconnectToFacebook();
 
+			// don't try again
+			mTryToConnectToFbc = false;
+		}
+    
 		updateSuggestedFriendList();
-		showFriendsAccordionsIfNeeded();
-    }
+	}
+	else
+	{
+		LLFacebookConnect::instance().setContentUpdatedCallback(NULL);
+	}
 }
 
 void LLPanelPeople::updateButtons()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 633f475be7..1cd2a05e91 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -88,7 +88,7 @@ private:
 	void					updateSuggestedFriendList();
 	void					updateNearbyList();
 	void					updateRecentList();
-	void					updateFacebookList();
+	void					updateFacebookList(bool visible);
 
 	bool					isItemsFreeOfFriends(const uuid_vec_t& uuids);
 
-- 
cgit v1.2.3


From 2eb466908e8056f9b890d06d449ad8d10d3ff4cf Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 14 Jun 2013 20:01:33 -0700
Subject: ACME-520 : Add more extended state in LLFacebookConnect and handle it
 consistently and transparently from the public interface

---
 indra/newview/llfacebookconnect.cpp       | 51 ++++++++++++++-----------------
 indra/newview/llfacebookconnect.h         | 22 ++++++++-----
 indra/newview/llfloatersnapshot.cpp       |  4 +--
 indra/newview/llpanelpeople.cpp           |  4 +--
 indra/newview/llpanelsnapshotfacebook.cpp |  6 ++--
 indra/newview/llviewermenu.cpp            |  4 +--
 6 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 3de2351d78..ef0ae0a69e 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -57,7 +57,6 @@ void prompt_user_for_error(U32 status, const std::string& reason, const std::str
 
 ///////////////////////////////////////////////////////////////////////////////
 //
-
 class LLFacebookConnectHandler : public LLCommandHandler
 {
 public:
@@ -87,6 +86,10 @@ class LLFacebookConnectResponder : public LLHTTPClient::Responder
 {
 	LOG_CLASS(LLFacebookConnectResponder);
 public:
+    LLFacebookConnectResponder()
+    {
+        LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
+    }
     
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
@@ -95,11 +98,12 @@ public:
 			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
 			
 			// Grab some graph data now that we are connected
-            LLFacebookConnect::instance().setConnected(true);
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
 			LLFacebookConnect::instance().loadFacebookFriends();
 		}
 		else
 		{
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
             prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
             LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
 		}
@@ -169,7 +173,7 @@ public:
 			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
 			
 			// Clear all facebook stuff
-            LLFacebookConnect::instance().setConnected(false);
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
 			LLFacebookConnect::instance().clearContent();
 		}
 		else
@@ -187,10 +191,10 @@ class LLFacebookConnectedResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLFacebookConnectedResponder);
 public:
     
-	LLFacebookConnectedResponder(bool show_login_if_not_connected, bool show_error_if_not_connected) 
-		: mShowLoginIfNotConnected(show_login_if_not_connected),
-			mShowErrorIfNotConnected(show_error_if_not_connected)
-		{}
+	LLFacebookConnectedResponder()
+    {
+        LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
+    }
     
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
@@ -199,7 +203,7 @@ public:
 			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
             
 			// Grab some graph data if already connected
-            LLFacebookConnect::instance().setConnected(true);
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
 			LLFacebookConnect::instance().loadFacebookFriends();
 		}
 		else
@@ -207,20 +211,19 @@ public:
 			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
             
 			// show the facebook login page if not connected yet
-			if ((status == 404) && mShowLoginIfNotConnected)
+			if (status == 404)
 			{
 				LLFacebookConnect::instance().connectToFacebook();
 			}
-            else if(mShowErrorIfNotConnected)
+            else
             {
+                LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
 				prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
             }
 		}
 	}
     
 private:
-	bool mShowLoginIfNotConnected;
-	bool mShowErrorIfNotConnected;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -256,7 +259,7 @@ public:
 ///////////////////////////////////////////////////////////////////////////////
 //
 LLFacebookConnect::LLFacebookConnect()
-:	mConnectedToFbc(false),
+:	mConnectionState(FB_NOT_CONNECTED),
     mContent(),
     mGeneration(0)
 {
@@ -290,23 +293,15 @@ void LLFacebookConnect::disconnectFromFacebook()
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
 }
 
-void LLFacebookConnect::tryToReconnectToFacebook()
-{
-	if (!mConnectedToFbc)
-	{
-		const bool follow_redirects=false;
-		const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-		LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(false, false),
-						  LLSD(), timeout, follow_redirects);
-	}
-}
-
 void LLFacebookConnect::getConnectionToFacebook()
 {
-    const bool follow_redirects=false;
-    const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-    LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true, true),
-                  LLSD(), timeout, follow_redirects);
+    if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED))
+    {
+        const bool follow_redirects=false;
+        const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(),
+                          LLSD(), timeout, follow_redirects);
+    }
 }
 
 void LLFacebookConnect::loadFacebookFriends()
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 37b4e2bc94..e719314920 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -41,12 +41,19 @@ class LLFacebookConnect : public LLSingleton<LLFacebookConnect>
 {
 	LOG_CLASS(LLFacebookConnect);
 public:
+    enum EConnectionState
+	{
+		FB_NOT_CONNECTED = 0,
+		FB_CONNECTION_IN_PROGRESS = 1,
+		FB_CONNECTED = 2,
+		FB_CONNECTION_FAILED = 3
+	};
+
 	typedef boost::function<void(bool ok)> share_callback_t;
 
-	void connectToFacebook(const std::string& auth_code = "");
-	void disconnectFromFacebook();
-	void tryToReconnectToFacebook();
-    void getConnectionToFacebook();
+	void connectToFacebook(const std::string& auth_code = "");  // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use.
+	void disconnectFromFacebook();                              // Disconnect from the FBC service.
+    void getConnectionToFacebook();                             // Check if an access token is available on the FBC service. If not, call connectToFacebook().
     
     void loadFacebookFriends();
 	void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
@@ -62,21 +69,20 @@ public:
 	void storeContent(const LLSD& content);
     const LLSD& getContent() const;
     
-    void setConnected(bool connected) { mConnectedToFbc = connected; }
-    bool getConnected() { return mConnectedToFbc; }
+    void setConnectionState(EConnectionState connection_state) { mConnectionState = connection_state; }
+    bool isConnected() { return (mConnectionState == FB_CONNECTED); }
     S32  generation() { return mGeneration; }
     
     void openFacebookWeb(std::string url);
 
 private:
-
 	friend class LLSingleton<LLFacebookConnect>;
 
 	LLFacebookConnect();
 	~LLFacebookConnect() {};
  	std::string getFacebookConnectURL(const std::string& route = "");
    
-    bool mConnectedToFbc;
+    EConnectionState mConnectionState;
     LLSD mContent;
     S32  mGeneration;
 	
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index d60f9a48c4..0703600961 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -2250,9 +2250,9 @@ void LLFloaterSnapshot::update()
     
     // We need to pool on facebook connection as it might change any time
     static bool s_facebook_connected = false;
-    if (LLFacebookConnect::instance().getConnected() != s_facebook_connected)
+    if (LLFacebookConnect::instance().isConnected() != s_facebook_connected)
     {
-        s_facebook_connected = LLFacebookConnect::instance().getConnected();
+        s_facebook_connected = LLFacebookConnect::instance().isConnected();
         changed = true;
     }
     
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4f91a65dfa..24e8d40d7e 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -958,7 +958,7 @@ void LLPanelPeople::updateFacebookList()
 	if (mTryToConnectToFbc)
 	{	
 		// try to reconnect to facebook!
-		LLFacebookConnect::instance().tryToReconnectToFacebook();
+        LLFacebookConnect::instance().getConnectionToFacebook();
 
 		// don't try again
 		mTryToConnectToFbc = false;
@@ -1749,7 +1749,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model
 
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
-	if (LLFacebookConnect::instance().getConnected())
+	if (LLFacebookConnect::instance().isConnected())
 	{
 		LLFacebookConnect::instance().disconnectFromFacebook();
 	}
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 30ef5f326c..0a76bc3b9d 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -87,7 +87,7 @@ BOOL LLPanelSnapshotFacebook::postBuild()
 // virtual
 void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
 {
-	if (!LLFacebookConnect::instance().getConnected())
+	if (!LLFacebookConnect::instance().isConnected())
 	{
         LLFacebookConnect::instance().getConnectionToFacebook();
 	}
@@ -99,7 +99,7 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
 void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
 {
 	const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
-    const bool is_connected = LLFacebookConnect::instance().getConnected();
+    const bool is_connected = LLFacebookConnect::instance().isConnected();
 	getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot && is_connected);
 }
 
@@ -107,7 +107,7 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
 void LLPanelSnapshotFacebook::updateCustomResControls()
 {
     LLPanelSnapshot::updateCustomResControls();
-    const bool is_connected = LLFacebookConnect::instance().getConnected();
+    const bool is_connected = LLFacebookConnect::instance().isConnected();
 	getChild<LLUICtrl>("post_btn")->setEnabled(is_connected);
 }
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 67460c4bc6..ae28d6b129 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5974,7 +5974,7 @@ void handle_report_abuse()
 
 void handle_facebook_connect()
 {
-	if (!LLFacebookConnect::instance().getConnected())
+	if (!LLFacebookConnect::instance().isConnected())
 	{
         LLFacebookConnect::instance().getConnectionToFacebook();
 	}
@@ -5983,7 +5983,7 @@ void handle_facebook_connect()
 bool enable_facebook_connect()
 {
     // The menu item will be disabled if we are already connected
-    return !LLFacebookConnect::instance().getConnected();
+    return !LLFacebookConnect::instance().isConnected();
 }
 
 void handle_facebook_checkin()
-- 
cgit v1.2.3


From efa555cc5c5fa0b3d25f37fd8782aff5874d3779 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 17 Jun 2013 14:59:03 -0700
Subject: ACME-558: Adding logging information, when a friends list is received
 the log message 'Facebook: Friends list received' will be displayed. When the
 suggested friends list is updated the log message 'Facebook: Updating
 Suggested Friends List' will be displayed.

---
 indra/newview/llfacebookconnect.cpp | 1 +
 indra/newview/llpanelpeople.cpp     | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 6b9d753721..95c458ac04 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -234,6 +234,7 @@ public:
 	{
 		if (isGoodStatus(status))
 		{
+			llinfos << "Facebook: Friends list received" << llendl;
 			LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL;
 			LLFacebookConnect::instance().storeContent(content);
 		}
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index d099746e45..8421889123 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -863,6 +863,8 @@ void LLPanelPeople::updateSuggestedFriendList()
 {
 	if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
 	{
+		llinfos << "Facebook: Updating Suggested Friends List" << llendl;
+
 		mFacebookListGeneration = LLFacebookConnect::instance().generation();
 
 		const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
-- 
cgit v1.2.3


From 2e2015dc573001a19c7b5f6ed1c4d48392ece611 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 17 Jun 2013 17:22:44 -0700
Subject: CHUI 560: Adding socialpanel.h/cpp files

---
 indra/newview/CMakeLists.txt    |  2 ++
 indra/newview/llsocialpanel.cpp | 32 ++++++++++++++++++++++++++++++++
 indra/newview/llsocialpanel.h   | 31 +++++++++++++++++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 indra/newview/llsocialpanel.cpp
 create mode 100644 indra/newview/llsocialpanel.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f01c2f714d..4ab1f227be 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -509,6 +509,7 @@ set(viewer_SOURCE_FILES
     llsky.cpp
     llslurl.cpp
     llsociallist.cpp
+    llsocialpanel.cpp
     llspatialpartition.cpp
     llspeakers.cpp
     llspeakingindicatormanager.cpp
@@ -1084,6 +1085,7 @@ set(viewer_HEADER_FILES
     llsky.h
     llslurl.h
     llsociallist.h
+    llsocialpanel.h
     llspatialpartition.h
     llspeakers.h
     llspeakingindicatormanager.h
diff --git a/indra/newview/llsocialpanel.cpp b/indra/newview/llsocialpanel.cpp
new file mode 100644
index 0000000000..6373c1c560
--- /dev/null
+++ b/indra/newview/llsocialpanel.cpp
@@ -0,0 +1,32 @@
+/** 
+* @file llsocialpanel.cpp
+* @brief Implementation of llsocialpanel
+* @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 "llsocialpanel.h"
+
+
diff --git a/indra/newview/llsocialpanel.h b/indra/newview/llsocialpanel.h
new file mode 100644
index 0000000000..873d93951a
--- /dev/null
+++ b/indra/newview/llsocialpanel.h
@@ -0,0 +1,31 @@
+/** 
+* @file   llsocialpanel.h
+* @brief  Header file for llsocialpanel
+* @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_LLSOCIALPANEL_H
+#define LL_LLSOCIALPANEL_H
+
+#endif // LL_LLSOCIALPANEL_H
+
-- 
cgit v1.2.3


From 1643c4dacadf6df1cf7d000987a2c570eb4325ac Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 17 Jun 2013 18:30:36 -0700
Subject: CHUI 560: When Me->Post to Facebook... is selected the Facebook
 floater opens.

---
 indra/newview/CMakeLists.txt                       |  4 +--
 indra/newview/llfloatersocial.cpp                  | 35 +++++++++++++++++++
 indra/newview/llfloatersocial.h                    | 40 ++++++++++++++++++++++
 indra/newview/llsocialpanel.cpp                    | 32 -----------------
 indra/newview/llsocialpanel.h                      | 31 -----------------
 indra/newview/llviewerfloaterreg.cpp               |  2 ++
 indra/newview/skins/default/xui/en/menu_viewer.xml |  7 ++++
 7 files changed, 86 insertions(+), 65 deletions(-)
 create mode 100644 indra/newview/llfloatersocial.cpp
 create mode 100644 indra/newview/llfloatersocial.h
 delete mode 100644 indra/newview/llsocialpanel.cpp
 delete mode 100644 indra/newview/llsocialpanel.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 4ab1f227be..b780b55e1e 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -270,6 +270,7 @@ set(viewer_SOURCE_FILES
     llfloatersettingsdebug.cpp
     llfloatersidepanelcontainer.cpp
     llfloatersnapshot.cpp
+    llfloatersocial.cpp
     llfloatersounddevices.cpp
     llfloaterspellchecksettings.cpp
     llfloatertelehub.cpp
@@ -509,7 +510,6 @@ set(viewer_SOURCE_FILES
     llsky.cpp
     llslurl.cpp
     llsociallist.cpp
-    llsocialpanel.cpp
     llspatialpartition.cpp
     llspeakers.cpp
     llspeakingindicatormanager.cpp
@@ -858,6 +858,7 @@ set(viewer_HEADER_FILES
     llfloatersettingsdebug.h
     llfloatersidepanelcontainer.h
     llfloatersnapshot.h
+    llfloatersocial.h
     llfloatersounddevices.h
     llfloaterspellchecksettings.h
     llfloatertelehub.h
@@ -1085,7 +1086,6 @@ set(viewer_HEADER_FILES
     llsky.h
     llslurl.h
     llsociallist.h
-    llsocialpanel.h
     llspatialpartition.h
     llspeakers.h
     llspeakingindicatormanager.h
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
new file mode 100644
index 0000000000..fe9cfa592b
--- /dev/null
+++ b/indra/newview/llfloatersocial.cpp
@@ -0,0 +1,35 @@
+/** 
+* @file llfloatersocial.cpp
+* @brief Implementation of llfloatersocial
+* @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 "llfloatersocial.h"
+
+LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key)
+{
+
+}
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
new file mode 100644
index 0000000000..b120fe5804
--- /dev/null
+++ b/indra/newview/llfloatersocial.h
@@ -0,0 +1,40 @@
+/** 
+* @file   llfloatersocial.h
+* @brief  Header file for llfloatersocial
+* @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_LLFLOATERSOCIAL_H
+#define LL_LLFLOATERSOCIAL_H
+
+#include "llfloater.h"
+
+
+class LLFloaterSocial : public LLFloater
+{
+public:
+	LLFloaterSocial(const LLSD& key);
+};
+
+#endif // LL_LLFLOATERSOCIAL_H
+
diff --git a/indra/newview/llsocialpanel.cpp b/indra/newview/llsocialpanel.cpp
deleted file mode 100644
index 6373c1c560..0000000000
--- a/indra/newview/llsocialpanel.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/** 
-* @file llsocialpanel.cpp
-* @brief Implementation of llsocialpanel
-* @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 "llsocialpanel.h"
-
-
diff --git a/indra/newview/llsocialpanel.h b/indra/newview/llsocialpanel.h
deleted file mode 100644
index 873d93951a..0000000000
--- a/indra/newview/llsocialpanel.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/** 
-* @file   llsocialpanel.h
-* @brief  Header file for llsocialpanel
-* @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_LLSOCIALPANEL_H
-#define LL_LLSOCIALPANEL_H
-
-#endif // LL_LLSOCIALPANEL_H
-
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index c6b28b9e5e..69bda2c11c 100755
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -103,6 +103,7 @@
 #include "llfloatersettingsdebug.h"
 #include "llfloatersidepanelcontainer.h"
 #include "llfloatersnapshot.h"
+#include "llfloatersocial.h"
 #include "llfloatersounddevices.h"
 #include "llfloaterspellchecksettings.h"
 #include "llfloatertelehub.h"
@@ -303,6 +304,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater);
 	LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>);
 	LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundDevices>);
+	LLFloaterReg::add("social", "floater_social.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSocial>);
 	LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>);
 	LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>);
 	LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>);
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index ebf21ffd1c..dea47f350f 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -35,6 +35,13 @@
         <menu_item_call.on_click
           function="Facebook.UpdateStatus" />
       </menu_item_call>
+      <menu_item_call
+        label="Post to Facebook..."
+        name="PostToFacebook">
+        <menu_item_call.on_click
+          function="Floater.Toggle"
+          parameter="social"/>
+      </menu_item_call>      
       <menu_item_separator/>
       <menu_item_call
        label="Appearance..."
-- 
cgit v1.2.3


From 8748fdf77c3b1b1374b436cd7f4f03ce7575e7ba Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 18 Jun 2013 11:00:30 -0700
Subject: CHUI 560: Missed adding floater_social.xml file

---
 indra/newview/skins/default/xui/en/floater_social.xml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/floater_social.xml

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
new file mode 100644
index 0000000000..c9b5d3a4df
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+
+<floater
+  positioning="cascading"
+  can_close="true"
+  can_resize="true"
+  height="570"
+  help_topic="social floater"
+  min_height="220"
+  min_width="260"
+  layout="topleft"
+  name="floater_social"
+  save_rect="true"
+  single_instance="true"
+  reuse_instance="true"
+  title="FACEBOOK"
+  width="370">
+</floater>
-- 
cgit v1.2.3


From 0a119a3dc9d5bf593c375948491728ded8241981 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 18 Jun 2013 17:00:16 -0700
Subject: ACME-561 Create tabs for the status, photo and place

---
 .../skins/default/xui/en/floater_social.xml        | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index c9b5d3a4df..2b730c1a18 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -15,4 +15,62 @@
   reuse_instance="true"
   title="FACEBOOK"
   width="370">
+  <tab_container
+   bottom="-7"
+   follows="all"
+   layout="topleft"
+   left="4"
+   name="tabs"
+   tab_group="1"
+   tab_min_width="70"
+   tab_height="30"
+   tab_position="top"
+   top="4"
+   halign="center"
+   right="-5">
+    <panel
+     background_opaque="true"
+     background_visible="true"
+     bg_alpha_color="DkGray"
+     bg_opaque_color="DkGray"
+     bottom="0"
+     follows="all"
+     label="STATUS"
+     layout="topleft"
+     left="0"
+     help_topic="social_status_tab"
+     name="status_panel"
+     right="0"
+     top="0"/>
+    <panel
+      background_opaque="true"
+      background_visible="true"
+      bg_alpha_color="DkGray"
+      bg_opaque_color="DkGray"
+      bottom="0"
+      follows="all"
+      label="PHOTO"
+      layout="topleft"
+      left="0"
+      help_topic="social_photo_tab"
+      name="photo_panel"
+      right="0"
+      top="0"/>
+    <panel
+      background_opaque="true"
+      background_visible="true"
+      bg_alpha_color="DkGray"
+      bg_opaque_color="DkGray"
+      bottom="0"
+      follows="all"
+      label="PLACE"
+      layout="topleft"
+      left="0"
+      help_topic="social_place_tab"
+      name="place_panel"
+      right="0"
+      top="0"/>
+   </tab_container>
+  
+  
 </floater>
-- 
cgit v1.2.3


From d1d495870ac44ad0358f655357ff0583d60f263f Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 19 Jun 2013 01:36:23 +0100
Subject: updated viewer to use new /friends route for ACME-534

---
 indra/newview/llfacebookconnect.cpp |  2 +-
 indra/newview/llpanelpeople.cpp     | 44 ++-----------------------------------
 2 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 36a40790ec..64fc81cc93 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -309,7 +309,7 @@ void LLFacebookConnect::loadFacebookFriends()
 {
 	const bool follow_redirects=false;
 	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-	LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(),
+	LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(),
 					  LLSD(), timeout, follow_redirects);
 }
 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 27ef40f0df..b6b72800f9 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -873,10 +873,9 @@ void LLPanelPeople::updateSuggestedFriendList()
 
 		//Add suggested friends
 		LLSD friends = LLFacebookConnect::instance().getContent();
-		for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
+		for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
 		{
-			std::string name = i->second["name"].asString();
-			LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
+			LLUUID agent_id = (*i).asUUID();
 			bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false;
 
 			if(!second_life_buddy)
@@ -892,45 +891,6 @@ void LLPanelPeople::updateSuggestedFriendList()
 		//Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
 		mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
 		showFriendsAccordionsIfNeeded();
-
-
-
-		//TODO Gilbert: Below code will eventually be deprecated
-		mFacebookFriends->clear();
-		LLPersonTabModel::tab_type tab_type;
-		LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
-
-		for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
-		{
-			std::string name = i->second["name"].asString();
-			LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL);
-			bool second_life_buddy = agent_id.notNull() ? avatar_tracker.isBuddy(agent_id) : false;
-
-			//add to avatar list
-			mFacebookFriends->addNewItem(agent_id, name, false);
-
-			if(!second_life_buddy)
-			{
-				//FB+SL but not SL friend
-				if (agent_id.notNull())
-				{
-					tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
-				}
-				//FB only friend
-				else
-				{
-					tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-				}
-
-				//Add to person tab model
-				LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
-				if (person_tab_model)
-				{
-					addParticipantToModel(person_tab_model, agent_id, name);
-				}
-			}
-		}
-
 	}
 }
 
-- 
cgit v1.2.3


From a88be82d27dd3226356a71cdda88093490a326c5 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 18 Jun 2013 18:56:17 -0700
Subject: ACME-561 Adjusted the size of the floater to better match spec. Also
 made the floater non-sizable and the tabs spread nearly evenly across. Can
 touch up UI in another iteration and after some feedback.

---
 indra/newview/skins/default/xui/en/floater_social.xml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 2b730c1a18..7814c8e64f 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -3,8 +3,8 @@
 <floater
   positioning="cascading"
   can_close="true"
-  can_resize="true"
-  height="570"
+  can_resize="false"
+  height="470"
   help_topic="social floater"
   min_height="220"
   min_width="260"
@@ -14,15 +14,15 @@
   single_instance="true"
   reuse_instance="true"
   title="FACEBOOK"
-  width="370">
+  width="314">
   <tab_container
-   bottom="-7"
+   bottom="-1"
    follows="all"
    layout="topleft"
    left="4"
    name="tabs"
    tab_group="1"
-   tab_min_width="70"
+   tab_min_width="98"
    tab_height="30"
    tab_position="top"
    top="4"
@@ -33,7 +33,7 @@
      background_visible="true"
      bg_alpha_color="DkGray"
      bg_opaque_color="DkGray"
-     bottom="0"
+     bottom="-1"
      follows="all"
      label="STATUS"
      layout="topleft"
@@ -47,7 +47,7 @@
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
-      bottom="0"
+      bottom="-1"
       follows="all"
       label="PHOTO"
       layout="topleft"
@@ -61,7 +61,7 @@
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
-      bottom="0"
+      bottom="-1"
       follows="all"
       label="PLACE"
       layout="topleft"
-- 
cgit v1.2.3


From f1e594feceb8ab284e023e164d5410cd53a656cb Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 19 Jun 2013 10:18:40 -0700
Subject: ACME-561 Left justified the tabs per UX

---
 indra/newview/skins/default/xui/en/floater_social.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 7814c8e64f..313706dbc0 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -22,7 +22,7 @@
    left="4"
    name="tabs"
    tab_group="1"
-   tab_min_width="98"
+   tab_min_width="70"
    tab_height="30"
    tab_position="top"
    top="4"
-- 
cgit v1.2.3


From 50bb863be1c0e3528fd850aac812fc6196a7c4fc Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 20 Jun 2013 16:39:08 -0700
Subject: ACME-584 Create the panel to contain the image details

---
 .../skins/default/xui/en/floater_social.xml        | 296 ++++++++++++++++++---
 1 file changed, 260 insertions(+), 36 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 313706dbc0..2b382215d1 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -4,73 +4,297 @@
   positioning="cascading"
   can_close="true"
   can_resize="false"
-  height="470"
   help_topic="social floater"
-  min_height="220"
-  min_width="260"
   layout="topleft"
   name="floater_social"
   save_rect="true"
   single_instance="true"
   reuse_instance="true"
   title="FACEBOOK"
-  width="314">
+  height="437"
+  width="304">
   <tab_container
-   bottom="-1"
-   follows="all"
-   layout="topleft"
-   left="4"
    name="tabs"
    tab_group="1"
    tab_min_width="70"
    tab_height="30"
    tab_position="top"
-   top="4"
-   halign="center"
-   right="-5">
+   top="7"
+   height="430"
+   halign="center">
     <panel
      background_opaque="true"
      background_visible="true"
      bg_alpha_color="DkGray"
      bg_opaque_color="DkGray"
-     bottom="-1"
-     follows="all"
      label="STATUS"
-     layout="topleft"
-     left="0"
      help_topic="social_status_tab"
-     name="status_panel"
-     right="0"
-     top="0"/>
+     name="status_panel"/>
     <panel
-      background_opaque="true"
+      follows="all"
+      height="430"
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
-      bottom="-1"
-      follows="all"
       label="PHOTO"
-      layout="topleft"
-      left="0"
       help_topic="social_photo_tab"
-      name="photo_panel"
-      right="0"
-      top="0"/>
+      name="photo_panel">
+      <layout_stack
+       border_size="0"
+       height="422"
+       follows="all"
+       orientation="vertical"
+       name="stack1"
+       top="8">
+        <layout_panel
+         name="photo_panel"
+         height="295">
+          <panel
+            top="0"
+            follows="all"
+            height="295"
+            width="286"
+            left="7"
+            background_opaque="true"
+            background_visible="true"
+            bg_opaque_color="DkGray2"
+            label="SNAPSHOT CONTAINER"
+            help_topic="snapshot_panel"
+            name="snapshot_panel">
+            <combo_box
+             follows="left|top"
+             top="6"
+             left="9"
+             name="resolution_combobox"
+             tool_tip="Image resolution"
+             height="21"
+             width="135">
+              <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="Custom"
+               name="Custom"
+               value="[i-1,i-1]" />
+            </combo_box>
+            <text
+             follows="left|top"
+             font="SansSerifSmall"
+             height="14"
+             left="208"
+             length="1"
+             halign="right"
+             name="file_size_label"
+             top="12"
+             type="string"
+             width="50">
+              1,031 KB
+            </text>
+            <ui_ctrl
+              height="150"
+              width="250"
+              name="thumbnail_placeholder"
+              top_pad="5"
+              follows="left|top"
+              left="9">
+              <panel
+               background_visible="true"
+               bg_alpha_color="0.9 1 0.9 1"
+               follows="left|top"
+               font="SansSerifLarge"
+               halign="center"
+               height="20"
+               left="0"
+               length="1"
+               name="succeeded_panel"
+               right="-1"
+               top="0"
+               type="string"
+               visible="true">
+                <text
+                 follows="all"
+                 font="SansSerif"
+                 halign="center"
+                 height="18"
+                 left="1"
+                 length="1"
+                 name="succeeded_lbl"
+                 right="-1"
+                 text_color="0.2 0.5 0.2 1"
+                 top="4"
+                 translate="false"
+                 type="string">
+                  Succeeded
+                </text>
+              </panel>
+              <panel
+               background_visible="true"
+               bg_alpha_color="1 0.9 0.9 1"
+               follows="left|top"
+               font="SansSerifLarge"
+               halign="center"
+               height="20"
+               left_delta="0"
+               length="1"
+               name="failed_panel"
+               right="-1"
+               top="0"
+               type="string"
+               visible="true">
+                <text
+                 follows="all"
+                 font="SansSerif"
+                 halign="center"
+                 height="18"
+                 left="1"
+                 length="1"
+                 name="failed_lbl"
+                 right="-1"
+                 text_color="0.5 0.2 0.2 1"
+                 top="4"
+                 translate="false"
+                 type="string">
+                  Failed
+                </text>
+              </panel>
+              <loading_indicator
+               follows="left|top"
+               height="48"
+               name="working_indicator"
+               left="101"
+               top="46"
+               visible="true"
+               width="48" />
+              <text
+               follows="left|top|right"
+               font="SansSerifBold"
+               height="14"
+               left="5"
+               length="1"
+               halign="center"
+               name="working_lbl"
+               right="-5"
+               top="98"
+               translate="false"
+               type="string"
+               visible="true"
+               width="130">
+                Working
+              </text>
+              <button
+               follows="left|top"
+               height="22"
+               image_overlay="Refresh_Off"
+               left="6"
+               name="new_snapshot_btn"
+               bottom="-6"
+               visible="true"
+               width="22" />
+              <text
+               follows="left|top"
+               font="SansSerifBold"
+               height="18"
+               left_pad="6"
+               length="1"
+               name="refresh_lbl"
+               text_color="red"
+               top_delta="5"
+               translate="false"
+               type="string"
+               visible="true"
+               width="130">
+                Refresh to save.
+              </text>
+            </ui_ctrl>
+            <text
+             length="1"
+             follows="top|left|right"
+             font="SansSerif"
+             height="16"
+             left="9"
+             name="caption_label"
+             top_pad="12"
+             type="string">
+              Comment (optional):
+            </text>
+            <text_editor
+             follows="left|top"
+             height="47"
+             width="250"
+             left="9"
+             length="1"
+             max_length="700"
+             name="caption"
+             type="string"
+             word_wrap="true">
+            </text_editor>
+            <check_box
+             follows="left|top"
+             initial_value="true"
+             label="Include location in posting"
+             name="add_location_cb"
+             top_pad="19"/>            
+            </panel>
+        </layout_panel>
+        <layout_panel
+          name="button_panel"
+          height="96">
+          <panel
+            height="96"
+            top="0"
+            follows="all"
+            left="7"
+            right="-10"
+            background_opaque="true"
+            background_visible="true"
+            bg_opaque_color="DkGray"
+            label="SNAPSHOT CONTAINER"
+            help_topic="snapshot_container"
+            name="snapshot_container"/>
+          <button
+           follows="left|top"
+           top="15"
+           height="23"
+           label="Post"
+           name="post_btn"
+           width="100">
+            <button.commit_callback
+             function="PostToFacebook.Send" />
+          </button>
+          <button
+               follows="left|top"
+               height="23"
+               label="Cancel"
+               name="cancel_btn"
+               left_pad="15"
+               top_delta="0"
+               width="100">
+            <button.commit_callback
+             function="PostToFacebook.Cancel" />
+          </button>          
+        </layout_panel>        
+      </layout_stack>
+    </panel>
     <panel
       background_opaque="true"
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
-      bottom="-1"
-      follows="all"
       label="PLACE"
-      layout="topleft"
-      left="0"
       help_topic="social_place_tab"
-      name="place_panel"
-      right="0"
-      top="0"/>
-   </tab_container>
-  
-  
+      name="place_panel"/>
+  </tab_container>
 </floater>
-- 
cgit v1.2.3


From 824a5c65f57ae0fa2cce99ade156341fcf8daf5a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 20 Jun 2013 17:58:27 -0700
Subject: ACME-584: Adjusted name of a couple XUI elements.

---
 indra/newview/skins/default/xui/en/floater_social.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 2b382215d1..d446e0c0f6 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -47,7 +47,7 @@
        name="stack1"
        top="8">
         <layout_panel
-         name="photo_panel"
+         name="photo_detail_panel"
          height="295">
           <panel
             top="0"
@@ -58,7 +58,7 @@
             background_opaque="true"
             background_visible="true"
             bg_opaque_color="DkGray2"
-            label="SNAPSHOT CONTAINER"
+            label="snapshot_panel"
             help_topic="snapshot_panel"
             name="snapshot_panel">
             <combo_box
@@ -250,7 +250,7 @@
             </panel>
         </layout_panel>
         <layout_panel
-          name="button_panel"
+          name="photo_button_panel"
           height="96">
           <panel
             height="96"
@@ -261,9 +261,9 @@
             background_opaque="true"
             background_visible="true"
             bg_opaque_color="DkGray"
-            label="SNAPSHOT CONTAINER"
-            help_topic="snapshot_container"
-            name="snapshot_container"/>
+            label="button_container"
+            help_topic="button_container"
+            name="button_container"/>
           <button
            follows="left|top"
            top="15"
-- 
cgit v1.2.3


From ba8bced90b0a3e5126e3274ac4d8a9f611a9ded8 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 21 Jun 2013 12:45:20 -0700
Subject: ACME-588 Make 'Post' button post to facebook: Intial commit is just
 adding callback for clicking the post button

---
 indra/newview/llfloatersocial.cpp                  | 37 ++++++++++++++++++++++
 indra/newview/llfloatersocial.h                    |  7 ++++
 .../skins/default/xui/en/floater_social.xml        |  3 +-
 3 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index fe9cfa592b..0f3a82878b 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -29,7 +29,44 @@
 
 #include "llfloatersocial.h"
 
+#include "llagentui.h"
+#include "llfloaterreg.h"
+#include "llslurl.h"
+
+static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> panel_class("llsocialphotopanel");
+
+LLSocialPhotoPanel::LLSocialPhotoPanel()
+{
+	mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
+}
+
+void LLSocialPhotoPanel::onSend()
+{
+	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
+	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
+
+	if (add_location)
+	{
+		LLSLURL slurl;
+		LLAgentUI::buildSLURL(slurl);
+		if (caption.empty())
+			caption = slurl.getSLURLString();
+		else
+			caption = caption + " " + slurl.getSLURLString();
+	}
+	//LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption);
+	//LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
+	//LLFloaterSnapshot::postSave();
+}
+
+
+
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key)
 {
 
 }
+
+BOOL LLFloaterSocial::postBuild()
+{
+	return LLFloater::postBuild();
+}
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index b120fe5804..e946ce7559 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -29,11 +29,18 @@
 
 #include "llfloater.h"
 
+class LLSocialPhotoPanel : public LLPanel
+{
+	public:
+		LLSocialPhotoPanel();
+		void onSend();
+};
 
 class LLFloaterSocial : public LLFloater
 {
 public:
 	LLFloaterSocial(const LLSD& key);
+	BOOL postBuild();
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index d446e0c0f6..8141961273 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -31,6 +31,7 @@
      help_topic="social_status_tab"
      name="status_panel"/>
     <panel
+      class="llsocialphotopanel"
       follows="all"
       height="430"
       background_visible="true"
@@ -38,7 +39,7 @@
       bg_opaque_color="DkGray"
       label="PHOTO"
       help_topic="social_photo_tab"
-      name="photo_panel">
+      name="social_photo_tab">
       <layout_stack
        border_size="0"
        height="422"
-- 
cgit v1.2.3


From 835ea6dcae7d1394b62efb6a66b948cdd19da6d9 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 22 Jun 2013 01:23:14 +0100
Subject: added text and buttons for update status tab for ACME-568

---
 .../skins/default/xui/en/floater_social.xml        | 46 +++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 8141961273..378841b1a6 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -29,7 +29,51 @@
      bg_opaque_color="DkGray"
      label="STATUS"
      help_topic="social_status_tab"
-     name="status_panel"/>
+     name="status_panel">
+      <text
+        length="1"
+        follows="top|left|right"
+        font="SansSerif"
+        height="16"
+        left="9"
+        name="caption_label"
+        top_pad="12"
+        type="string">
+        What's on your mind?
+      </text>
+      <text_editor
+        follows="left|top"
+        height="47"
+        width="250"
+        left="9"
+        length="1"
+        max_length="700"
+        name="caption"
+        type="string"
+        word_wrap="true">
+      </text_editor>
+      <button
+        follows="left|top"
+        height="23"
+        label="Post"
+        name="post_btn"
+        top_pad="12"
+        width="100">
+        <button.commit_callback
+          function="PostToFacebook.Send" />
+      </button>
+      <button
+        follows="left|top"
+        height="23"
+        label="Cancel"
+        name="cancel_btn"
+        left_pad="15"
+        top_delta="0"
+        width="100">
+        <button.commit_callback
+          function="PostToFacebook.Cancel" />
+      </button>
+    </panel>
     <panel
       class="llsocialphotopanel"
       follows="all"
-- 
cgit v1.2.3


From fc33dadc13c27aee58e4b3e488a9b9078af03d09 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 22 Jun 2013 01:32:15 +0100
Subject: tweaked numbers to look more like mockup for ACME-568

---
 indra/newview/skins/default/xui/en/floater_social.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 378841b1a6..c49749840b 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -37,14 +37,14 @@
         height="16"
         left="9"
         name="caption_label"
-        top_pad="12"
+        top_pad="18"
         type="string">
         What's on your mind?
       </text>
       <text_editor
         follows="left|top"
-        height="47"
-        width="250"
+        height="80"
+        width="280"
         left="9"
         length="1"
         max_length="700"
@@ -57,7 +57,7 @@
         height="23"
         label="Post"
         name="post_btn"
-        top_pad="12"
+        top_pad="18"
         width="100">
         <button.commit_callback
           function="PostToFacebook.Send" />
-- 
cgit v1.2.3


From 9debe1787f966efd6c25ffc43a3a77553aca107a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Sat, 22 Jun 2013 11:49:36 -0700
Subject: ACME-497 : All xml work for the Checkin feature

---
 indra/newview/llfloatersocial.cpp                  |   5 +
 indra/newview/llfloatersocial.h                    |   1 +
 .../skins/default/xui/en/floater_social.xml        | 112 ++++++++++++++++++++-
 3 files changed, 115 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index fe9cfa592b..4a3efe4a2d 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -31,5 +31,10 @@
 
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key)
 {
+	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
+}
 
+void LLFloaterSocial::onCancel()
+{
+    closeFloater();
 }
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index b120fe5804..f65c0dcf5d 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -34,6 +34,7 @@ class LLFloaterSocial : public LLFloater
 {
 public:
 	LLFloaterSocial(const LLSD& key);
+	void onCancel();
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index d446e0c0f6..2909da295d 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -283,18 +283,124 @@
                top_delta="0"
                width="100">
             <button.commit_callback
-             function="PostToFacebook.Cancel" />
+             function="SocialSharing.Cancel" />
           </button>          
         </layout_panel>        
       </layout_stack>
     </panel>
     <panel
-      background_opaque="true"
+      follows="all"
+      height="430"
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
       label="PLACE"
       help_topic="social_place_tab"
-      name="place_panel"/>
+      name="place_panel">
+      <layout_stack
+        border_size="0"
+        height="422"
+        follows="all"
+        orientation="vertical"
+        name="stack_place"
+        top="8">
+        <layout_panel
+          name="place_detail_panel"
+          height="122">
+          <text
+            length="1"
+            follows="top|left|right"
+            font="SansSerif"
+            height="16"
+            left="9"
+            name="place_caption_label"
+            top_pad="12"
+            type="string">
+            Say something about where you are:
+          </text>
+          <text_editor
+            follows="top|left|right"
+            height="94"
+            right="-9"
+            left="9"
+            length="1"
+            max_length="700"
+            name="place_caption"
+            type="string"
+            word_wrap="true">
+           </text_editor>
+          </layout_panel>
+          <layout_panel
+            name="place_map_panel"
+            height="133">
+            <ui_ctrl
+             height="128"
+             width="128"
+             name="map_placeholder"
+             top_pad="5"
+             follows="left|top"
+             left="9">
+             <panel
+               background_visible="true"
+               border_image="Badge_Border"
+               border_color="BadgeBorderColor"
+               bg_alpha_color="0.9 1 0.9 1"
+               follows="left|top"
+               halign="center"
+               height="128"
+               width="128"
+               left="0"
+               top="0"
+               name="map_panel"
+               visible="true"/>
+              </ui_ctrl>
+              <check_box
+                follows="left|top"
+                initial_value="true"
+                top_delta="8"
+                width="8"
+                label=""
+                name="add_place_view_cb"
+                left_pad="5"/>
+              <text
+              follows="left|top"
+              font="SansSerif"
+              height="32"
+              width="130"
+              word_wrap="true"
+              left_pad="12"
+              top_delta="-8"
+              type="string">
+              Include overhead view of location
+              </text>
+            </layout_panel>
+            <layout_panel
+              name="place_button_panel"
+              height="96">
+              <button
+                follows="left|top"
+                top="5"
+                left="9"
+                height="23"
+                label="Post"
+                name="post_place_btn"
+                width="100">
+                <button.commit_callback
+                 function="Facebook.Checkin" />
+               </button>
+               <button
+                 follows="left|top"
+                 height="23"
+                 label="Cancel"
+                 name="cancel_btn"
+                 left_pad="15"
+                 top_delta="0"
+                 width="100">
+                 <button.commit_callback
+                  function="SocialSharing.Cancel" />
+               </button>
+            </layout_panel>
+        </layout_stack>
+    </panel>
   </tab_container>
 </floater>
-- 
cgit v1.2.3


From 27bd181a6d07b191d674870039b2801713c554f1 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Sun, 23 Jun 2013 12:15:21 -0700
Subject: ACME-497 : Working implementation of Checkin though couple of bugs to
 fix and no visible map in the UI

---
 indra/newview/llfloatersocial.cpp                  | 65 +++++++++++++++++++++-
 indra/newview/llfloatersocial.h                    | 10 ++++
 .../skins/default/xui/en/floater_social.xml        |  5 +-
 3 files changed, 77 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index f6fc55927e..cca966bb9a 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -29,11 +29,25 @@
 
 #include "llfloatersocial.h"
 
+#include "llagent.h"
 #include "llagentui.h"
+#include "llfacebookconnect.h"
 #include "llfloaterreg.h"
 #include "llslurl.h"
+#include "llviewerregion.h"
+#include "llviewercontrol.h"
 
-static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> panel_class("llsocialphotopanel");
+static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
+static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
+
+std::string get_map_url()
+{
+    LLVector3d center_agent = gAgent.getRegion()->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;
+}
 
 LLSocialPhotoPanel::LLSocialPhotoPanel()
 {
@@ -60,6 +74,55 @@ void LLSocialPhotoPanel::onSend()
 }
 
 
+LLSocialCheckinPanel::LLSocialCheckinPanel() :
+    mMapUrl("")
+{
+	mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this));
+}
+
+/*virtual*/
+void LLSocialCheckinPanel::setVisible(BOOL visible)
+{
+    if (visible)
+    {
+        mMapUrl = get_map_url();
+    }
+    LLPanel::setVisible(visible);
+}
+
+void LLSocialCheckinPanel::onSend()
+{
+	// Get the location SLURL
+	LLSLURL slurl;
+	LLAgentUI::buildSLURL(slurl);
+	std::string slurl_string = slurl.getSLURLString();
+    
+	// Get the region name
+	std::string region_name = gAgent.getRegion()->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 = getChild<LLUICtrl>("add_place_view_cb")->getValue().asBoolean();
+    std::string map_url = (add_map_view ? mMapUrl : "");
+    
+	// Get the caption
+	std::string caption = getChild<LLUICtrl>("place_caption")->getValue().asString();
+
+    // Post all that to Facebook
+	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
+    
+    // Close the floater once "Post" has been pushed
+	LLFloater* floater = getParentByType<LLFloater>();
+    if (floater)
+    {
+        floater->closeFloater();
+    }
+}
+
 
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key)
 {
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index a8c83fb364..aee7f2f060 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -36,6 +36,16 @@ class LLSocialPhotoPanel : public LLPanel
 		void onSend();
 };
 
+class LLSocialCheckinPanel : public LLPanel
+{
+public:
+    LLSocialCheckinPanel();
+    void onSend();
+	/*virtual*/ void setVisible(BOOL visible);
+private:
+    std::string mMapUrl;
+};
+
 class LLFloaterSocial : public LLFloater
 {
 public:
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index d57bc157cd..f99044b233 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -71,7 +71,7 @@
         top_delta="0"
         width="100">
         <button.commit_callback
-          function="PostToFacebook.Cancel" />
+          function="SocialSharing.Cancel" />
       </button>
     </panel>
     <panel
@@ -334,6 +334,7 @@
       </layout_stack>
     </panel>
     <panel
+      class="llsocialcheckinpanel"
       follows="all"
       height="430"
       background_visible="true"
@@ -431,7 +432,7 @@
                 name="post_place_btn"
                 width="100">
                 <button.commit_callback
-                 function="Facebook.Checkin" />
+                 function="SocialSharing.SendCheckin" />
                </button>
                <button
                  follows="left|top"
-- 
cgit v1.2.3


From 3fa5ac310c9eb3ace9f5eac70e68f7588a846309 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 24 Jun 2013 11:57:19 -0700
Subject: ACME-593 Populate the image with the actual screenshot image: Placed
 LLSnapshotLivePreview class into file llsnapshotlivepreview.h/cpp so that it
 could be utilized by other classes.

---
 indra/newview/CMakeLists.txt            |   2 +
 indra/newview/llfloatersnapshot.cpp     | 938 +-------------------------------
 indra/newview/llsnapshotlivepreview.cpp | 850 +++++++++++++++++++++++++++++
 indra/newview/llsnapshotlivepreview.h   | 214 ++++++++
 4 files changed, 1067 insertions(+), 937 deletions(-)
 create mode 100644 indra/newview/llsnapshotlivepreview.cpp
 create mode 100644 indra/newview/llsnapshotlivepreview.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 01c4b1f50e..a5ad2e4d4e 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -512,6 +512,7 @@ set(viewer_SOURCE_FILES
     llsidetraypanelcontainer.cpp
     llsky.cpp
     llslurl.cpp
+    llsnapshotlivepreview.cpp
     llsociallist.cpp
     llspatialpartition.cpp
     llspeakers.cpp
@@ -1090,6 +1091,7 @@ set(viewer_HEADER_FILES
     llsidetraypanelcontainer.h
     llsky.h
     llslurl.h
+    llsnapshotlivepreview.h
     llsociallist.h
     llspatialpartition.h
     llspeakers.h
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 0703600961..e72de9751e 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -55,6 +55,7 @@
 #include "llviewermenufile.h"	// upload_new_resource()
 #include "llcheckboxctrl.h"
 #include "llslurl.h"
+#include "llsnapshotlivepreview.h"
 #include "lltoolfocus.h"
 #include "lltoolmgr.h"
 #include "llwebsharing.h"
@@ -92,949 +93,12 @@ LLSnapshotFloaterView* gSnapshotFloaterView = NULL;
 
 const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f;
 
-F32 SHINE_TIME = 0.5f;
-F32 SHINE_WIDTH = 0.6f;
-F32 SHINE_OPACITY = 0.3f;
-F32 FALL_TIME = 0.6f;
-S32 BORDER_WIDTH = 6;
-
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
 
 static LLDefaultChildRegistry::Register<LLSnapshotFloaterView> r("snapshot_floater_view");
 
-///----------------------------------------------------------------------------
-/// Class LLSnapshotLivePreview 
-///----------------------------------------------------------------------------
-class LLSnapshotLivePreview : public LLView
-{
-	LOG_CLASS(LLSnapshotLivePreview);
-public:
-	enum ESnapshotType
-	{
-		SNAPSHOT_POSTCARD,
-		SNAPSHOT_TEXTURE,
-		SNAPSHOT_LOCAL,
-		SNAPSHOT_WEB
-	};
-
-
-	struct Params : public LLInitParam::Block<Params, LLView::Params>
-	{
-		Params()
-		{
-			name = "snapshot_live_preview";
-			mouse_opaque = false;
-		}
-	};
-
-
-	LLSnapshotLivePreview(const LLSnapshotLivePreview::Params& p);
-	~LLSnapshotLivePreview();
-
-	/*virtual*/ void draw();
-	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
-	
-	void setSize(S32 w, S32 h);
-	void setWidth(S32 w) { mWidth[mCurImageIndex] = w; }
-	void setHeight(S32 h) { mHeight[mCurImageIndex] = h; }
-	void getSize(S32& w, S32& h) const;
-	S32 getWidth() const { return mWidth[mCurImageIndex]; }
-	S32 getHeight() const { return mHeight[mCurImageIndex]; }
-	S32 getDataSize() const { return mDataSize; }
-	void setMaxImageSize(S32 size) ;
-	S32  getMaxImageSize() {return mMaxImageSize ;}
-	
-	ESnapshotType getSnapshotType() const { return mSnapshotType; }
-	LLFloaterSnapshot::ESnapshotFormat getSnapshotFormat() const { return mSnapshotFormat; }
-	BOOL getSnapshotUpToDate() const { return mSnapshotUpToDate; }
-	BOOL isSnapshotActive() { return mSnapshotActive; }
-	LLViewerTexture* getThumbnailImage() const { return mThumbnailImage ; }
-	S32  getThumbnailWidth() const { return mThumbnailWidth ; }
-	S32  getThumbnailHeight() const { return mThumbnailHeight ; }
-	BOOL getThumbnailLock() const { return mThumbnailUpdateLock ; }
-	BOOL getThumbnailUpToDate() const { return mThumbnailUpToDate ;}
-	LLViewerTexture* getCurrentImage();
-	F32 getImageAspect();
-	F32 getAspect() ;
-	const LLRect& getImageRect() const { return mImageRect[mCurImageIndex]; }
-	BOOL isImageScaled() const { return mImageScaled[mCurImageIndex]; }
-	void setImageScaled(BOOL scaled) { mImageScaled[mCurImageIndex] = scaled; }
-	const LLVector3d& getPosTakenGlobal() const { return mPosTakenGlobal; }
-	
-	void setSnapshotType(ESnapshotType type) { mSnapshotType = type; }
-	void setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat type) { mSnapshotFormat = type; }
-	void setSnapshotQuality(S32 quality);
-	void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; }
-	void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f);
-	void saveWeb();
-	void saveTexture();
-	BOOL saveLocal();
-
-	LLPointer<LLImageFormatted>	getFormattedImage() const { return mFormattedImage; }
-	LLPointer<LLImageRaw>		getEncodedImage() const { return mPreviewImageEncoded; }
-
-	/// Sets size of preview thumbnail image and thhe surrounding rect.
-	BOOL setThumbnailImageSize() ;
-	void generateThumbnailImage(BOOL force_update = FALSE) ;
-	void resetThumbnailImage() { mThumbnailImage = NULL ; }
-	void drawPreviewRect(S32 offset_x, S32 offset_y) ;
-
-	// Returns TRUE when snapshot generated, FALSE otherwise.
-	static BOOL onIdle( void* snapshot_preview );
-
-	// callback for region name resolve
-	void regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z);
-
-private:
-	LLColor4					mColor;
-	LLPointer<LLViewerTexture>	mViewerImage[2]; //used to represent the scene when the frame is frozen.
-	LLRect						mImageRect[2];
-	S32							mWidth[2];
-	S32							mHeight[2];
-	BOOL						mImageScaled[2];
-	S32                         mMaxImageSize ;
-	
-	//thumbnail image
-	LLPointer<LLViewerTexture>	mThumbnailImage ;
-	S32                         mThumbnailWidth ;
-	S32                         mThumbnailHeight ;
-	LLRect                      mPreviewRect ;
-	BOOL                        mThumbnailUpdateLock ;
-	BOOL                        mThumbnailUpToDate ;
-
-	S32							mCurImageIndex;
-	LLPointer<LLImageRaw>		mPreviewImage;
-	LLPointer<LLImageRaw>		mPreviewImageEncoded;
-	LLPointer<LLImageFormatted>	mFormattedImage;
-	LLFrameTimer				mSnapshotDelayTimer;
-	S32							mShineCountdown;
-	LLFrameTimer				mShineAnimTimer;
-	F32							mFlashAlpha;
-	BOOL						mNeedsFlash;
-	LLVector3d					mPosTakenGlobal;
-	S32							mSnapshotQuality;
-	S32							mDataSize;
-	ESnapshotType				mSnapshotType;
-	LLFloaterSnapshot::ESnapshotFormat	mSnapshotFormat;
-	BOOL						mSnapshotUpToDate;
-	LLFrameTimer				mFallAnimTimer;
-	LLVector3					mCameraPos;
-	LLQuaternion				mCameraRot;
-	BOOL						mSnapshotActive;
-	LLViewerWindow::ESnapshotType mSnapshotBufferType;
-
-public:
-	static std::set<LLSnapshotLivePreview*> sList;
-	BOOL                        mKeepAspectRatio ;
-};
-
-std::set<LLSnapshotLivePreview*> LLSnapshotLivePreview::sList;
-
-LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Params& p) 
-:	LLView(p),
-	mColor(1.f, 0.f, 0.f, 0.5f), 
-	mCurImageIndex(0),
-	mPreviewImage(NULL),
-	mThumbnailImage(NULL) ,
-	mThumbnailWidth(0),
-	mThumbnailHeight(0),
-	mPreviewImageEncoded(NULL),
-	mFormattedImage(NULL),
-	mShineCountdown(0),
-	mFlashAlpha(0.f),
-	mNeedsFlash(TRUE),
-	mSnapshotQuality(gSavedSettings.getS32("SnapshotQuality")),
-	mDataSize(0),
-	mSnapshotType(SNAPSHOT_POSTCARD),
-	mSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))),
-	mSnapshotUpToDate(FALSE),
-	mCameraPos(LLViewerCamera::getInstance()->getOrigin()),
-	mCameraRot(LLViewerCamera::getInstance()->getQuaternion()),
-	mSnapshotActive(FALSE),
-	mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR)
-{
-	setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality"));
-	mSnapshotDelayTimer.setTimerExpirySec(0.0f);
-	mSnapshotDelayTimer.start();
-// 	gIdleCallbacks.addFunction( &LLSnapshotLivePreview::onIdle, (void*)this );
-	sList.insert(this);
-	setFollowsAll();
-	mWidth[0] = gViewerWindow->getWindowWidthRaw();
-	mWidth[1] = gViewerWindow->getWindowWidthRaw();
-	mHeight[0] = gViewerWindow->getWindowHeightRaw();
-	mHeight[1] = gViewerWindow->getWindowHeightRaw();
-	mImageScaled[0] = FALSE;
-	mImageScaled[1] = FALSE;
-
-	mMaxImageSize = MAX_SNAPSHOT_IMAGE_SIZE ;
-	mKeepAspectRatio = gSavedSettings.getBOOL("KeepAspectForSnapshot") ;
-	mThumbnailUpdateLock = FALSE ;
-	mThumbnailUpToDate   = FALSE ;
-}
-
-LLSnapshotLivePreview::~LLSnapshotLivePreview()
-{
-	// delete images
-	mPreviewImage = NULL;
-	mPreviewImageEncoded = NULL;
-	mFormattedImage = NULL;
-
-// 	gIdleCallbacks.deleteFunction( &LLSnapshotLivePreview::onIdle, (void*)this );
-	sList.erase(this);
-}
-
-void LLSnapshotLivePreview::setMaxImageSize(S32 size) 
-{
-	if(size < MAX_SNAPSHOT_IMAGE_SIZE)
-	{
-		mMaxImageSize = size;
-	}
-	else
-	{
-		mMaxImageSize = MAX_SNAPSHOT_IMAGE_SIZE ;
-	}
-}
-
-LLViewerTexture* LLSnapshotLivePreview::getCurrentImage()
-{
-	return mViewerImage[mCurImageIndex];
-}
-
-F32 LLSnapshotLivePreview::getAspect()
-{
-	F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
-	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
-
-	if (!mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
-	{
-		return image_aspect_ratio;
-	}
-	else
-	{
-		return window_aspect_ratio;
-	}
-}
-
-F32 LLSnapshotLivePreview::getImageAspect()
-{
-	if (!getCurrentImage())
-	{
-		return 0.f;
-	}
-
-	return getAspect() ;	
-}
-
-void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay) 
-{
-	// Invalidate current image.
-	lldebugs << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << llendl;
-	if (getSnapshotUpToDate())
-	{
-		S32 old_image_index = mCurImageIndex;
-		mCurImageIndex = (mCurImageIndex + 1) % 2; 
-		setSize(mWidth[old_image_index], mHeight[old_image_index]);
-		mFallAnimTimer.start();		
-	}
-	mSnapshotUpToDate = FALSE; 		
-
-	// Update snapshot source rect depending on whether we keep the aspect ratio.
-	LLRect& rect = mImageRect[mCurImageIndex];
-	rect.set(0, getRect().getHeight(), getRect().getWidth(), 0);
-
-	F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
-	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
-
-	if (mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
-	{
-		if (image_aspect_ratio > window_aspect_ratio)
-		{
-			// trim off top and bottom
-			S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio); 
-			rect.mBottom += (getRect().getHeight() - new_height) / 2;
-			rect.mTop -= (getRect().getHeight() - new_height) / 2;
-		}
-		else if (image_aspect_ratio < window_aspect_ratio)
-		{
-			// trim off left and right
-			S32 new_width = llround((F32)getRect().getHeight() * image_aspect_ratio); 
-			rect.mLeft += (getRect().getWidth() - new_width) / 2;
-			rect.mRight -= (getRect().getWidth() - new_width) / 2;
-		}
-	}
-
-	// Stop shining animation.
-	mShineAnimTimer.stop();
-
-	// Update snapshot if requested.
-	if (new_snapshot)
-	{
-		mSnapshotDelayTimer.start();
-		mSnapshotDelayTimer.setTimerExpirySec(delay);
-		LLFloaterSnapshot::preUpdate();
-	}
-
-	// Update thumbnail if requested.
-	if(new_thumbnail)
-	{
-		mThumbnailUpToDate = FALSE ;
-	}
-}
-
-void LLSnapshotLivePreview::setSnapshotQuality(S32 quality)
-{
-	llclamp(quality, 0, 100);
-	if (quality != mSnapshotQuality)
-	{
-		mSnapshotQuality = quality;
-		gSavedSettings.setS32("SnapshotQuality", quality);
-		mSnapshotUpToDate = FALSE;
-	}
-}
-
-void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y)
-{
-	F32 line_width ; 
-	glGetFloatv(GL_LINE_WIDTH, &line_width) ;
-	glLineWidth(2.0f * line_width) ;
-	LLColor4 color(0.0f, 0.0f, 0.0f, 1.0f) ;
-	gl_rect_2d( mPreviewRect.mLeft + offset_x, mPreviewRect.mTop + offset_y,
-				mPreviewRect.mRight + offset_x, mPreviewRect.mBottom + offset_y, color, FALSE ) ;
-	glLineWidth(line_width) ;
-
-	//draw four alpha rectangles to cover areas outside of the snapshot image
-	if(!mKeepAspectRatio)
-	{
-		LLColor4 alpha_color(0.5f, 0.5f, 0.5f, 0.8f) ;
-		S32 dwl = 0, dwr = 0 ;
-		if(mThumbnailWidth > mPreviewRect.getWidth())
-		{
-			dwl = (mThumbnailWidth - mPreviewRect.getWidth()) >> 1 ;
-			dwr = mThumbnailWidth - mPreviewRect.getWidth() - dwl ;
-
-			gl_rect_2d(mPreviewRect.mLeft + offset_x - dwl, mPreviewRect.mTop + offset_y,
-				mPreviewRect.mLeft + offset_x, mPreviewRect.mBottom + offset_y, alpha_color, TRUE ) ;
-			gl_rect_2d( mPreviewRect.mRight + offset_x, mPreviewRect.mTop + offset_y,
-				mPreviewRect.mRight + offset_x + dwr, mPreviewRect.mBottom + offset_y, alpha_color, TRUE ) ;
-		}
-
-		if(mThumbnailHeight > mPreviewRect.getHeight())
-		{
-			S32 dh = (mThumbnailHeight - mPreviewRect.getHeight()) >> 1 ;
-			gl_rect_2d(mPreviewRect.mLeft + offset_x - dwl, mPreviewRect.mBottom + offset_y ,
-				mPreviewRect.mRight + offset_x + dwr, mPreviewRect.mBottom + offset_y - dh, alpha_color, TRUE ) ;
-
-			dh = mThumbnailHeight - mPreviewRect.getHeight() - dh ;
-			gl_rect_2d( mPreviewRect.mLeft + offset_x - dwl, mPreviewRect.mTop + offset_y + dh,
-				mPreviewRect.mRight + offset_x + dwr, mPreviewRect.mTop + offset_y, alpha_color, TRUE ) ;
-		}
-	}
-}
-
-//called when the frame is frozen.
-void LLSnapshotLivePreview::draw()
-{
-	if (getCurrentImage() &&
-	    mPreviewImageEncoded.notNull() &&
-	    getSnapshotUpToDate())
-	{
-		LLColor4 bg_color(0.f, 0.f, 0.3f, 0.4f);
-		gl_rect_2d(getRect(), bg_color);
-		const LLRect& rect = getImageRect();
-		LLRect shadow_rect = rect;
-		shadow_rect.stretch(BORDER_WIDTH);
-		gl_drop_shadow(shadow_rect.mLeft, shadow_rect.mTop, shadow_rect.mRight, shadow_rect.mBottom, LLColor4(0.f, 0.f, 0.f, mNeedsFlash ? 0.f :0.5f), 10);
-
-		LLColor4 image_color(1.f, 1.f, 1.f, 1.f);
-		gGL.color4fv(image_color.mV);
-		gGL.getTexUnit(0)->bind(getCurrentImage());
-		// calculate UV scale
-		F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f);
-		F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f);
-		gGL.pushMatrix();
-		{
-			gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
-			gGL.begin(LLRender::QUADS);
-			{
-				gGL.texCoord2f(uv_width, uv_height);
-				gGL.vertex2i(rect.getWidth(), rect.getHeight() );
-
-				gGL.texCoord2f(0.f, uv_height);
-				gGL.vertex2i(0, rect.getHeight() );
-
-				gGL.texCoord2f(0.f, 0.f);
-				gGL.vertex2i(0, 0);
-
-				gGL.texCoord2f(uv_width, 0.f);
-				gGL.vertex2i(rect.getWidth(), 0);
-			}
-			gGL.end();
-		}
-		gGL.popMatrix();
-
-		gGL.color4f(1.f, 1.f, 1.f, mFlashAlpha);
-		gl_rect_2d(getRect());
-		if (mNeedsFlash)
-		{
-			if (mFlashAlpha < 1.f)
-			{
-				mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f));
-			}
-			else
-			{
-				mNeedsFlash = FALSE;
-			}
-		}
-		else
-		{
-			mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f));
-		}
-
-		// Draw shining animation if appropriate.
-		if (mShineCountdown > 0)
-		{
-			mShineCountdown--;
-			if (mShineCountdown == 0)
-			{
-				mShineAnimTimer.start();
-			}
-		}
-		else if (mShineAnimTimer.getStarted())
-		{
-			lldebugs << "Drawing shining animation" << llendl;
-			F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
-			
-			// draw "shine" effect
-			LLLocalClipRect clip(getLocalRect());
-			{
-				// draw diagonal stripe with gradient that passes over screen
-				S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
-				S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
-				S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
-				S32 y1 = 0;
-				S32 y2 = gViewerWindow->getWindowHeightScaled();
-
-				gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-				gGL.begin(LLRender::QUADS);
-				{
-					gGL.color4f(1.f, 1.f, 1.f, 0.f);
-					gGL.vertex2i(x1, y1);
-					gGL.vertex2i(x1 + gViewerWindow->getWindowWidthScaled(), y2);
-					gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
-					gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
-					gGL.vertex2i(x2, y1);
-
-					gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
-					gGL.vertex2i(x2, y1);
-					gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
-					gGL.color4f(1.f, 1.f, 1.f, 0.f);
-					gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2);
-					gGL.vertex2i(x3, y1);
-				}
-				gGL.end();
-			}
-
-			// if we're at the end of the animation, stop
-			if (shine_interp >= 1.f)
-			{
-				mShineAnimTimer.stop();
-			}
-		}
-	}
-
-	// draw framing rectangle
-	{
-		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-		gGL.color4f(1.f, 1.f, 1.f, 1.f);
-		const LLRect& outline_rect = getImageRect();
-		gGL.begin(LLRender::QUADS);
-		{
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
-
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
-			gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
-			gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-		}
-		gGL.end();
-	}
-
-	// draw old image dropping away
-	if (mFallAnimTimer.getStarted())
-	{
-		S32 old_image_index = (mCurImageIndex + 1) % 2;
-		if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME)
-		{
-			lldebugs << "Drawing fall animation" << llendl;
-			F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME;
-			F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f);
-			LLColor4 image_color(1.f, 1.f, 1.f, alpha);
-			gGL.color4fv(image_color.mV);
-			gGL.getTexUnit(0)->bind(mViewerImage[old_image_index]);
-			// calculate UV scale
-			// *FIX get this to work with old image
-			BOOL rescale = !mImageScaled[old_image_index] && mViewerImage[mCurImageIndex].notNull();
-			F32 uv_width = rescale ? llmin((F32)mWidth[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f) : 1.f;
-			F32 uv_height = rescale ? llmin((F32)mHeight[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f) : 1.f;
-			gGL.pushMatrix();
-			{
-				LLRect& rect = mImageRect[old_image_index];
-				gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
-				gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
-				gGL.begin(LLRender::QUADS);
-				{
-					gGL.texCoord2f(uv_width, uv_height);
-					gGL.vertex2i(rect.getWidth(), rect.getHeight() );
-
-					gGL.texCoord2f(0.f, uv_height);
-					gGL.vertex2i(0, rect.getHeight() );
-
-					gGL.texCoord2f(0.f, 0.f);
-					gGL.vertex2i(0, 0);
-
-					gGL.texCoord2f(uv_width, 0.f);
-					gGL.vertex2i(rect.getWidth(), 0);
-				}
-				gGL.end();
-			}
-			gGL.popMatrix();
-		}
-	}
-}
-
-/*virtual*/ 
-void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_parent)
-{
-	LLRect old_rect = getRect();
-	LLView::reshape(width, height, called_from_parent);
-	if (old_rect.getWidth() != width || old_rect.getHeight() != height)
-	{
-		lldebugs << "window reshaped, updating thumbnail" << llendl;
-		updateSnapshot(FALSE, TRUE);
-	}
-}
 
-BOOL LLSnapshotLivePreview::setThumbnailImageSize()
-{
-	if(getWidth() < 10 || getHeight() < 10)
-	{
-		return FALSE ;
-	}
-	S32 window_width = gViewerWindow->getWindowWidthRaw() ;
-	S32 window_height = gViewerWindow->getWindowHeightRaw() ;
-
-	F32 window_aspect_ratio = ((F32)window_width) / ((F32)window_height);
-
-	// UI size for thumbnail
-	// *FIXME: the rect does not change, so maybe there's no need to recalculate max w/h.
-	const LLRect& thumbnail_rect = LLFloaterSnapshot::getThumbnailPlaceholderRect();
-	S32 max_width = thumbnail_rect.getWidth();
-	S32 max_height = thumbnail_rect.getHeight();
-
-	if (window_aspect_ratio > (F32)max_width / max_height)
-	{
-		// image too wide, shrink to width
-		mThumbnailWidth = max_width;
-		mThumbnailHeight = llround((F32)max_width / window_aspect_ratio);
-	}
-	else
-	{
-		// image too tall, shrink to height
-		mThumbnailHeight = max_height;
-		mThumbnailWidth = llround((F32)max_height * window_aspect_ratio);
-	}
-	
-	if(mThumbnailWidth > window_width || mThumbnailHeight > window_height)
-	{
-		return FALSE ;//if the window is too small, ignore thumbnail updating.
-	}
-
-	S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ;
-	if(!mKeepAspectRatio)
-	{
-		F32 ratio_x = (F32)getWidth() / window_width ;
-		F32 ratio_y = (F32)getHeight() / window_height ;
-
-		//if(getWidth() > window_width ||
-		//	getHeight() > window_height )
-		{
-			if(ratio_x > ratio_y)
-			{
-				top = (S32)(top * ratio_y / ratio_x) ;
-			}
-			else
-			{
-				right = (S32)(right * ratio_x / ratio_y) ;
-			}			
-		}
-		//else
-		//{
-		//	right = (S32)(right * ratio_x) ;
-		//	top = (S32)(top * ratio_y) ;
-		//}
-		left = (S32)((mThumbnailWidth - right) * 0.5f) ;
-		bottom = (S32)((mThumbnailHeight - top) * 0.5f) ;
-		top += bottom ;
-		right += left ;
-	}
-	mPreviewRect.set(left - 1, top + 1, right + 1, bottom - 1) ;
-
-	return TRUE ;
-}
-
-void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
-{	
-	if(mThumbnailUpdateLock) //in the process of updating
-	{
-		return ;
-	}
-	if(getThumbnailUpToDate() && !force_update)//already updated
-	{
-		return ;
-	}
-	if(getWidth() < 10 || getHeight() < 10)
-	{
-		return ;
-	}
-
-	////lock updating
-	mThumbnailUpdateLock = TRUE ;
-
-	if(!setThumbnailImageSize())
-	{
-		mThumbnailUpdateLock = FALSE ;
-		mThumbnailUpToDate = TRUE ;
-		return ;
-	}
-
-	if(mThumbnailImage)
-	{
-		resetThumbnailImage() ;
-	}		
-
-	LLPointer<LLImageRaw> raw = new LLImageRaw;
-	if(!gViewerWindow->thumbnailSnapshot(raw,
-							mThumbnailWidth, mThumbnailHeight,
-							gSavedSettings.getBOOL("RenderUIInSnapshot"),
-							FALSE,
-							mSnapshotBufferType) )								
-	{
-		raw = NULL ;
-	}
-
-	if(raw)
-	{
-		raw->expandToPowerOfTwo();
-		mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); 		
-		mThumbnailUpToDate = TRUE ;
-	}
-
-	//unlock updating
-	mThumbnailUpdateLock = FALSE ;		
-}
-
-
-// Called often. Checks whether it's time to grab a new snapshot and if so, does it.
-// Returns TRUE if new snapshot generated, FALSE otherwise.
-//static 
-BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
-{
-	LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview;
-	if (previewp->getWidth() == 0 || previewp->getHeight() == 0)
-	{
-		llwarns << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << llendl;
-		return FALSE;
-	}
-
-	// If we're in freeze-frame mode and camera has moved, update snapshot.
-	LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin();
-	LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion();
-	if (gSavedSettings.getBOOL("FreezeTime") && 
-		(new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f))
-	{
-		previewp->mCameraPos = new_camera_pos;
-		previewp->mCameraRot = new_camera_rot;
-		// request a new snapshot whenever the camera moves, with a time delay
-		BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot");
-		lldebugs << "camera moved, updating thumbnail" << llendl;
-		previewp->updateSnapshot(
-			autosnap, // whether a new snapshot is needed or merely invalidate the existing one
-			FALSE, // or if 1st arg is false, whether to produce a new thumbnail image.
-			autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); // shutter delay if 1st arg is true.
-	}
-
-	// see if it's time yet to snap the shot and bomb out otherwise.
-	previewp->mSnapshotActive = 
-		(previewp->mSnapshotDelayTimer.getStarted() &&	previewp->mSnapshotDelayTimer.hasExpired())
-		&& !LLToolCamera::getInstance()->hasMouseCapture(); // don't take snapshots while ALT-zoom active
-	if ( ! previewp->mSnapshotActive)
-	{
-		return FALSE;
-	}
-
-	// time to produce a snapshot
-	previewp->setThumbnailImageSize();
-
-	lldebugs << "producing snapshot" << llendl;
-	if (!previewp->mPreviewImage)
-	{
-		previewp->mPreviewImage = new LLImageRaw;
-	}
-
-	if (!previewp->mPreviewImageEncoded)
-	{
-		previewp->mPreviewImageEncoded = new LLImageRaw;
-	}
-
-	previewp->setVisible(FALSE);
-	previewp->setEnabled(FALSE);
-	
-	previewp->getWindow()->incBusyCount();
-	previewp->setImageScaled(FALSE);
-
-	// grab the raw image and encode it into desired format
-	if(gViewerWindow->rawSnapshot(
-							previewp->mPreviewImage,
-							previewp->getWidth(),
-							previewp->getHeight(),
-							previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
-							previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE,
-							gSavedSettings.getBOOL("RenderUIInSnapshot"),
-							FALSE,
-							previewp->mSnapshotBufferType,
-							previewp->getMaxImageSize()))
-	{
-		previewp->mPreviewImageEncoded->resize(
-			previewp->mPreviewImage->getWidth(), 
-			previewp->mPreviewImage->getHeight(), 
-			previewp->mPreviewImage->getComponents());
-
-		if(previewp->getSnapshotType() == SNAPSHOT_TEXTURE)
-		{
-			lldebugs << "Encoding new image of format J2C" << llendl;
-			LLPointer<LLImageJ2C> formatted = new LLImageJ2C;
-			LLPointer<LLImageRaw> scaled = new LLImageRaw(
-				previewp->mPreviewImage->getData(),
-				previewp->mPreviewImage->getWidth(),
-				previewp->mPreviewImage->getHeight(),
-				previewp->mPreviewImage->getComponents());
-		
-			scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
-			previewp->setImageScaled(TRUE);
-			if (formatted->encode(scaled, 0.f))
-			{
-				previewp->mDataSize = formatted->getDataSize();
-				formatted->decode(previewp->mPreviewImageEncoded, 0);
-			}
-		}
-		else
-		{
-			// delete any existing image
-			previewp->mFormattedImage = NULL;
-			// now create the new one of the appropriate format.
-			LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotFormat();
-			lldebugs << "Encoding new image of format " << format << llendl;
-
-			switch(format)
-			{
-			case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
-				previewp->mFormattedImage = new LLImagePNG(); 
-				break;
-			case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
-				previewp->mFormattedImage = new LLImageJPEG(previewp->mSnapshotQuality); 
-				break;
-			case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
-				previewp->mFormattedImage = new LLImageBMP(); 
-				break;
-			}
-			if (previewp->mFormattedImage->encode(previewp->mPreviewImage, 0))
-			{
-				previewp->mDataSize = previewp->mFormattedImage->getDataSize();
-				// special case BMP to copy instead of decode otherwise decode will crash.
-				if(format == LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP)
-				{
-					previewp->mPreviewImageEncoded->copy(previewp->mPreviewImage);
-				}
-				else
-				{
-					previewp->mFormattedImage->decode(previewp->mPreviewImageEncoded, 0);
-				}
-			}
-		}
-
-		LLPointer<LLImageRaw> scaled = new LLImageRaw(
-			previewp->mPreviewImageEncoded->getData(),
-			previewp->mPreviewImageEncoded->getWidth(),
-			previewp->mPreviewImageEncoded->getHeight(),
-			previewp->mPreviewImageEncoded->getComponents());
-		
-		if(!scaled->isBufferInvalid())
-		{
-			// leave original image dimensions, just scale up texture buffer
-			if (previewp->mPreviewImageEncoded->getWidth() > 1024 || previewp->mPreviewImageEncoded->getHeight() > 1024)
-			{
-				// go ahead and shrink image to appropriate power of 2 for display
-				scaled->biasedScaleToPowerOfTwo(1024);
-				previewp->setImageScaled(TRUE);
-			}
-			else
-			{
-				// expand image but keep original image data intact
-				scaled->expandToPowerOfTwo(1024, FALSE);
-			}
-
-			previewp->mViewerImage[previewp->mCurImageIndex] = LLViewerTextureManager::getLocalTexture(scaled.get(), FALSE);
-			LLPointer<LLViewerTexture> curr_preview_image = previewp->mViewerImage[previewp->mCurImageIndex];
-			gGL.getTexUnit(0)->bind(curr_preview_image);
-			if (previewp->getSnapshotType() != SNAPSHOT_TEXTURE)
-			{
-				curr_preview_image->setFilteringOption(LLTexUnit::TFO_POINT);
-			}
-			else
-			{
-				curr_preview_image->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
-			}
-			curr_preview_image->setAddressMode(LLTexUnit::TAM_CLAMP);
-
-			previewp->mSnapshotUpToDate = TRUE;
-			previewp->generateThumbnailImage(TRUE) ;
-
-			previewp->mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal();
-			previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
-		}
-	}
-	previewp->getWindow()->decBusyCount();
-	// only show fullscreen preview when in freeze frame mode
-	previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame"));
-	previewp->mSnapshotDelayTimer.stop();
-	previewp->mSnapshotActive = FALSE;
-
-	if(!previewp->getThumbnailUpToDate())
-	{
-		previewp->generateThumbnailImage() ;
-	}
-	lldebugs << "done creating snapshot" << llendl;
-	LLFloaterSnapshot::postUpdate();
-
-	return TRUE;
-}
-
-void LLSnapshotLivePreview::setSize(S32 w, S32 h)
-{
-	lldebugs << "setSize(" << w << ", " << h << ")" << llendl;
-	setWidth(w);
-	setHeight(h);
-}
-
-void LLSnapshotLivePreview::getSize(S32& w, S32& h) const
-{
-	w = getWidth();
-	h = getHeight();
-}
-
-void LLSnapshotLivePreview::saveTexture()
-{
-	lldebugs << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << llendl;
-	// gen a new uuid for this asset
-	LLTransactionID tid;
-	tid.generate();
-	LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
-		
-	LLPointer<LLImageJ2C> formatted = new LLImageJ2C;
-	LLPointer<LLImageRaw> scaled = new LLImageRaw(mPreviewImage->getData(),
-												  mPreviewImage->getWidth(),
-												  mPreviewImage->getHeight(),
-												  mPreviewImage->getComponents());
-	
-	scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
-	lldebugs << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << llendl;
-
-	if (formatted->encode(scaled, 0.0f))
-	{
-		LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE);
-		std::string pos_string;
-		LLAgentUI::buildLocationString(pos_string, LLAgentUI::LOCATION_FORMAT_FULL);
-		std::string who_took_it;
-		LLAgentUI::buildFullname(who_took_it);
-		LLAssetStorage::LLStoreAssetCallback callback = NULL;
-		S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
-		void *userdata = NULL;
-		upload_new_resource(tid,	// tid
-				    LLAssetType::AT_TEXTURE,
-				    "Snapshot : " + pos_string,
-				    "Taken by " + who_took_it + " at " + pos_string,
-				    0,
-				    LLFolderType::FT_SNAPSHOT_CATEGORY,
-				    LLInventoryType::IT_SNAPSHOT,
-				    PERM_ALL,  // Note: Snapshots to inventory is a special case of content upload
-				    LLFloaterPerms::getGroupPerms(), // that is more permissive than other uploads
-				    LLFloaterPerms::getEveryonePerms(),
-				    "Snapshot : " + pos_string,
-				    callback, expected_upload_cost, userdata);
-		gViewerWindow->playSnapshotAnimAndSound();
-	}
-	else
-	{
-		LLNotificationsUtil::add("ErrorEncodingSnapshot");
-		llwarns << "Error encoding snapshot" << llendl;
-	}
-
-	LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT );
-	
-	mDataSize = 0;
-}
-
-BOOL LLSnapshotLivePreview::saveLocal()
-{
-	BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
-
-	if(success)
-	{
-		gViewerWindow->playSnapshotAnimAndSound();
-	}
-	return success;
-}
-
-void LLSnapshotLivePreview::saveWeb()
-{
-	// *FIX: Will break if the window closes because of CloseSnapshotOnKeep!
-	// Needs to pass on ownership of the image.
-	LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get());
-	if(!jpg)
-	{
-		llwarns << "Formatted image not a JPEG" << llendl;
-		return;
-	}
-
-	LLSD metadata;
-	metadata["description"] = getChild<LLLineEditor>("description")->getText();
-
-	LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(),
-		boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4));
-
-	gViewerWindow->playSnapshotAnimAndSound();
-}
-
-void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z)
-{
-	metadata["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString();
-
-	LLWebSharing::instance().shareSnapshot(snapshot, metadata);
-}
 
 ///----------------------------------------------------------------------------
 /// Class LLFloaterSnapshot::Impl
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
new file mode 100644
index 0000000000..5dab804c71
--- /dev/null
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -0,0 +1,850 @@
+/** 
+* @file llsnapshotlivepreview.cpp
+* @brief Implementation of llsnapshotlivepreview
+* @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 "llsnapshotlivepreview.h"
+
+
+
+const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f;
+
+F32 SHINE_TIME = 0.5f;
+F32 SHINE_WIDTH = 0.6f;
+F32 SHINE_OPACITY = 0.3f;
+F32 FALL_TIME = 0.6f;
+S32 BORDER_WIDTH = 6;
+
+const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
+const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
+
+std::set<LLSnapshotLivePreview*> LLSnapshotLivePreview::sList;
+
+LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Params& p) 
+	:	LLView(p),
+	mColor(1.f, 0.f, 0.f, 0.5f), 
+	mCurImageIndex(0),
+	mPreviewImage(NULL),
+	mThumbnailImage(NULL) ,
+	mThumbnailWidth(0),
+	mThumbnailHeight(0),
+	mPreviewImageEncoded(NULL),
+	mFormattedImage(NULL),
+	mShineCountdown(0),
+	mFlashAlpha(0.f),
+	mNeedsFlash(TRUE),
+	mSnapshotQuality(gSavedSettings.getS32("SnapshotQuality")),
+	mDataSize(0),
+	mSnapshotType(SNAPSHOT_POSTCARD),
+	mSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))),
+	mSnapshotUpToDate(FALSE),
+	mCameraPos(LLViewerCamera::getInstance()->getOrigin()),
+	mCameraRot(LLViewerCamera::getInstance()->getQuaternion()),
+	mSnapshotActive(FALSE),
+	mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR)
+{
+	setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality"));
+	mSnapshotDelayTimer.setTimerExpirySec(0.0f);
+	mSnapshotDelayTimer.start();
+	// 	gIdleCallbacks.addFunction( &LLSnapshotLivePreview::onIdle, (void*)this );
+	sList.insert(this);
+	setFollowsAll();
+	mWidth[0] = gViewerWindow->getWindowWidthRaw();
+	mWidth[1] = gViewerWindow->getWindowWidthRaw();
+	mHeight[0] = gViewerWindow->getWindowHeightRaw();
+	mHeight[1] = gViewerWindow->getWindowHeightRaw();
+	mImageScaled[0] = FALSE;
+	mImageScaled[1] = FALSE;
+
+	mMaxImageSize = MAX_SNAPSHOT_IMAGE_SIZE ;
+	mKeepAspectRatio = gSavedSettings.getBOOL("KeepAspectForSnapshot") ;
+	mThumbnailUpdateLock = FALSE ;
+	mThumbnailUpToDate   = FALSE ;
+}
+
+LLSnapshotLivePreview::~LLSnapshotLivePreview()
+{
+	// delete images
+	mPreviewImage = NULL;
+	mPreviewImageEncoded = NULL;
+	mFormattedImage = NULL;
+
+	// 	gIdleCallbacks.deleteFunction( &LLSnapshotLivePreview::onIdle, (void*)this );
+	sList.erase(this);
+}
+
+void LLSnapshotLivePreview::setMaxImageSize(S32 size) 
+{
+	if(size < MAX_SNAPSHOT_IMAGE_SIZE)
+	{
+		mMaxImageSize = size;
+	}
+	else
+	{
+		mMaxImageSize = MAX_SNAPSHOT_IMAGE_SIZE ;
+	}
+}
+
+LLViewerTexture* LLSnapshotLivePreview::getCurrentImage()
+{
+	return mViewerImage[mCurImageIndex];
+}
+
+F32 LLSnapshotLivePreview::getAspect()
+{
+	F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
+	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
+
+	if (!mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
+	{
+		return image_aspect_ratio;
+	}
+	else
+	{
+		return window_aspect_ratio;
+	}
+}
+
+F32 LLSnapshotLivePreview::getImageAspect()
+{
+	if (!getCurrentImage())
+	{
+		return 0.f;
+	}
+
+	return getAspect() ;	
+}
+
+void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay) 
+{
+	// Invalidate current image.
+	lldebugs << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << llendl;
+	if (getSnapshotUpToDate())
+	{
+		S32 old_image_index = mCurImageIndex;
+		mCurImageIndex = (mCurImageIndex + 1) % 2; 
+		setSize(mWidth[old_image_index], mHeight[old_image_index]);
+		mFallAnimTimer.start();		
+	}
+	mSnapshotUpToDate = FALSE; 		
+
+	// Update snapshot source rect depending on whether we keep the aspect ratio.
+	LLRect& rect = mImageRect[mCurImageIndex];
+	rect.set(0, getRect().getHeight(), getRect().getWidth(), 0);
+
+	F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
+	F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
+
+	if (mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
+	{
+		if (image_aspect_ratio > window_aspect_ratio)
+		{
+			// trim off top and bottom
+			S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio); 
+			rect.mBottom += (getRect().getHeight() - new_height) / 2;
+			rect.mTop -= (getRect().getHeight() - new_height) / 2;
+		}
+		else if (image_aspect_ratio < window_aspect_ratio)
+		{
+			// trim off left and right
+			S32 new_width = llround((F32)getRect().getHeight() * image_aspect_ratio); 
+			rect.mLeft += (getRect().getWidth() - new_width) / 2;
+			rect.mRight -= (getRect().getWidth() - new_width) / 2;
+		}
+	}
+
+	// Stop shining animation.
+	mShineAnimTimer.stop();
+
+	// Update snapshot if requested.
+	if (new_snapshot)
+	{
+		mSnapshotDelayTimer.start();
+		mSnapshotDelayTimer.setTimerExpirySec(delay);
+		LLFloaterSnapshot::preUpdate();
+	}
+
+	// Update thumbnail if requested.
+	if(new_thumbnail)
+	{
+		mThumbnailUpToDate = FALSE ;
+	}
+}
+
+void LLSnapshotLivePreview::setSnapshotQuality(S32 quality)
+{
+	llclamp(quality, 0, 100);
+	if (quality != mSnapshotQuality)
+	{
+		mSnapshotQuality = quality;
+		gSavedSettings.setS32("SnapshotQuality", quality);
+		mSnapshotUpToDate = FALSE;
+	}
+}
+
+void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y)
+{
+	F32 line_width ; 
+	glGetFloatv(GL_LINE_WIDTH, &line_width) ;
+	glLineWidth(2.0f * line_width) ;
+	LLColor4 color(0.0f, 0.0f, 0.0f, 1.0f) ;
+	gl_rect_2d( mPreviewRect.mLeft + offset_x, mPreviewRect.mTop + offset_y,
+		mPreviewRect.mRight + offset_x, mPreviewRect.mBottom + offset_y, color, FALSE ) ;
+	glLineWidth(line_width) ;
+
+	//draw four alpha rectangles to cover areas outside of the snapshot image
+	if(!mKeepAspectRatio)
+	{
+		LLColor4 alpha_color(0.5f, 0.5f, 0.5f, 0.8f) ;
+		S32 dwl = 0, dwr = 0 ;
+		if(mThumbnailWidth > mPreviewRect.getWidth())
+		{
+			dwl = (mThumbnailWidth - mPreviewRect.getWidth()) >> 1 ;
+			dwr = mThumbnailWidth - mPreviewRect.getWidth() - dwl ;
+
+			gl_rect_2d(mPreviewRect.mLeft + offset_x - dwl, mPreviewRect.mTop + offset_y,
+				mPreviewRect.mLeft + offset_x, mPreviewRect.mBottom + offset_y, alpha_color, TRUE ) ;
+			gl_rect_2d( mPreviewRect.mRight + offset_x, mPreviewRect.mTop + offset_y,
+				mPreviewRect.mRight + offset_x + dwr, mPreviewRect.mBottom + offset_y, alpha_color, TRUE ) ;
+		}
+
+		if(mThumbnailHeight > mPreviewRect.getHeight())
+		{
+			S32 dh = (mThumbnailHeight - mPreviewRect.getHeight()) >> 1 ;
+			gl_rect_2d(mPreviewRect.mLeft + offset_x - dwl, mPreviewRect.mBottom + offset_y ,
+				mPreviewRect.mRight + offset_x + dwr, mPreviewRect.mBottom + offset_y - dh, alpha_color, TRUE ) ;
+
+			dh = mThumbnailHeight - mPreviewRect.getHeight() - dh ;
+			gl_rect_2d( mPreviewRect.mLeft + offset_x - dwl, mPreviewRect.mTop + offset_y + dh,
+				mPreviewRect.mRight + offset_x + dwr, mPreviewRect.mTop + offset_y, alpha_color, TRUE ) ;
+		}
+	}
+}
+
+//called when the frame is frozen.
+void LLSnapshotLivePreview::draw()
+{
+	if (getCurrentImage() &&
+		mPreviewImageEncoded.notNull() &&
+		getSnapshotUpToDate())
+	{
+		LLColor4 bg_color(0.f, 0.f, 0.3f, 0.4f);
+		gl_rect_2d(getRect(), bg_color);
+		const LLRect& rect = getImageRect();
+		LLRect shadow_rect = rect;
+		shadow_rect.stretch(BORDER_WIDTH);
+		gl_drop_shadow(shadow_rect.mLeft, shadow_rect.mTop, shadow_rect.mRight, shadow_rect.mBottom, LLColor4(0.f, 0.f, 0.f, mNeedsFlash ? 0.f :0.5f), 10);
+
+		LLColor4 image_color(1.f, 1.f, 1.f, 1.f);
+		gGL.color4fv(image_color.mV);
+		gGL.getTexUnit(0)->bind(getCurrentImage());
+		// calculate UV scale
+		F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f);
+		F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f);
+		gGL.pushMatrix();
+		{
+			gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
+			gGL.begin(LLRender::QUADS);
+			{
+				gGL.texCoord2f(uv_width, uv_height);
+				gGL.vertex2i(rect.getWidth(), rect.getHeight() );
+
+				gGL.texCoord2f(0.f, uv_height);
+				gGL.vertex2i(0, rect.getHeight() );
+
+				gGL.texCoord2f(0.f, 0.f);
+				gGL.vertex2i(0, 0);
+
+				gGL.texCoord2f(uv_width, 0.f);
+				gGL.vertex2i(rect.getWidth(), 0);
+			}
+			gGL.end();
+		}
+		gGL.popMatrix();
+
+		gGL.color4f(1.f, 1.f, 1.f, mFlashAlpha);
+		gl_rect_2d(getRect());
+		if (mNeedsFlash)
+		{
+			if (mFlashAlpha < 1.f)
+			{
+				mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f));
+			}
+			else
+			{
+				mNeedsFlash = FALSE;
+			}
+		}
+		else
+		{
+			mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f));
+		}
+
+		// Draw shining animation if appropriate.
+		if (mShineCountdown > 0)
+		{
+			mShineCountdown--;
+			if (mShineCountdown == 0)
+			{
+				mShineAnimTimer.start();
+			}
+		}
+		else if (mShineAnimTimer.getStarted())
+		{
+			lldebugs << "Drawing shining animation" << llendl;
+			F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
+
+			// draw "shine" effect
+			LLLocalClipRect clip(getLocalRect());
+			{
+				// draw diagonal stripe with gradient that passes over screen
+				S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
+				S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
+				S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
+				S32 y1 = 0;
+				S32 y2 = gViewerWindow->getWindowHeightScaled();
+
+				gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+				gGL.begin(LLRender::QUADS);
+				{
+					gGL.color4f(1.f, 1.f, 1.f, 0.f);
+					gGL.vertex2i(x1, y1);
+					gGL.vertex2i(x1 + gViewerWindow->getWindowWidthScaled(), y2);
+					gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
+					gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
+					gGL.vertex2i(x2, y1);
+
+					gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
+					gGL.vertex2i(x2, y1);
+					gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
+					gGL.color4f(1.f, 1.f, 1.f, 0.f);
+					gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2);
+					gGL.vertex2i(x3, y1);
+				}
+				gGL.end();
+			}
+
+			// if we're at the end of the animation, stop
+			if (shine_interp >= 1.f)
+			{
+				mShineAnimTimer.stop();
+			}
+		}
+	}
+
+	// draw framing rectangle
+	{
+		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+		gGL.color4f(1.f, 1.f, 1.f, 1.f);
+		const LLRect& outline_rect = getImageRect();
+		gGL.begin(LLRender::QUADS);
+		{
+			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
+			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
+			gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
+			gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
+
+			gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
+			gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
+			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
+			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
+
+			gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
+			gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
+			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
+			gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
+
+			gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
+			gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
+			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
+			gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
+		}
+		gGL.end();
+	}
+
+	// draw old image dropping away
+	if (mFallAnimTimer.getStarted())
+	{
+		S32 old_image_index = (mCurImageIndex + 1) % 2;
+		if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME)
+		{
+			lldebugs << "Drawing fall animation" << llendl;
+			F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME;
+			F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f);
+			LLColor4 image_color(1.f, 1.f, 1.f, alpha);
+			gGL.color4fv(image_color.mV);
+			gGL.getTexUnit(0)->bind(mViewerImage[old_image_index]);
+			// calculate UV scale
+			// *FIX get this to work with old image
+			BOOL rescale = !mImageScaled[old_image_index] && mViewerImage[mCurImageIndex].notNull();
+			F32 uv_width = rescale ? llmin((F32)mWidth[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f) : 1.f;
+			F32 uv_height = rescale ? llmin((F32)mHeight[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f) : 1.f;
+			gGL.pushMatrix();
+			{
+				LLRect& rect = mImageRect[old_image_index];
+				gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
+				gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
+				gGL.begin(LLRender::QUADS);
+				{
+					gGL.texCoord2f(uv_width, uv_height);
+					gGL.vertex2i(rect.getWidth(), rect.getHeight() );
+
+					gGL.texCoord2f(0.f, uv_height);
+					gGL.vertex2i(0, rect.getHeight() );
+
+					gGL.texCoord2f(0.f, 0.f);
+					gGL.vertex2i(0, 0);
+
+					gGL.texCoord2f(uv_width, 0.f);
+					gGL.vertex2i(rect.getWidth(), 0);
+				}
+				gGL.end();
+			}
+			gGL.popMatrix();
+		}
+	}
+}
+
+/*virtual*/ 
+void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+	LLRect old_rect = getRect();
+	LLView::reshape(width, height, called_from_parent);
+	if (old_rect.getWidth() != width || old_rect.getHeight() != height)
+	{
+		lldebugs << "window reshaped, updating thumbnail" << llendl;
+		updateSnapshot(FALSE, TRUE);
+	}
+}
+
+BOOL LLSnapshotLivePreview::setThumbnailImageSize()
+{
+	if(getWidth() < 10 || getHeight() < 10)
+	{
+		return FALSE ;
+	}
+	S32 window_width = gViewerWindow->getWindowWidthRaw() ;
+	S32 window_height = gViewerWindow->getWindowHeightRaw() ;
+
+	F32 window_aspect_ratio = ((F32)window_width) / ((F32)window_height);
+
+	// UI size for thumbnail
+	// *FIXME: the rect does not change, so maybe there's no need to recalculate max w/h.
+	const LLRect& thumbnail_rect = LLFloaterSnapshot::getThumbnailPlaceholderRect();
+	S32 max_width = thumbnail_rect.getWidth();
+	S32 max_height = thumbnail_rect.getHeight();
+
+	if (window_aspect_ratio > (F32)max_width / max_height)
+	{
+		// image too wide, shrink to width
+		mThumbnailWidth = max_width;
+		mThumbnailHeight = llround((F32)max_width / window_aspect_ratio);
+	}
+	else
+	{
+		// image too tall, shrink to height
+		mThumbnailHeight = max_height;
+		mThumbnailWidth = llround((F32)max_height * window_aspect_ratio);
+	}
+
+	if(mThumbnailWidth > window_width || mThumbnailHeight > window_height)
+	{
+		return FALSE ;//if the window is too small, ignore thumbnail updating.
+	}
+
+	S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ;
+	if(!mKeepAspectRatio)
+	{
+		F32 ratio_x = (F32)getWidth() / window_width ;
+		F32 ratio_y = (F32)getHeight() / window_height ;
+
+		//if(getWidth() > window_width ||
+		//	getHeight() > window_height )
+		{
+			if(ratio_x > ratio_y)
+			{
+				top = (S32)(top * ratio_y / ratio_x) ;
+			}
+			else
+			{
+				right = (S32)(right * ratio_x / ratio_y) ;
+			}			
+		}
+		//else
+		//{
+		//	right = (S32)(right * ratio_x) ;
+		//	top = (S32)(top * ratio_y) ;
+		//}
+		left = (S32)((mThumbnailWidth - right) * 0.5f) ;
+		bottom = (S32)((mThumbnailHeight - top) * 0.5f) ;
+		top += bottom ;
+		right += left ;
+	}
+	mPreviewRect.set(left - 1, top + 1, right + 1, bottom - 1) ;
+
+	return TRUE ;
+}
+
+void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
+{	
+	if(mThumbnailUpdateLock) //in the process of updating
+	{
+		return ;
+	}
+	if(getThumbnailUpToDate() && !force_update)//already updated
+	{
+		return ;
+	}
+	if(getWidth() < 10 || getHeight() < 10)
+	{
+		return ;
+	}
+
+	////lock updating
+	mThumbnailUpdateLock = TRUE ;
+
+	if(!setThumbnailImageSize())
+	{
+		mThumbnailUpdateLock = FALSE ;
+		mThumbnailUpToDate = TRUE ;
+		return ;
+	}
+
+	if(mThumbnailImage)
+	{
+		resetThumbnailImage() ;
+	}		
+
+	LLPointer<LLImageRaw> raw = new LLImageRaw;
+	if(!gViewerWindow->thumbnailSnapshot(raw,
+		mThumbnailWidth, mThumbnailHeight,
+		gSavedSettings.getBOOL("RenderUIInSnapshot"),
+		FALSE,
+		mSnapshotBufferType) )								
+	{
+		raw = NULL ;
+	}
+
+	if(raw)
+	{
+		raw->expandToPowerOfTwo();
+		mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); 		
+		mThumbnailUpToDate = TRUE ;
+	}
+
+	//unlock updating
+	mThumbnailUpdateLock = FALSE ;		
+}
+
+
+// Called often. Checks whether it's time to grab a new snapshot and if so, does it.
+// Returns TRUE if new snapshot generated, FALSE otherwise.
+//static 
+BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
+{
+	LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview;
+	if (previewp->getWidth() == 0 || previewp->getHeight() == 0)
+	{
+		llwarns << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << llendl;
+		return FALSE;
+	}
+
+	// If we're in freeze-frame mode and camera has moved, update snapshot.
+	LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin();
+	LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion();
+	if (gSavedSettings.getBOOL("FreezeTime") && 
+		(new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f))
+	{
+		previewp->mCameraPos = new_camera_pos;
+		previewp->mCameraRot = new_camera_rot;
+		// request a new snapshot whenever the camera moves, with a time delay
+		BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot");
+		lldebugs << "camera moved, updating thumbnail" << llendl;
+		previewp->updateSnapshot(
+			autosnap, // whether a new snapshot is needed or merely invalidate the existing one
+			FALSE, // or if 1st arg is false, whether to produce a new thumbnail image.
+			autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); // shutter delay if 1st arg is true.
+	}
+
+	// see if it's time yet to snap the shot and bomb out otherwise.
+	previewp->mSnapshotActive = 
+		(previewp->mSnapshotDelayTimer.getStarted() &&	previewp->mSnapshotDelayTimer.hasExpired())
+		&& !LLToolCamera::getInstance()->hasMouseCapture(); // don't take snapshots while ALT-zoom active
+	if ( ! previewp->mSnapshotActive)
+	{
+		return FALSE;
+	}
+
+	// time to produce a snapshot
+	previewp->setThumbnailImageSize();
+
+	lldebugs << "producing snapshot" << llendl;
+	if (!previewp->mPreviewImage)
+	{
+		previewp->mPreviewImage = new LLImageRaw;
+	}
+
+	if (!previewp->mPreviewImageEncoded)
+	{
+		previewp->mPreviewImageEncoded = new LLImageRaw;
+	}
+
+	previewp->setVisible(FALSE);
+	previewp->setEnabled(FALSE);
+
+	previewp->getWindow()->incBusyCount();
+	previewp->setImageScaled(FALSE);
+
+	// grab the raw image and encode it into desired format
+	if(gViewerWindow->rawSnapshot(
+		previewp->mPreviewImage,
+		previewp->getWidth(),
+		previewp->getHeight(),
+		previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
+		previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE,
+		gSavedSettings.getBOOL("RenderUIInSnapshot"),
+		FALSE,
+		previewp->mSnapshotBufferType,
+		previewp->getMaxImageSize()))
+	{
+		previewp->mPreviewImageEncoded->resize(
+			previewp->mPreviewImage->getWidth(), 
+			previewp->mPreviewImage->getHeight(), 
+			previewp->mPreviewImage->getComponents());
+
+		if(previewp->getSnapshotType() == SNAPSHOT_TEXTURE)
+		{
+			lldebugs << "Encoding new image of format J2C" << llendl;
+			LLPointer<LLImageJ2C> formatted = new LLImageJ2C;
+			LLPointer<LLImageRaw> scaled = new LLImageRaw(
+				previewp->mPreviewImage->getData(),
+				previewp->mPreviewImage->getWidth(),
+				previewp->mPreviewImage->getHeight(),
+				previewp->mPreviewImage->getComponents());
+
+			scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
+			previewp->setImageScaled(TRUE);
+			if (formatted->encode(scaled, 0.f))
+			{
+				previewp->mDataSize = formatted->getDataSize();
+				formatted->decode(previewp->mPreviewImageEncoded, 0);
+			}
+		}
+		else
+		{
+			// delete any existing image
+			previewp->mFormattedImage = NULL;
+			// now create the new one of the appropriate format.
+			LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotFormat();
+			lldebugs << "Encoding new image of format " << format << llendl;
+
+			switch(format)
+			{
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
+				previewp->mFormattedImage = new LLImagePNG(); 
+				break;
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
+				previewp->mFormattedImage = new LLImageJPEG(previewp->mSnapshotQuality); 
+				break;
+			case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
+				previewp->mFormattedImage = new LLImageBMP(); 
+				break;
+			}
+			if (previewp->mFormattedImage->encode(previewp->mPreviewImage, 0))
+			{
+				previewp->mDataSize = previewp->mFormattedImage->getDataSize();
+				// special case BMP to copy instead of decode otherwise decode will crash.
+				if(format == LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP)
+				{
+					previewp->mPreviewImageEncoded->copy(previewp->mPreviewImage);
+				}
+				else
+				{
+					previewp->mFormattedImage->decode(previewp->mPreviewImageEncoded, 0);
+				}
+			}
+		}
+
+		LLPointer<LLImageRaw> scaled = new LLImageRaw(
+			previewp->mPreviewImageEncoded->getData(),
+			previewp->mPreviewImageEncoded->getWidth(),
+			previewp->mPreviewImageEncoded->getHeight(),
+			previewp->mPreviewImageEncoded->getComponents());
+
+		if(!scaled->isBufferInvalid())
+		{
+			// leave original image dimensions, just scale up texture buffer
+			if (previewp->mPreviewImageEncoded->getWidth() > 1024 || previewp->mPreviewImageEncoded->getHeight() > 1024)
+			{
+				// go ahead and shrink image to appropriate power of 2 for display
+				scaled->biasedScaleToPowerOfTwo(1024);
+				previewp->setImageScaled(TRUE);
+			}
+			else
+			{
+				// expand image but keep original image data intact
+				scaled->expandToPowerOfTwo(1024, FALSE);
+			}
+
+			previewp->mViewerImage[previewp->mCurImageIndex] = LLViewerTextureManager::getLocalTexture(scaled.get(), FALSE);
+			LLPointer<LLViewerTexture> curr_preview_image = previewp->mViewerImage[previewp->mCurImageIndex];
+			gGL.getTexUnit(0)->bind(curr_preview_image);
+			if (previewp->getSnapshotType() != SNAPSHOT_TEXTURE)
+			{
+				curr_preview_image->setFilteringOption(LLTexUnit::TFO_POINT);
+			}
+			else
+			{
+				curr_preview_image->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
+			}
+			curr_preview_image->setAddressMode(LLTexUnit::TAM_CLAMP);
+
+			previewp->mSnapshotUpToDate = TRUE;
+			previewp->generateThumbnailImage(TRUE) ;
+
+			previewp->mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal();
+			previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
+		}
+	}
+	previewp->getWindow()->decBusyCount();
+	// only show fullscreen preview when in freeze frame mode
+	previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame"));
+	previewp->mSnapshotDelayTimer.stop();
+	previewp->mSnapshotActive = FALSE;
+
+	if(!previewp->getThumbnailUpToDate())
+	{
+		previewp->generateThumbnailImage() ;
+	}
+	lldebugs << "done creating snapshot" << llendl;
+	LLFloaterSnapshot::postUpdate();
+
+	return TRUE;
+}
+
+void LLSnapshotLivePreview::setSize(S32 w, S32 h)
+{
+	lldebugs << "setSize(" << w << ", " << h << ")" << llendl;
+	setWidth(w);
+	setHeight(h);
+}
+
+void LLSnapshotLivePreview::getSize(S32& w, S32& h) const
+{
+	w = getWidth();
+	h = getHeight();
+}
+
+void LLSnapshotLivePreview::saveTexture()
+{
+	lldebugs << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << llendl;
+	// gen a new uuid for this asset
+	LLTransactionID tid;
+	tid.generate();
+	LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
+
+	LLPointer<LLImageJ2C> formatted = new LLImageJ2C;
+	LLPointer<LLImageRaw> scaled = new LLImageRaw(mPreviewImage->getData(),
+		mPreviewImage->getWidth(),
+		mPreviewImage->getHeight(),
+		mPreviewImage->getComponents());
+
+	scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
+	lldebugs << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << llendl;
+
+	if (formatted->encode(scaled, 0.0f))
+	{
+		LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE);
+		std::string pos_string;
+		LLAgentUI::buildLocationString(pos_string, LLAgentUI::LOCATION_FORMAT_FULL);
+		std::string who_took_it;
+		LLAgentUI::buildFullname(who_took_it);
+		LLAssetStorage::LLStoreAssetCallback callback = NULL;
+		S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+		void *userdata = NULL;
+		upload_new_resource(tid,	// tid
+			LLAssetType::AT_TEXTURE,
+			"Snapshot : " + pos_string,
+			"Taken by " + who_took_it + " at " + pos_string,
+			0,
+			LLFolderType::FT_SNAPSHOT_CATEGORY,
+			LLInventoryType::IT_SNAPSHOT,
+			PERM_ALL,  // Note: Snapshots to inventory is a special case of content upload
+			LLFloaterPerms::getGroupPerms(), // that is more permissive than other uploads
+			LLFloaterPerms::getEveryonePerms(),
+			"Snapshot : " + pos_string,
+			callback, expected_upload_cost, userdata);
+		gViewerWindow->playSnapshotAnimAndSound();
+	}
+	else
+	{
+		LLNotificationsUtil::add("ErrorEncodingSnapshot");
+		llwarns << "Error encoding snapshot" << llendl;
+	}
+
+	LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT );
+
+	mDataSize = 0;
+}
+
+BOOL LLSnapshotLivePreview::saveLocal()
+{
+	BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
+
+	if(success)
+	{
+		gViewerWindow->playSnapshotAnimAndSound();
+	}
+	return success;
+}
+
+void LLSnapshotLivePreview::saveWeb()
+{
+	// *FIX: Will break if the window closes because of CloseSnapshotOnKeep!
+	// Needs to pass on ownership of the image.
+	LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get());
+	if(!jpg)
+	{
+		llwarns << "Formatted image not a JPEG" << llendl;
+		return;
+	}
+
+	LLSD metadata;
+	metadata["description"] = getChild<LLLineEditor>("description")->getText();
+
+	LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(),
+		boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4));
+
+	gViewerWindow->playSnapshotAnimAndSound();
+}
+
+void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z)
+{
+	metadata["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString();
+
+	LLWebSharing::instance().shareSnapshot(snapshot, metadata);
+}
diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h
new file mode 100644
index 0000000000..52cd87ea9f
--- /dev/null
+++ b/indra/newview/llsnapshotlivepreview.h
@@ -0,0 +1,214 @@
+/** 
+* @file   llsnapshotlivepreview.h
+* @brief  Header file for llsnapshotlivepreview
+* @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_LLSNAPSHOTLIVEPREVIEW_H
+#define LL_LLSNAPSHOTLIVEPREVIEW_H
+
+#include "llfloaterreg.h"
+
+// Viewer includes
+#include "llagent.h"
+#include "llagentcamera.h"
+#include "llcallbacklist.h"
+#include "llcriticaldamp.h"
+#include "llfloaterperms.h"
+#include "llui.h"
+#include "llfacebookconnect.h"
+#include "llfocusmgr.h"
+#include "llbutton.h"
+#include "llcombobox.h"
+#include "lleconomy.h"
+#include "lllandmarkactions.h"
+#include "llpanelsnapshot.h"
+#include "llsidetraypanelcontainer.h"
+#include "llsliderctrl.h"
+#include "llspinctrl.h"
+#include "llviewercontrol.h"
+#include "lluictrlfactory.h"
+#include "llviewerstats.h"
+#include "llviewercamera.h"
+#include "llviewerwindow.h"
+#include "llviewermenufile.h"	// upload_new_resource()
+#include "llcheckboxctrl.h"
+#include "llslurl.h"
+#include "lltoolfocus.h"
+#include "lltoolmgr.h"
+#include "llwebsharing.h"
+#include "llworld.h"
+#include "llagentui.h"
+
+// Linden library includes
+#include "llfontgl.h"
+#include "llsys.h"
+#include "llrender.h"
+#include "v3dmath.h"
+#include "llmath.h"
+#include "lldir.h"
+#include "llsdserialize.h"
+#include "llgl.h"
+#include "llglheaders.h"
+#include "llimagejpeg.h"
+#include "llimagepng.h"
+#include "llimagebmp.h"
+#include "llimagej2c.h"
+#include "lllocalcliprect.h"
+#include "llnotificationsutil.h"
+#include "llpostcard.h"
+#include "llresmgr.h"		// LLLocale
+#include "llvfile.h"
+#include "llvfs.h"
+#include "llwebprofile.h"
+#include "llwindow.h"
+
+
+///----------------------------------------------------------------------------
+/// Class LLSnapshotLivePreview 
+///----------------------------------------------------------------------------
+class LLSnapshotLivePreview : public LLView
+{
+	LOG_CLASS(LLSnapshotLivePreview);
+public:
+	enum ESnapshotType
+	{
+		SNAPSHOT_POSTCARD,
+		SNAPSHOT_TEXTURE,
+		SNAPSHOT_LOCAL,
+		SNAPSHOT_WEB
+	};
+
+
+	struct Params : public LLInitParam::Block<Params, LLView::Params>
+	{
+		Params()
+		{
+			name = "snapshot_live_preview";
+			mouse_opaque = false;
+		}
+	};
+
+
+	LLSnapshotLivePreview(const LLSnapshotLivePreview::Params& p);
+	~LLSnapshotLivePreview();
+
+	/*virtual*/ void draw();
+	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
+
+	void setSize(S32 w, S32 h);
+	void setWidth(S32 w) { mWidth[mCurImageIndex] = w; }
+	void setHeight(S32 h) { mHeight[mCurImageIndex] = h; }
+	void getSize(S32& w, S32& h) const;
+	S32 getWidth() const { return mWidth[mCurImageIndex]; }
+	S32 getHeight() const { return mHeight[mCurImageIndex]; }
+	S32 getDataSize() const { return mDataSize; }
+	void setMaxImageSize(S32 size) ;
+	S32  getMaxImageSize() {return mMaxImageSize ;}
+
+	ESnapshotType getSnapshotType() const { return mSnapshotType; }
+	LLFloaterSnapshot::ESnapshotFormat getSnapshotFormat() const { return mSnapshotFormat; }
+	BOOL getSnapshotUpToDate() const { return mSnapshotUpToDate; }
+	BOOL isSnapshotActive() { return mSnapshotActive; }
+	LLViewerTexture* getThumbnailImage() const { return mThumbnailImage ; }
+	S32  getThumbnailWidth() const { return mThumbnailWidth ; }
+	S32  getThumbnailHeight() const { return mThumbnailHeight ; }
+	BOOL getThumbnailLock() const { return mThumbnailUpdateLock ; }
+	BOOL getThumbnailUpToDate() const { return mThumbnailUpToDate ;}
+	LLViewerTexture* getCurrentImage();
+	F32 getImageAspect();
+	F32 getAspect() ;
+	const LLRect& getImageRect() const { return mImageRect[mCurImageIndex]; }
+	BOOL isImageScaled() const { return mImageScaled[mCurImageIndex]; }
+	void setImageScaled(BOOL scaled) { mImageScaled[mCurImageIndex] = scaled; }
+	const LLVector3d& getPosTakenGlobal() const { return mPosTakenGlobal; }
+
+	void setSnapshotType(ESnapshotType type) { mSnapshotType = type; }
+	void setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat type) { mSnapshotFormat = type; }
+	void setSnapshotQuality(S32 quality);
+	void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; }
+	void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f);
+	void saveWeb();
+	void saveTexture();
+	BOOL saveLocal();
+
+	LLPointer<LLImageFormatted>	getFormattedImage() const { return mFormattedImage; }
+	LLPointer<LLImageRaw>		getEncodedImage() const { return mPreviewImageEncoded; }
+
+	/// Sets size of preview thumbnail image and thhe surrounding rect.
+	BOOL setThumbnailImageSize() ;
+	void generateThumbnailImage(BOOL force_update = FALSE) ;
+	void resetThumbnailImage() { mThumbnailImage = NULL ; }
+	void drawPreviewRect(S32 offset_x, S32 offset_y) ;
+
+	// Returns TRUE when snapshot generated, FALSE otherwise.
+	static BOOL onIdle( void* snapshot_preview );
+
+	// callback for region name resolve
+	void regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z);
+
+private:
+	LLColor4					mColor;
+	LLPointer<LLViewerTexture>	mViewerImage[2]; //used to represent the scene when the frame is frozen.
+	LLRect						mImageRect[2];
+	S32							mWidth[2];
+	S32							mHeight[2];
+	BOOL						mImageScaled[2];
+	S32                         mMaxImageSize ;
+
+	//thumbnail image
+	LLPointer<LLViewerTexture>	mThumbnailImage ;
+	S32                         mThumbnailWidth ;
+	S32                         mThumbnailHeight ;
+	LLRect                      mPreviewRect ;
+	BOOL                        mThumbnailUpdateLock ;
+	BOOL                        mThumbnailUpToDate ;
+
+	S32							mCurImageIndex;
+	LLPointer<LLImageRaw>		mPreviewImage;
+	LLPointer<LLImageRaw>		mPreviewImageEncoded;
+	LLPointer<LLImageFormatted>	mFormattedImage;
+	LLFrameTimer				mSnapshotDelayTimer;
+	S32							mShineCountdown;
+	LLFrameTimer				mShineAnimTimer;
+	F32							mFlashAlpha;
+	BOOL						mNeedsFlash;
+	LLVector3d					mPosTakenGlobal;
+	S32							mSnapshotQuality;
+	S32							mDataSize;
+	ESnapshotType				mSnapshotType;
+	LLFloaterSnapshot::ESnapshotFormat	mSnapshotFormat;
+	BOOL						mSnapshotUpToDate;
+	LLFrameTimer				mFallAnimTimer;
+	LLVector3					mCameraPos;
+	LLQuaternion				mCameraRot;
+	BOOL						mSnapshotActive;
+	LLViewerWindow::ESnapshotType mSnapshotBufferType;
+
+public:
+	static std::set<LLSnapshotLivePreview*> sList;
+	BOOL                        mKeepAspectRatio ;
+};
+
+#endif // LL_LLSNAPSHOTLIVEPREVIEW_H
+
-- 
cgit v1.2.3


From 37fcb81c4ab8806a52ef747e6a3047fff2d6eccf Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 24 Jun 2013 13:32:13 -0700
Subject: ACME-497 : Clean up the xml code for checkin to use a proper icon
 widget and add a decent default image for it

---
 indra/newview/llfloatersocial.cpp                  |   7 +-
 .../default/textures/icons/map_placeholder.jpg     | Bin 0 -> 15526 bytes
 indra/newview/skins/default/textures/textures.xml  |   2 +
 .../skins/default/xui/en/floater_social.xml        | 103 +++++++++------------
 4 files changed, 53 insertions(+), 59 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.jpg

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index cca966bb9a..361d54f696 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -42,7 +42,11 @@ static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsoci
 
 std::string get_map_url()
 {
-    LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal();
+    LLVector3d center_agent;
+    if (gAgent.getRegion())
+    {
+        center_agent = gAgent.getRegion()->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);
@@ -104,7 +108,6 @@ void LLSocialCheckinPanel::onSend()
 	std::string description;
 	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
     
-    
 	// Optionally add the region map view
 	bool add_map_view = getChild<LLUICtrl>("add_place_view_cb")->getValue().asBoolean();
     std::string map_url = (add_map_view ? mMapUrl : "");
diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg
new file mode 100644
index 0000000000..89f4eb88df
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/map_placeholder.jpg differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 64f7103ccc..731bbe8994 100755
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -325,6 +325,8 @@ with the same filename but different name
 
   <texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" />
 
+  <texture name="Map_Placeholder_Icon" file_name="icons/map_placeholder.jpg" preload="true" />
+    
   <texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" />
   <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" />
 
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index f99044b233..fc26ba5842 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -379,36 +379,25 @@
           <layout_panel
             name="place_map_panel"
             height="133">
-            <ui_ctrl
-             height="128"
-             width="128"
-             name="map_placeholder"
-             top_pad="5"
-             follows="left|top"
-             left="9">
-             <panel
-               background_visible="true"
-               border_image="Badge_Border"
-               border_color="BadgeBorderColor"
-               bg_alpha_color="0.9 1 0.9 1"
-               follows="left|top"
-               halign="center"
-               height="128"
-               width="128"
-               left="0"
-               top="0"
-               name="map_panel"
-               visible="true"/>
-              </ui_ctrl>
-              <check_box
-                follows="left|top"
-                initial_value="true"
-                top_delta="8"
-                width="8"
-                label=""
-                name="add_place_view_cb"
-                left_pad="5"/>
-              <text
+            <icon
+              follows="left|top"
+              height="128"
+              width="128"
+              image_name="Map_Placeholder_Icon"
+              layout="topleft"
+              top="5"
+              left="9"
+              name="map_placeholder">
+            </icon>
+            <check_box
+              follows="left|top"
+              initial_value="true"
+              top_delta="8"
+              width="8"
+              label=""
+              name="add_place_view_cb"
+              left_pad="5"/>
+            <text
               follows="left|top"
               font="SansSerif"
               height="32"
@@ -418,35 +407,35 @@
               top_delta="-8"
               type="string">
               Include overhead view of location
-              </text>
-            </layout_panel>
-            <layout_panel
-              name="place_button_panel"
-              height="96">
-              <button
-                follows="left|top"
-                top="5"
-                left="9"
-                height="23"
-                label="Post"
-                name="post_place_btn"
-                width="100">
-                <button.commit_callback
+            </text>
+          </layout_panel>
+          <layout_panel
+            name="place_button_panel"
+            height="96">
+            <button
+              follows="left|top"
+              top="5"
+              left="9"
+              height="23"
+              label="Post"
+              name="post_place_btn"
+              width="100">
+              <button.commit_callback
                  function="SocialSharing.SendCheckin" />
-               </button>
-               <button
-                 follows="left|top"
-                 height="23"
-                 label="Cancel"
-                 name="cancel_btn"
-                 left_pad="15"
-                 top_delta="0"
-                 width="100">
-                 <button.commit_callback
+            </button>
+            <button
+              follows="left|top"
+              height="23"
+              label="Cancel"
+              name="cancel_btn"
+              left_pad="15"
+              top_delta="0"
+              width="100">
+              <button.commit_callback
                   function="SocialSharing.Cancel" />
-               </button>
-            </layout_panel>
-        </layout_stack>
+            </button>
+        </layout_panel>
+     </layout_stack>
     </panel>
   </tab_container>
 </floater>
-- 
cgit v1.2.3


From 68fa34965daa5bd65aea5cb1f4dc4554e7d9f70f Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 25 Jun 2013 00:26:10 +0100
Subject: made status update actually post to Facebook, for ACME-569 and
 ACME-573

---
 indra/newview/llfloatersocial.cpp                     | 18 ++++++++++++++++++
 indra/newview/llfloatersocial.h                       |  7 +++++++
 indra/newview/skins/default/xui/en/floater_social.xml |  5 +++--
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 361d54f696..dd4f4f03d9 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -37,6 +37,7 @@
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
 
+static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel");
 static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
 static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
 
@@ -53,6 +54,23 @@ std::string get_map_url()
     return map_url;
 }
 
+LLSocialStatusPanel::LLSocialStatusPanel()
+{
+	mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this));
+}
+
+void LLSocialStatusPanel::onSend()
+{
+	std::string message = getChild<LLUICtrl>("message")->getValue().asString();
+	LLFacebookConnect::instance().updateStatus(message);
+	
+	LLFloater* floater = getParentByType<LLFloater>();
+    if (floater)
+    {
+        floater->closeFloater();
+    }
+}
+
 LLSocialPhotoPanel::LLSocialPhotoPanel()
 {
 	mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index aee7f2f060..561aefa111 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -29,6 +29,13 @@
 
 #include "llfloater.h"
 
+class LLSocialStatusPanel : public LLPanel
+{
+public:
+    LLSocialStatusPanel();
+    void onSend();
+};
+
 class LLSocialPhotoPanel : public LLPanel
 {
 	public:
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index fc26ba5842..15e105f67d 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -23,6 +23,7 @@
    height="430"
    halign="center">
     <panel
+     class="llsocialstatuspanel"
      background_opaque="true"
      background_visible="true"
      bg_alpha_color="DkGray"
@@ -48,7 +49,7 @@
         left="9"
         length="1"
         max_length="700"
-        name="caption"
+        name="message"
         type="string"
         word_wrap="true">
       </text_editor>
@@ -60,7 +61,7 @@
         top_pad="18"
         width="100">
         <button.commit_callback
-          function="PostToFacebook.Send" />
+          function="SocialSharing.SendStatus" />
       </button>
       <button
         follows="left|top"
-- 
cgit v1.2.3


From e2a7280918665222db3357a4d7566dbdc5d959f2 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 24 Jun 2013 17:01:10 -0700
Subject: ACME-582 : Checkin feature: Implement the loading and displaying of
 map tiles in the LLIconCtrl

---
 indra/newview/llfloatersocial.cpp                  |  51 +++++++++++++++------
 indra/newview/llfloatersocial.h                    |  10 ++--
 .../default/textures/icons/map_placeholder.jpg     | Bin 15526 -> 25641 bytes
 3 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 361d54f696..b14098eb77 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -33,6 +33,7 @@
 #include "llagentui.h"
 #include "llfacebookconnect.h"
 #include "llfloaterreg.h"
+#include "lliconctrl.h"
 #include "llslurl.h"
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
@@ -78,22 +79,11 @@ void LLSocialPhotoPanel::onSend()
 }
 
 
-LLSocialCheckinPanel::LLSocialCheckinPanel() :
-    mMapUrl("")
+LLSocialCheckinPanel::LLSocialCheckinPanel()
 {
 	mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this));
 }
 
-/*virtual*/
-void LLSocialCheckinPanel::setVisible(BOOL visible)
-{
-    if (visible)
-    {
-        mMapUrl = get_map_url();
-    }
-    LLPanel::setVisible(visible);
-}
-
 void LLSocialCheckinPanel::onSend()
 {
 	// Get the location SLURL
@@ -110,7 +100,7 @@ void LLSocialCheckinPanel::onSend()
     
 	// Optionally add the region map view
 	bool add_map_view = getChild<LLUICtrl>("add_place_view_cb")->getValue().asBoolean();
-    std::string map_url = (add_map_view ? mMapUrl : "");
+    std::string map_url = (add_map_view ? get_map_url() : "");
     
 	// Get the caption
 	std::string caption = getChild<LLUICtrl>("place_caption")->getValue().asString();
@@ -127,7 +117,9 @@ void LLSocialCheckinPanel::onSend()
 }
 
 
-LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key)
+LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
+    mMapUrl(""),
+    mReloadingMapTexture(false)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
 }
@@ -139,5 +131,36 @@ void LLFloaterSocial::onCancel()
 
 BOOL LLFloaterSocial::postBuild()
 {
+    // Keep a pointer to the map tile placeholder texture
+    mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder")->getImage();
 	return LLFloater::postBuild();
 }
+
+/*virtual*/
+void LLFloaterSocial::draw()
+{
+    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 back the "loading" placeholder in the map widget
+        getChild<LLIconCtrl>("map_placeholder")->setImage(mMapPlaceholder);
+    }
+    // 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);
+        // Point map widget to correct map tile
+        getChild<LLIconCtrl>("map_placeholder")->setImage(ui_image);
+    }
+    LLFloater::draw();
+}
+
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index aee7f2f060..2f3ff3ccdc 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -28,6 +28,7 @@
 #define LL_LLFLOATERSOCIAL_H
 
 #include "llfloater.h"
+#include "llviewertexture.h"
 
 class LLSocialPhotoPanel : public LLPanel
 {
@@ -41,9 +42,6 @@ class LLSocialCheckinPanel : public LLPanel
 public:
     LLSocialCheckinPanel();
     void onSend();
-	/*virtual*/ void setVisible(BOOL visible);
-private:
-    std::string mMapUrl;
 };
 
 class LLFloaterSocial : public LLFloater
@@ -52,6 +50,12 @@ public:
 	LLFloaterSocial(const LLSD& key);
 	BOOL postBuild();
 	void onCancel();
+	/*virtual*/ void draw();
+private:
+    std::string mMapUrl;
+    LLPointer<LLViewerFetchedTexture> mMapTexture;
+	LLPointer<LLUIImage> mMapPlaceholder;
+    bool mReloadingMapTexture;
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg
index 89f4eb88df..0cb86c58d3 100644
Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and b/indra/newview/skins/default/textures/icons/map_placeholder.jpg differ
-- 
cgit v1.2.3


From 48cc41a0f8b7b2473e938b1cac8cd294b71d40f7 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 24 Jun 2013 17:33:10 -0700
Subject: ACME-593: Now the photo tab of the facebook panel displays a
 screenshot based upon when the facebook floater was opened.

---
 indra/newview/llfloatersnapshot.cpp                |  10 +-
 indra/newview/llfloatersocial.cpp                  | 138 ++++++++++++++++++++-
 indra/newview/llfloatersocial.h                    |  24 +++-
 indra/newview/llsnapshotlivepreview.cpp            |   2 +-
 indra/newview/llsnapshotlivepreview.h              |   2 +
 .../skins/default/xui/en/floater_social.xml        |  34 ++---
 6 files changed, 188 insertions(+), 22 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index e72de9751e..65934aa82a 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -38,6 +38,7 @@
 #include "llfloaterperms.h"
 #include "llui.h"
 #include "llfacebookconnect.h"
+#include "llfloatersocial.h"
 #include "llfocusmgr.h"
 #include "llbutton.h"
 #include "llcombobox.h"
@@ -1136,6 +1137,9 @@ BOOL LLFloaterSnapshot::postBuild()
 	impl.updateControls(this);
 	impl.updateLayout(this);
 	
+
+	previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
+
 	return TRUE;
 }
 
@@ -1301,7 +1305,9 @@ S32 LLFloaterSnapshot::notify(const LLSD& info)
 void LLFloaterSnapshot::update()
 {
 	LLFloaterSnapshot* inst = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
-	if (!inst)
+	LLFloaterSocial* floater_social  = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social"); 
+
+	if (!inst && !floater_social)
 		return;
 	
 	BOOL changed = FALSE;
@@ -1320,7 +1326,7 @@ void LLFloaterSnapshot::update()
         changed = true;
     }
     
-	if (changed)
+	if (inst && changed)
 	{
 		lldebugs << "changed" << llendl;
 		inst->impl.updateControls(inst);
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index cca966bb9a..9a63a7de78 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -49,11 +49,131 @@ std::string get_map_url()
     return map_url;
 }
 
-LLSocialPhotoPanel::LLSocialPhotoPanel()
+LLSocialPhotoPanel::LLSocialPhotoPanel() :
+mRefreshBtn(NULL),
+mRefreshLabel(NULL),
+mSucceessLblPanel(NULL),
+mFailureLblPanel(NULL),
+mThumbnailPlaceholder(NULL)
 {
 	mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
 }
 
+
+
+LLSocialPhotoPanel::~LLSocialPhotoPanel()
+{
+	if(mPreviewHandle.get())
+	{
+		mPreviewHandle.get()->die();
+	}
+}
+
+BOOL LLSocialPhotoPanel::postBuild()
+{
+	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
+	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
+	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
+	mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
+	mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
+	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
+
+	LLRect full_screen_rect = getRootView()->getRect();
+	LLSnapshotLivePreview::Params p;
+	p.rect(full_screen_rect);
+	LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
+	mPreviewHandle = previewp->getHandle();	
+
+	previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
+
+	return LLPanel::postBuild();
+}
+
+void LLSocialPhotoPanel::onClickNewSnapshot()
+{
+	LLSnapshotLivePreview* previewp = static_cast<LLSnapshotLivePreview*>(mPreviewHandle.get());
+	//LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
+	if (previewp /*&& view*/)
+	{
+		//view->impl.setStatus(Impl::STATUS_READY);
+		lldebugs << "updating snapshot" << llendl;
+		previewp->updateSnapshot(TRUE);
+	}
+}
+
+void LLSocialPhotoPanel::draw()
+{ 
+	LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
+
+	LLPanel::draw();
+
+	if(previewp && previewp->getThumbnailImage())
+	{
+		bool working = false; //impl.getStatus() == Impl::STATUS_WORKING;
+		const LLRect& thumbnail_rect = getThumbnailPlaceholderRect();
+		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 ; // preview y pos within the preview rect
+
+		// calc preview offset within the floater rect
+		S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
+		S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
+
+		LLUICtrl * snapshot_panel = getChild<LLUICtrl>("snapshot_panel");
+		snapshot_panel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, gFloaterView->getParentFloater(this));
+
+		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 = working ? LLColor4::grey4 : LLColor4::white;
+		gl_draw_scaled_image(offset_x, offset_y, 
+			thumbnail_w, thumbnail_h,
+			previewp->getThumbnailImage(), color % alpha);
+
+		previewp->drawPreviewRect(offset_x, offset_y) ;
+
+		// Draw some controls on top of the preview thumbnail.
+		static const S32 PADDING = 5;
+		static const S32 REFRESH_LBL_BG_HEIGHT = 32;
+
+		// Reshape and position the posting result message panels at the top of the thumbnail.
+		// Do this regardless of current posting status (finished or not) to avoid flicker
+		// when the result message is displayed for the first time.
+		// if (impl.getStatus() == Impl::STATUS_FINISHED)
+		{
+			LLRect result_lbl_rect = mSucceessLblPanel->getRect();
+			const S32 result_lbl_h = result_lbl_rect.getHeight();
+			result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h);
+			mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
+			mSucceessLblPanel->setRect(result_lbl_rect);
+			mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
+			mFailureLblPanel->setRect(result_lbl_rect);
+		}
+
+		// Position the refresh button in the bottom left corner of the thumbnail.
+		mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING);
+
+		if (/*impl.mNeedRefresh*/false)
+		{
+			// Place the refresh hint text to the right of the refresh button.
+			const LLRect& refresh_btn_rect = mRefreshBtn->getRect();
+			mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom);
+
+			// Draw the refresh hint background.
+			LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y);
+			gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE);
+		}
+
+		gGL.pushUIMatrix();
+		LLUI::translate((F32) thumbnail_rect.mLeft, (F32) thumbnail_rect.mBottom);
+		mThumbnailPlaceholder->draw();
+		gGL.popUIMatrix();
+	}
+}
+
 void LLSocialPhotoPanel::onSend()
 {
 	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
@@ -124,7 +244,9 @@ void LLSocialCheckinPanel::onSend()
 }
 
 
-LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key)
+LLFloaterSocial::LLFloaterSocial(const LLSD& key) : 
+LLFloater(key),
+mSocialPhotoPanel(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
 }
@@ -136,5 +258,17 @@ void LLFloaterSocial::onCancel()
 
 BOOL LLFloaterSocial::postBuild()
 {
+	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("social_photo_tab"));
+
 	return LLFloater::postBuild();
 }
+
+void LLFloaterSocial::onOpen(const LLSD& key)
+{
+	LLSnapshotLivePreview* preview = static_cast<LLSnapshotLivePreview *>(mSocialPhotoPanel->mPreviewHandle.get());
+	if(preview)
+	{
+		lldebugs << "opened, updating snapshot" << llendl;
+		preview->updateSnapshot(TRUE);
+	}
+}
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index aee7f2f060..118eaf17d7 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -29,11 +29,28 @@
 
 #include "llfloater.h"
 
+#include "llsnapshotlivepreview.h"
+
 class LLSocialPhotoPanel : public LLPanel
 {
-	public:
+
+public:
 		LLSocialPhotoPanel();
+		~LLSocialPhotoPanel();
+
+		BOOL postBuild();
+		void draw();
 		void onSend();
+
+		const LLRect& getThumbnailPlaceholderRect() { return mThumbnailPlaceholder->getRect(); }
+		void onClickNewSnapshot();
+
+		LLHandle<LLView> mPreviewHandle;
+
+private:
+		LLUICtrl *mRefreshBtn, *mRefreshLabel;
+		LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
+		LLUICtrl* mThumbnailPlaceholder;
 };
 
 class LLSocialCheckinPanel : public LLPanel
@@ -52,6 +69,11 @@ public:
 	LLFloaterSocial(const LLSD& key);
 	BOOL postBuild();
 	void onCancel();
+	void onOpen(const LLSD& key);
+
+private:
+
+	LLSocialPhotoPanel * mSocialPhotoPanel;
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 5dab804c71..7bae7c90ed 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -454,7 +454,7 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
 
 	// UI size for thumbnail
 	// *FIXME: the rect does not change, so maybe there's no need to recalculate max w/h.
-	const LLRect& thumbnail_rect = LLFloaterSnapshot::getThumbnailPlaceholderRect();
+	const LLRect& thumbnail_rect = mThumbnailPlaceholderRect;
 	S32 max_width = thumbnail_rect.getWidth();
 	S32 max_height = thumbnail_rect.getHeight();
 
diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h
index 52cd87ea9f..906ef7f1c1 100644
--- a/indra/newview/llsnapshotlivepreview.h
+++ b/indra/newview/llsnapshotlivepreview.h
@@ -156,6 +156,7 @@ public:
 	LLPointer<LLImageRaw>		getEncodedImage() const { return mPreviewImageEncoded; }
 
 	/// Sets size of preview thumbnail image and thhe surrounding rect.
+	void setThumbnailPlaceholderRect(const LLRect& rect) {mThumbnailPlaceholderRect = rect; }
 	BOOL setThumbnailImageSize() ;
 	void generateThumbnailImage(BOOL force_update = FALSE) ;
 	void resetThumbnailImage() { mThumbnailImage = NULL ; }
@@ -183,6 +184,7 @@ private:
 	LLRect                      mPreviewRect ;
 	BOOL                        mThumbnailUpdateLock ;
 	BOOL                        mThumbnailUpToDate ;
+	LLRect                      mThumbnailPlaceholderRect;
 
 	S32							mCurImageIndex;
 	LLPointer<LLImageRaw>		mPreviewImage;
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index f99044b233..dc505fb200 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -149,12 +149,12 @@
               1,031 KB
             </text>
             <ui_ctrl
-              height="150"
-              width="250"
-              name="thumbnail_placeholder"
-              top_pad="5"
-              follows="left|top"
-              left="9">
+                height="150"
+                width="250"
+                name="thumbnail_placeholder"
+                top_pad="5"
+                follows="left|top"
+                left="9">
               <panel
                background_visible="true"
                bg_alpha_color="0.9 1 0.9 1"
@@ -168,7 +168,7 @@
                right="-1"
                top="0"
                type="string"
-               visible="true">
+               visible="false">
                 <text
                  follows="all"
                  font="SansSerif"
@@ -198,7 +198,7 @@
                right="-1"
                top="0"
                type="string"
-               visible="true">
+               visible="false">
                 <text
                  follows="all"
                  font="SansSerif"
@@ -221,7 +221,7 @@
                name="working_indicator"
                left="101"
                top="46"
-               visible="true"
+               visible="false"
                width="48" />
               <text
                follows="left|top|right"
@@ -235,7 +235,7 @@
                top="98"
                translate="false"
                type="string"
-               visible="true"
+               visible="false"
                width="130">
                 Working
               </text>
@@ -243,23 +243,25 @@
                follows="left|top"
                height="22"
                image_overlay="Refresh_Off"
-               left="6"
+               left="20"
                name="new_snapshot_btn"
-               bottom="-6"
-               visible="true"
+               bottom="-20"
+               visible="false"
                width="22" />
               <text
                follows="left|top"
                font="SansSerifBold"
+               halign="left"
                height="18"
-               left_pad="6"
+               left_pad="10"
                length="1"
                name="refresh_lbl"
+               right="-5"
                text_color="red"
-               top_delta="5"
+               top_delta="0"
                translate="false"
                type="string"
-               visible="true"
+               visible="false"
                width="130">
                 Refresh to save.
               </text>
-- 
cgit v1.2.3


From 4441edecdf27b9324b61d9e415c257e50e4909a6 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 25 Jun 2013 10:54:59 -0700
Subject: ACME-587 Add the 'refresh' button on top the image

---
 indra/newview/llfloatersocial.cpp                  | 181 ++++++++++++++++++++-
 indra/newview/llfloatersocial.h                    |  17 +-
 indra/newview/llsnapshotlivepreview.cpp            |   4 +-
 .../skins/default/xui/en/floater_social.xml        |   6 +-
 4 files changed, 199 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index fe5c324d0b..f2110e09c1 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -42,6 +42,8 @@ static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocial
 static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
 static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
 
+const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
+
 std::string get_map_url()
 {
     LLVector3d center_agent;
@@ -94,6 +96,8 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
 
 BOOL LLSocialPhotoPanel::postBuild()
 {
+	mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
+	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this));
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
 	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
@@ -112,6 +116,12 @@ BOOL LLSocialPhotoPanel::postBuild()
 	return LLPanel::postBuild();
 }
 
+void LLSocialPhotoPanel::onResolutionComboCommit()
+{
+	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
+	updateResolution(mResolutionComboBox, instance); 
+}
+
 void LLSocialPhotoPanel::onClickNewSnapshot()
 {
 	LLSnapshotLivePreview* previewp = static_cast<LLSnapshotLivePreview*>(mPreviewHandle.get());
@@ -124,6 +134,131 @@ void LLSocialPhotoPanel::onClickNewSnapshot()
 	}
 }
 
+void LLSocialPhotoPanel::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update)
+{
+	LLComboBox* combobox = (LLComboBox*)ctrl;
+	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
+
+	if (!view || !combobox)
+	{
+		llassert(view && combobox);
+		return;
+	}
+
+	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];
+
+	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
+			lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
+			previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
+		}
+		else
+		{
+			// use the resolution from the selected pre-canned drop-down choice
+			lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl;
+			previewp->setSize(width, height);
+		}
+
+		checkAspectRatio(view, width) ;
+
+		previewp->getSize(width, height);
+		
+		if(original_width != width || original_height != height)
+		{
+			previewp->setSize(width, height);
+
+			// hide old preview as the aspect ratio could be wrong
+			lldebugs << "updating thumbnail" << llendl;
+			
+			previewp->updateSnapshot(FALSE, TRUE);
+			if(do_update)
+			{
+				lldebugs << "Will update controls" << llendl;
+				updateControls();
+				setNeedRefresh(true);
+			}
+		}
+		
+	}
+}
+
+void LLSocialPhotoPanel::setNeedRefresh(bool need)
+{
+	mRefreshLabel->setVisible(need);
+	mNeedRefresh = need;
+}
+
+void LLSocialPhotoPanel::checkAspectRatio(LLFloaterSnapshot *view, 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;
+	}
+}
+
+LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
+{
+	LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
+	return previewp;
+}
+
+
+void LLSocialPhotoPanel::updateControls()
+{
+
+
+	LLSnapshotLivePreview* previewp = getPreviewView();
+	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
+	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
+
+	// *TODO: Separate maximum size for Web images from postcards
+	lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
+
+	LLLocale locale(LLLocale::USER_LOCALE);
+	std::string bytes_string;
+	if (got_snap)
+	{
+		LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
+	}
+
+	//getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown"));
+	getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown");
+	getChild<LLUICtrl>("file_size_label")->setColor(
+		true 
+		&& got_bytes
+		&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
+
+	LLComboBox* combo = getChild<LLComboBox>("resolution_combobox");
+	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
+	updateResolution(combo, instance, FALSE);
+}
+
 void LLSocialPhotoPanel::draw()
 { 
 	LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
@@ -179,7 +314,7 @@ void LLSocialPhotoPanel::draw()
 		// Position the refresh button in the bottom left corner of the thumbnail.
 		mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING);
 
-		if (/*impl.mNeedRefresh*/false)
+		if (mNeedRefresh)
 		{
 			// Place the refresh hint text to the right of the refresh button.
 			const LLRect& refresh_btn_rect = mRefreshBtn->getRect();
@@ -191,7 +326,11 @@ void LLSocialPhotoPanel::draw()
 		}
 
 		gGL.pushUIMatrix();
-		LLUI::translate((F32) thumbnail_rect.mLeft, (F32) thumbnail_rect.mBottom);
+		S32 x_pos;
+		S32 y_pos;
+		snapshot_panel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, gFloaterView->getParentFloater(this));
+		
+		LLUI::translate((F32) x_pos, (F32) y_pos);
 		mThumbnailPlaceholder->draw();
 		gGL.popUIMatrix();
 	}
@@ -313,3 +452,41 @@ void LLFloaterSocial::onOpen(const LLSD& key)
 		preview->updateSnapshot(TRUE);
 	}
 }
+
+// static
+void LLFloaterSocial::preUpdate()
+{
+	// FIXME: duplicated code
+	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
+	if (instance)
+	{
+		// Disable the send/post/save buttons until snapshot is ready.
+		instance->mSocialPhotoPanel->updateControls();
+
+		// Force hiding the "Refresh to save" hint because we know we've just started refresh.
+		instance->mSocialPhotoPanel->setNeedRefresh(false);
+	}
+}
+
+// static
+void LLFloaterSocial::postUpdate()
+{
+	// FIXME: duplicated code
+	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
+	if (instance)
+	{
+		// Enable the send/post/save buttons.
+		instance->mSocialPhotoPanel->updateControls();
+
+		// We've just done refresh.
+		instance->mSocialPhotoPanel->setNeedRefresh(false);
+
+		// The refresh button is initially hidden. We show it after the first update,
+		// i.e. when preview appears.
+		if (!instance->mSocialPhotoPanel->mRefreshBtn->getVisible())
+		{
+			instance->mSocialPhotoPanel->mRefreshBtn->setVisible(true);
+		}
+		
+	}
+}
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index a08bbb99ad..7b8db2d64a 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -51,14 +51,24 @@ class LLSocialPhotoPanel : public LLPanel
 		void onSend();
 
 		const LLRect& getThumbnailPlaceholderRect() { return mThumbnailPlaceholder->getRect(); }
+		void onResolutionComboCommit();
 		void onClickNewSnapshot();
 
 		LLHandle<LLView> mPreviewHandle;
 
-private:
+		void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE);
+		void setNeedRefresh(bool need);
+		void checkAspectRatio(LLFloaterSnapshot *view, S32 index);
+		LLSnapshotLivePreview* getPreviewView();
+
+		void updateControls();
+
+		LLUICtrl * mResolutionComboBox;
 		LLUICtrl *mRefreshBtn, *mRefreshLabel;
 		LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
 		LLUICtrl* mThumbnailPlaceholder;
+
+		bool mNeedRefresh;
 };
 
 class LLSocialCheckinPanel : public LLPanel
@@ -76,6 +86,11 @@ public:
 	void onCancel();
 	void onOpen(const LLSD& key);
 	/*virtual*/ void draw();
+
+
+	static void preUpdate();
+	static void postUpdate();
+
 private:
 	LLSocialPhotoPanel * mSocialPhotoPanel;
     std::string mMapUrl;
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 7bae7c90ed..70c0584231 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -29,7 +29,7 @@
 
 #include "llsnapshotlivepreview.h"
 
-
+#include "llfloatersocial.h"
 
 const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f;
 
@@ -186,6 +186,7 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
 		mSnapshotDelayTimer.start();
 		mSnapshotDelayTimer.setTimerExpirySec(delay);
 		LLFloaterSnapshot::preUpdate();
+		LLFloaterSocial::preUpdate();
 	}
 
 	// Update thumbnail if requested.
@@ -742,6 +743,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 	}
 	lldebugs << "done creating snapshot" << llendl;
 	LLFloaterSnapshot::postUpdate();
+	LLFloaterSocial::postUpdate();
 
 	return TRUE;
 }
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 5c910ad986..1ae8f7ed65 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -131,10 +131,6 @@
                label="1024x768"
                name="1024x768"
                value="[i1024,i768]" />
-              <combo_box.item
-               label="Custom"
-               name="Custom"
-               value="[i-1,i-1]" />
             </combo_box>
             <text
              follows="left|top"
@@ -147,7 +143,7 @@
              top="12"
              type="string"
              width="50">
-              1,031 KB
+              [SIZE] KB
             </text>
             <ui_ctrl
                 height="150"
-- 
cgit v1.2.3


From 7eae0afabc1b809a756b947c08d05f14f4b9d4e0 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 25 Jun 2013 11:47:45 -0700
Subject: ACME-585 Populate the drop-down box with picture resolutions

---
 indra/newview/app_settings/settings.xml               | 11 +++++++++++
 indra/newview/skins/default/xui/en/floater_social.xml |  1 +
 2 files changed, 12 insertions(+)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d137df6b7c..fee74586e6 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12757,6 +12757,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>SocialPhotoResolution</key>
+    <map>
+      <key>Comment</key>
+      <string>Default resolution when sharing photo using the social floater</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>[i800,i600]</string>
+    </map>  
     <key>sourceid</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 1ae8f7ed65..f8ab2000cf 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -108,6 +108,7 @@
             help_topic="snapshot_panel"
             name="snapshot_panel">
             <combo_box
+             control_name="SocialPhotoResolution"
              follows="left|top"
              top="6"
              left="9"
-- 
cgit v1.2.3


From 4a8579462c464bd73d79256435d08ebc4112ccf7 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 25 Jun 2013 19:49:13 +0100
Subject: made status update post button disabled for ACME-571

---
 indra/newview/llfloatersocial.cpp                  | 45 +++++++++++++++++-----
 indra/newview/llfloatersocial.h                    |  6 +++
 .../skins/default/xui/en/floater_social.xml        |  4 +-
 3 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index f2110e09c1..92a291e51c 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -57,21 +57,48 @@ std::string get_map_url()
     return map_url;
 }
 
-LLSocialStatusPanel::LLSocialStatusPanel()
+LLSocialStatusPanel::LLSocialStatusPanel() :
+	mMessageTextEditor(NULL),
+	mPostStatusButton(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this));
 }
 
+BOOL LLSocialStatusPanel::postBuild()
+{
+	mMessageTextEditor = getChild<LLUICtrl>("status_message");
+	mPostStatusButton = getChild<LLUICtrl>("post_status_btn");
+
+	return LLPanel::postBuild();
+}
+
+void LLSocialStatusPanel::draw()
+{
+	if (mMessageTextEditor && mPostStatusButton)
+	{
+		std::string message = mMessageTextEditor->getValue().asString();
+		mPostStatusButton->setEnabled(!message.empty());
+	}
+
+	LLPanel::draw();
+}
+
 void LLSocialStatusPanel::onSend()
 {
-	std::string message = getChild<LLUICtrl>("message")->getValue().asString();
-	LLFacebookConnect::instance().updateStatus(message);
+	if (mMessageTextEditor)
+	{
+		std::string message = mMessageTextEditor->getValue().asString();
+		if (!message.empty())
+		{
+			LLFacebookConnect::instance().updateStatus(message);
 	
-	LLFloater* floater = getParentByType<LLFloater>();
-    if (floater)
-    {
-        floater->closeFloater();
-    }
+			LLFloater* floater = getParentByType<LLFloater>();
+			if (floater)
+			{
+				floater->closeFloater();
+			}
+		}
+	}
 }
 
 LLSocialPhotoPanel::LLSocialPhotoPanel() :
@@ -84,8 +111,6 @@ mThumbnailPlaceholder(NULL)
 	mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
 }
 
-
-
 LLSocialPhotoPanel::~LLSocialPhotoPanel()
 {
 	if(mPreviewHandle.get())
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 7b8db2d64a..1e28e3cb7e 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -36,7 +36,13 @@ class LLSocialStatusPanel : public LLPanel
 {
 public:
     LLSocialStatusPanel();
+	BOOL postBuild();
+	void draw();
     void onSend();
+
+private:
+	LLUICtrl* mMessageTextEditor;
+	LLUICtrl* mPostStatusButton;
 };
 
 class LLSocialPhotoPanel : public LLPanel
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 1ae8f7ed65..3b19a2f4cb 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -49,7 +49,7 @@
         left="9"
         length="1"
         max_length="700"
-        name="message"
+        name="status_message"
         type="string"
         word_wrap="true">
       </text_editor>
@@ -57,7 +57,7 @@
         follows="left|top"
         height="23"
         label="Post"
-        name="post_btn"
+        name="post_status_btn"
         top_pad="18"
         width="100">
         <button.commit_callback
-- 
cgit v1.2.3


From 9f0646bcc0b24d9f3c13446399505eddc768a4ce Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 25 Jun 2013 12:43:37 -0700
Subject: ACME-580, ACME-572, ACME-591 : Added a toast notification when
 posting to Facebook successfully

---
 indra/newview/llfacebookconnect.cpp            | 11 ++++++++++-
 indra/newview/skins/default/xui/en/strings.xml |  3 +++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 64fc81cc93..fe4e7fe69e 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -36,9 +36,10 @@
 #include "llnotificationsutil.h"
 #include "llurlaction.h"
 #include "llimagepng.h"
+#include "lltrans.h"
 
 
-// Local function
+// Local functions
 void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description)
 {
     // Note: 302 (redirect) is *not* an error that warrants prompting the user
@@ -55,6 +56,13 @@ void prompt_user_for_error(U32 status, const std::string& reason, const std::str
     }
 }
 
+void toast_user_for_success()
+{
+	LLSD args;
+    args["MESSAGE"] = LLTrans::getString("facebook_post_success");
+    LLNotificationsUtil::add("SystemMessage", args);
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 class LLFacebookConnectHandler : public LLCommandHandler
@@ -133,6 +141,7 @@ public:
 	{
 		if (isGoodStatus(status))
 		{
+            toast_user_for_success();
 			LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL;
 		}
 		else
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index f7b33b0a4a..4613ae054f 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3421,6 +3421,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
     Drag items from inventory here
   </string>
 
+  <string name="facebook_post_success">
+    Posting to Facebook was successful.
+  </string>
 
   <string name="no_session_message">
     (IM Session Doesn't Exist)
-- 
cgit v1.2.3


From d63dd9d442a2c30b26163cdaf475ed31070aa92b Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 25 Jun 2013 13:44:21 -0700
Subject: ACME-588 Make 'Post' button post to facebook

---
 indra/newview/llfloatersocial.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index f2110e09c1..52a4e090f3 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -350,9 +350,11 @@ void LLSocialPhotoPanel::onSend()
 		else
 			caption = caption + " " + slurl.getSLURLString();
 	}
-	//LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption);
-	//LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
-	//LLFloaterSnapshot::postSave();
+
+	LLSnapshotLivePreview* previewp = getPreviewView();
+
+	LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
+	updateControls();
 }
 
 
-- 
cgit v1.2.3


From e92e5a3d5337204c10a8417bb0ad480d591b4b90 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 25 Jun 2013 13:53:38 -0700
Subject: ACME-592 Clicking 'Post' should close the Facebook floater

---
 indra/newview/llfloatersocial.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 23e3d35c22..9b27024eed 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -380,6 +380,13 @@ void LLSocialPhotoPanel::onSend()
 
 	LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
 	updateControls();
+
+	// Close the floater once "Post" has been pushed
+	LLFloater* floater = getParentByType<LLFloater>();
+	if (floater)
+	{
+		floater->closeFloater();
+	}
 }
 
 
-- 
cgit v1.2.3


From b497b121ed2d8964160ee79003debb9f5ab62a49 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 25 Jun 2013 23:19:53 +0100
Subject: used default SL logo for image-less checkins for ACME-613

---
 indra/newview/llfloatersocial.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 9b27024eed..b3c0481968 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -43,6 +43,7 @@ static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialph
 static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
 
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
+const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg";
 
 std::string get_map_url()
 {
@@ -411,7 +412,7 @@ void LLSocialCheckinPanel::onSend()
     
 	// Optionally add the region map view
 	bool add_map_view = getChild<LLUICtrl>("add_place_view_cb")->getValue().asBoolean();
-    std::string map_url = (add_map_view ? get_map_url() : "");
+    std::string map_url = (add_map_view ? get_map_url() : DEFAULT_CHECKIN_ICON_URL);
     
 	// Get the caption
 	std::string caption = getChild<LLUICtrl>("place_caption")->getValue().asString();
-- 
cgit v1.2.3


From ec09ce526b477869aa76dddaa8e11eecca57989d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 25 Jun 2013 15:49:39 -0700
Subject: ACME-612 : Implemented a loading indicator for the map tile when it's
 loading, also disable the checkbox during that time

---
 indra/newview/llfloatersocial.cpp                  | 14 +++++++++--
 indra/newview/llfloatersocial.h                    |  1 +
 .../skins/default/xui/en/floater_social.xml        | 27 ++++++++++++++--------
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 92a291e51c..e164ea8155 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -34,6 +34,7 @@
 #include "llfacebookconnect.h"
 #include "llfloaterreg.h"
 #include "lliconctrl.h"
+#include "llloadingindicator.h"
 #include "llslurl.h"
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
@@ -453,8 +454,12 @@ void LLFloaterSocial::draw()
         mMapTexture->setBoostLevel(LLGLTexture::BOOST_MAP);
         mReloadingMapTexture = true;
         // In the meantime, put back the "loading" placeholder in the map widget
-        getChild<LLIconCtrl>("map_placeholder")->setImage(mMapPlaceholder);
-    }
+        getChild<LLLoadingIndicator>("map_loading_indicator")->setVisible(true);
+        getChild<LLIconCtrl>("map_placeholder")->setVisible(false);
+        mMapCheckBoxValue = getChild<LLCheckBoxCtrl>("add_place_view_cb")->get();
+        getChild<LLCheckBoxCtrl>("add_place_view_cb")->set(false);
+        getChild<LLCheckBoxCtrl>("add_place_view_cb")->setEnabled(false);
+   }
     // Are we done loading the map tile?
     if (mReloadingMapTexture && mMapTexture->isFullyLoaded())
     {
@@ -464,6 +469,11 @@ void LLFloaterSocial::draw()
         LLPointer<LLUIImage> ui_image = new LLUIImage(mMapUrl, mMapTexture);
         // Point map widget to correct map tile
         getChild<LLIconCtrl>("map_placeholder")->setImage(ui_image);
+        // Switch visibility
+        getChild<LLLoadingIndicator>("map_loading_indicator")->setVisible(false);
+        getChild<LLIconCtrl>("map_placeholder")->setVisible(true);
+        getChild<LLCheckBoxCtrl>("add_place_view_cb")->setEnabled(true);
+        getChild<LLCheckBoxCtrl>("add_place_view_cb")->set(mMapCheckBoxValue);
     }
     LLFloater::draw();
 }
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 1e28e3cb7e..8b51d5ca9b 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -103,6 +103,7 @@ private:
     LLPointer<LLViewerFetchedTexture> mMapTexture;
 	LLPointer<LLUIImage> mMapPlaceholder;
     bool mReloadingMapTexture;
+    bool mMapCheckBoxValue;
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 76c15b9624..960f883595 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -379,16 +379,25 @@
           <layout_panel
             name="place_map_panel"
             height="133">
-            <icon
+              <loading_indicator
               follows="left|top"
-              height="128"
-              width="128"
-              image_name="Map_Placeholder_Icon"
-              layout="topleft"
-              top="5"
-              left="9"
-              name="map_placeholder">
-            </icon>
+              height="24"
+              width="24"
+              name="map_loading_indicator"
+              top="57"
+              left="61"
+              visible="true"/>
+              <icon
+                follows="left|top"
+                height="128"
+                width="128"
+                image_name="Map_Placeholder_Icon"
+                layout="topleft"
+                top="5"
+                left="9"
+                visible="false"
+                name="map_placeholder">
+              </icon>
             <check_box
               follows="left|top"
               initial_value="true"
-- 
cgit v1.2.3


From f081cca8dd79b4970082ecada831633ca6f9a501 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 25 Jun 2013 16:11:39 -0700
Subject: ACME-586: Fixing the file size appearing as red. Was using the
 postcard snap-shot type which is used for e-mailing pictures (red indicates
 going over 1mb).

---
 indra/newview/llfloatersocial.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 9b27024eed..7ca96dd228 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -136,6 +136,7 @@ BOOL LLSocialPhotoPanel::postBuild()
 	LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
 	mPreviewHandle = previewp->getHandle();	
 
+	previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
 	previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
 
 	return LLPanel::postBuild();
@@ -261,6 +262,7 @@ void LLSocialPhotoPanel::updateControls()
 	LLSnapshotLivePreview* previewp = getPreviewView();
 	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
 	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
+	LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType();
 
 	// *TODO: Separate maximum size for Web images from postcards
 	lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
@@ -275,7 +277,7 @@ void LLSocialPhotoPanel::updateControls()
 	//getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown"));
 	getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown");
 	getChild<LLUICtrl>("file_size_label")->setColor(
-		true 
+		shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD 
 		&& got_bytes
 		&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
 
-- 
cgit v1.2.3


From e6e8bf172cb399fa94ddd6f45efcf58947eaf0e8 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 25 Jun 2013 16:49:15 -0700
Subject: ACME-497 : Refactor the LLSocialCheckinPanel code a bit to make it
 more maintainable

---
 indra/newview/llfloatersocial.cpp | 87 +++++++++++++++++++++++----------------
 indra/newview/llfloatersocial.h   | 15 ++++---
 2 files changed, 61 insertions(+), 41 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 2859b19b19..c9f7283640 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -392,11 +392,61 @@ void LLSocialPhotoPanel::onSend()
 }
 
 
-LLSocialCheckinPanel::LLSocialCheckinPanel()
+LLSocialCheckinPanel::LLSocialCheckinPanel() :
+    mMapUrl(""),
+    mReloadingMapTexture(false)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this));
 }
 
+BOOL LLSocialCheckinPanel::postBuild()
+{
+    // Keep pointers to widgets so we don't traverse the UI hierarchy too often
+    mMapLoadingIndicator = getChild<LLUICtrl>("map_loading_indicator");
+    mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder");
+    mMapCheckBox = getChild<LLCheckBoxCtrl>("add_place_view_cb");
+    mMapCheckBoxValue = mMapCheckBox->get();
+    
+	return LLPanel::postBuild();
+}
+
+void LLSocialCheckinPanel::draw()
+{
+    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);
+        mMapCheckBoxValue = mMapCheckBox->get();
+        mMapCheckBox->set(false);
+        mMapCheckBox->setEnabled(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);
+        mMapCheckBox->setEnabled(true);
+        mMapCheckBox->set(mMapCheckBoxValue);
+    }
+    
+	LLPanel::draw();
+}
+
 void LLSocialCheckinPanel::onSend()
 {
 	// Get the location SLURL
@@ -431,8 +481,6 @@ void LLSocialCheckinPanel::onSend()
 
 
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
-    mMapUrl(""),
-    mReloadingMapTexture(false),
     mSocialPhotoPanel(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
@@ -446,45 +494,12 @@ void LLFloaterSocial::onCancel()
 BOOL LLFloaterSocial::postBuild()
 {
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("social_photo_tab"));
-    // Keep a pointer to the map tile placeholder texture
-    mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder")->getImage();
 	return LLFloater::postBuild();
 }
 
 /*virtual*/
 void LLFloaterSocial::draw()
 {
-    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 back the "loading" placeholder in the map widget
-        getChild<LLLoadingIndicator>("map_loading_indicator")->setVisible(true);
-        getChild<LLIconCtrl>("map_placeholder")->setVisible(false);
-        mMapCheckBoxValue = getChild<LLCheckBoxCtrl>("add_place_view_cb")->get();
-        getChild<LLCheckBoxCtrl>("add_place_view_cb")->set(false);
-        getChild<LLCheckBoxCtrl>("add_place_view_cb")->setEnabled(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);
-        // Point map widget to correct map tile
-        getChild<LLIconCtrl>("map_placeholder")->setImage(ui_image);
-        // Switch visibility
-        getChild<LLLoadingIndicator>("map_loading_indicator")->setVisible(false);
-        getChild<LLIconCtrl>("map_placeholder")->setVisible(true);
-        getChild<LLCheckBoxCtrl>("add_place_view_cb")->setEnabled(true);
-        getChild<LLCheckBoxCtrl>("add_place_view_cb")->set(mMapCheckBoxValue);
-    }
     LLFloater::draw();
 }
 
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 8b51d5ca9b..b7792e10c1 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -81,7 +81,17 @@ class LLSocialCheckinPanel : public LLPanel
 {
 public:
     LLSocialCheckinPanel();
+	BOOL postBuild();
+	void draw();
     void onSend();
+private:
+    std::string mMapUrl;
+    LLPointer<LLViewerFetchedTexture> mMapTexture;
+    LLUICtrl* mMapLoadingIndicator;
+    LLIconCtrl* mMapPlaceholder;
+    LLCheckBoxCtrl* mMapCheckBox;
+    bool mReloadingMapTexture;
+    bool mMapCheckBoxValue;
 };
 
 class LLFloaterSocial : public LLFloater
@@ -99,11 +109,6 @@ public:
 
 private:
 	LLSocialPhotoPanel * mSocialPhotoPanel;
-    std::string mMapUrl;
-    LLPointer<LLViewerFetchedTexture> mMapTexture;
-	LLPointer<LLUIImage> mMapPlaceholder;
-    bool mReloadingMapTexture;
-    bool mMapCheckBoxValue;
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
-- 
cgit v1.2.3


From bb59fff5a0e60b16e0726fb2da6cc6ee9cc3569c Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 26 Jun 2013 17:54:33 -0700
Subject: ACME-628 Removing unneeeded headers files from llsnapshotpreview,
 llsnapshot and llfloatersocial

---
 indra/newview/llfloatersnapshot.cpp     | 38 +---------------------
 indra/newview/llfloatersocial.cpp       |  3 ++
 indra/newview/llsnapshotlivepreview.cpp | 22 +++++++++++--
 indra/newview/llsnapshotlivepreview.h   | 57 +++------------------------------
 4 files changed, 28 insertions(+), 92 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 65934aa82a..65229c5654 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -32,59 +32,23 @@
 
 // Viewer includes
 #include "llagent.h"
-#include "llagentcamera.h"
-#include "llcallbacklist.h"
-#include "llcriticaldamp.h"
-#include "llfloaterperms.h"
-#include "llui.h"
 #include "llfacebookconnect.h"
 #include "llfloatersocial.h"
-#include "llfocusmgr.h"
-#include "llbutton.h"
 #include "llcombobox.h"
-#include "lleconomy.h"
-#include "lllandmarkactions.h"
-#include "llpanelsnapshot.h"
 #include "llsidetraypanelcontainer.h"
-#include "llsliderctrl.h"
 #include "llspinctrl.h"
 #include "llviewercontrol.h"
-#include "lluictrlfactory.h"
-#include "llviewerstats.h"
-#include "llviewercamera.h"
-#include "llviewerwindow.h"
-#include "llviewermenufile.h"	// upload_new_resource()
 #include "llcheckboxctrl.h"
-#include "llslurl.h"
-#include "llsnapshotlivepreview.h"
 #include "lltoolfocus.h"
 #include "lltoolmgr.h"
 #include "llwebsharing.h"
-#include "llworld.h"
-#include "llagentui.h"
+//#include "llagentui.h"
 
 // Linden library includes
-#include "llfontgl.h"
-#include "llsys.h"
-#include "llrender.h"
-#include "v3dmath.h"
-#include "llmath.h"
-#include "lldir.h"
 #include "llsdserialize.h"
-#include "llgl.h"
-#include "llglheaders.h"
-#include "llimagejpeg.h"
-#include "llimagepng.h"
-#include "llimagebmp.h"
-#include "llimagej2c.h"
-#include "lllocalcliprect.h"
-#include "llnotificationsutil.h"
 #include "llpostcard.h"
 #include "llresmgr.h"		// LLLocale
-#include "llvfile.h"
-#include "llvfs.h"
 #include "llwebprofile.h"
-#include "llwindow.h"
 
 ///----------------------------------------------------------------------------
 /// Local function declarations, constants, enums, and typedefs
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 43819e65f4..f16c5601c8 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -31,9 +31,12 @@
 
 #include "llagent.h"
 #include "llagentui.h"
+#include "llcombobox.h"
 #include "llfacebookconnect.h"
 #include "llfloaterreg.h"
 #include "lliconctrl.h"
+#include "llresmgr.h"		// LLLocale
+#include "llsdserialize.h"
 #include "llslurl.h"
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 70c0584231..e8dc323ee6 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -27,9 +27,27 @@
 
 #include "llviewerprecompiledheaders.h"
 
-#include "llsnapshotlivepreview.h"
-
+#include "llagent.h"
+#include "llagentcamera.h"
+#include "llagentui.h"
+#include "llcombobox.h"
+#include "lleconomy.h"
+#include "llfloaterperms.h"
+#include "llfloaterreg.h"
 #include "llfloatersocial.h"
+#include "lllandmarkactions.h"
+#include "lllocalcliprect.h"
+#include "llnotificationsutil.h"
+#include "llslurl.h"
+#include "llsnapshotlivepreview.h"
+#include "lltoolfocus.h"
+#include "llviewercontrol.h"
+#include "llviewermenufile.h"	// upload_new_resource()
+#include "llviewerstats.h"
+#include "llvfile.h"
+#include "llvfs.h"
+#include "llwebsharing.h"
+#include "llwindow.h"
 
 const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f;
 
diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h
index 906ef7f1c1..b05032b858 100644
--- a/indra/newview/llsnapshotlivepreview.h
+++ b/indra/newview/llsnapshotlivepreview.h
@@ -27,62 +27,13 @@
 #ifndef LL_LLSNAPSHOTLIVEPREVIEW_H
 #define LL_LLSNAPSHOTLIVEPREVIEW_H
 
-#include "llfloaterreg.h"
-
-// Viewer includes
-#include "llagent.h"
-#include "llagentcamera.h"
-#include "llcallbacklist.h"
-#include "llcriticaldamp.h"
-#include "llfloaterperms.h"
-#include "llui.h"
-#include "llfacebookconnect.h"
-#include "llfocusmgr.h"
-#include "llbutton.h"
-#include "llcombobox.h"
-#include "lleconomy.h"
-#include "lllandmarkactions.h"
+#include "llimagebmp.h"
+#include "llimagej2c.h"
+#include "llimagejpeg.h"
+#include "llimagepng.h"
 #include "llpanelsnapshot.h"
-#include "llsidetraypanelcontainer.h"
-#include "llsliderctrl.h"
-#include "llspinctrl.h"
-#include "llviewercontrol.h"
-#include "lluictrlfactory.h"
-#include "llviewerstats.h"
-#include "llviewercamera.h"
 #include "llviewerwindow.h"
-#include "llviewermenufile.h"	// upload_new_resource()
-#include "llcheckboxctrl.h"
-#include "llslurl.h"
-#include "lltoolfocus.h"
-#include "lltoolmgr.h"
-#include "llwebsharing.h"
 #include "llworld.h"
-#include "llagentui.h"
-
-// Linden library includes
-#include "llfontgl.h"
-#include "llsys.h"
-#include "llrender.h"
-#include "v3dmath.h"
-#include "llmath.h"
-#include "lldir.h"
-#include "llsdserialize.h"
-#include "llgl.h"
-#include "llglheaders.h"
-#include "llimagejpeg.h"
-#include "llimagepng.h"
-#include "llimagebmp.h"
-#include "llimagej2c.h"
-#include "lllocalcliprect.h"
-#include "llnotificationsutil.h"
-#include "llpostcard.h"
-#include "llresmgr.h"		// LLLocale
-#include "llvfile.h"
-#include "llvfs.h"
-#include "llwebprofile.h"
-#include "llwindow.h"
-
 
 ///----------------------------------------------------------------------------
 /// Class LLSnapshotLivePreview 
-- 
cgit v1.2.3


From 7fc98de12c0a69bae6d847697da6d8a0e03f80be Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 26 Jun 2013 21:14:11 -0700
Subject: ACME-621 : Add autoconnect to FBC in the social floater, disable Post
 buttons when not connected.

---
 indra/newview/llfloatersocial.cpp | 13 +++++++++----
 indra/newview/llfloatersocial.h   |  4 ++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 9e7b131abf..b717dc0f40 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -79,7 +79,7 @@ void LLSocialStatusPanel::draw()
 	if (mMessageTextEditor && mPostStatusButton)
 	{
 		std::string message = mMessageTextEditor->getValue().asString();
-		mPostStatusButton->setEnabled(!message.empty());
+		mPostStatusButton->setEnabled(!message.empty() && LLFacebookConnect::instance().isConnected());
 	}
 
 	LLPanel::draw();
@@ -123,6 +123,7 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
 
 BOOL LLSocialPhotoPanel::postBuild()
 {
+	mPostButton = getChild<LLUICtrl>("post_btn");
 	mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
 	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this));
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
@@ -256,11 +257,8 @@ LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
 	return previewp;
 }
 
-
 void LLSocialPhotoPanel::updateControls()
 {
-
-
 	LLSnapshotLivePreview* previewp = getPreviewView();
 	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
 	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
@@ -363,6 +361,8 @@ void LLSocialPhotoPanel::draw()
 		mThumbnailPlaceholder->draw();
 		gGL.popUIMatrix();
 	}
+
+    mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
 }
 
 void LLSocialPhotoPanel::onSend()
@@ -404,6 +404,7 @@ LLSocialCheckinPanel::LLSocialCheckinPanel() :
 BOOL LLSocialCheckinPanel::postBuild()
 {
     // Keep pointers to widgets so we don't traverse the UI hierarchy too often
+	mPostButton = getChild<LLUICtrl>("post_place_btn");
     mMapLoadingIndicator = getChild<LLUICtrl>("map_loading_indicator");
     mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder");
     mMapCheckBox = getChild<LLCheckBoxCtrl>("add_place_view_cb");
@@ -445,6 +446,7 @@ void LLSocialCheckinPanel::draw()
         mMapCheckBox->setEnabled(true);
         mMapCheckBox->set(mMapCheckBoxValue);
     }
+    mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
     
 	LLPanel::draw();
 }
@@ -495,6 +497,9 @@ void LLFloaterSocial::onCancel()
 
 BOOL LLFloaterSocial::postBuild()
 {
+    // Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state)
+    LLFacebookConnect::instance().getConnectionToFacebook();
+    // Keep tab of the Photo Panel
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("social_photo_tab"));
 	return LLFloater::postBuild();
 }
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index b7792e10c1..1848481084 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -75,6 +75,9 @@ class LLSocialPhotoPanel : public LLPanel
 		LLUICtrl* mThumbnailPlaceholder;
 
 		bool mNeedRefresh;
+
+private:
+	LLUICtrl* mPostButton;
 };
 
 class LLSocialCheckinPanel : public LLPanel
@@ -87,6 +90,7 @@ public:
 private:
     std::string mMapUrl;
     LLPointer<LLViewerFetchedTexture> mMapTexture;
+	LLUICtrl* mPostButton;
     LLUICtrl* mMapLoadingIndicator;
     LLIconCtrl* mMapPlaceholder;
     LLCheckBoxCtrl* mMapCheckBox;
-- 
cgit v1.2.3


From 29477353f9ac936a5269302b76179ae0b1feec3a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 27 Jun 2013 11:26:18 -0700
Subject: ACME-628 Removing unneeeded headers files and used forward
 declarations for llfloatersnapshot.h, llfloatersocial.h and
 llsnapshotlivepreview.h.

---
 indra/newview/llfloatersnapshot.cpp     | 18 +++++++-----------
 indra/newview/llfloatersnapshot.h       |  1 -
 indra/newview/llfloatersocial.cpp       |  8 ++++++--
 indra/newview/llfloatersocial.h         |  6 ++++--
 indra/newview/llsnapshotlivepreview.cpp |  6 +++++-
 indra/newview/llsnapshotlivepreview.h   |  7 ++-----
 6 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 65229c5654..a0771ff220 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -28,27 +28,23 @@
 
 #include "llfloatersnapshot.h"
 
-#include "llfloaterreg.h"
-
-// Viewer includes
 #include "llagent.h"
 #include "llfacebookconnect.h"
+#include "llfloaterreg.h"
 #include "llfloatersocial.h"
+#include "llcheckboxctrl.h"
 #include "llcombobox.h"
+#include "llpostcard.h"
+#include "llresmgr.h"		// LLLocale
+#include "llsdserialize.h"
 #include "llsidetraypanelcontainer.h"
+#include "llsnapshotlivepreview.h"
 #include "llspinctrl.h"
 #include "llviewercontrol.h"
-#include "llcheckboxctrl.h"
 #include "lltoolfocus.h"
 #include "lltoolmgr.h"
-#include "llwebsharing.h"
-//#include "llagentui.h"
-
-// Linden library includes
-#include "llsdserialize.h"
-#include "llpostcard.h"
-#include "llresmgr.h"		// LLLocale
 #include "llwebprofile.h"
+#include "llwebsharing.h"
 
 ///----------------------------------------------------------------------------
 /// Local function declarations, constants, enums, and typedefs
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index afe135fa40..82af8c7a9d 100755
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -27,7 +27,6 @@
 #ifndef LL_LLFLOATERSNAPSHOT_H
 #define LL_LLFLOATERSNAPSHOT_H
 
-#include "llimage.h"
 #include "llfloater.h"
 
 class LLSpinCtrl;
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 80cdd3a0cb..ea69a60887 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -31,12 +31,16 @@
 
 #include "llagent.h"
 #include "llagentui.h"
+#include "llcheckboxctrl.h"
 #include "llcombobox.h"
 #include "llfacebookconnect.h"
 #include "llfloaterreg.h"
 #include "lliconctrl.h"
+#include "llresmgr.h"		// LLLocale
+#include "llsdserialize.h"
 #include "llloadingindicator.h"
 #include "llslurl.h"
+#include "llsnapshotlivepreview.h"
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
 
@@ -201,7 +205,7 @@ void LLSocialPhotoPanel::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_up
 			previewp->setSize(width, height);
 		}
 
-		checkAspectRatio(view, width) ;
+		checkAspectRatio(width);
 
 		previewp->getSize(width, height);
 		
@@ -230,7 +234,7 @@ void LLSocialPhotoPanel::setNeedRefresh(bool need)
 	mNeedRefresh = need;
 }
 
-void LLSocialPhotoPanel::checkAspectRatio(LLFloaterSnapshot *view, S32 index)
+void LLSocialPhotoPanel::checkAspectRatio(S32 index)
 {
 	LLSnapshotLivePreview *previewp = getPreviewView() ;
 
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index b7792e10c1..d4073212ff 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -30,7 +30,9 @@
 #include "llfloater.h"
 #include "llviewertexture.h"
 
-#include "llsnapshotlivepreview.h"
+class LLIconCtrl;
+class LLCheckBoxCtrl;
+class LLSnapshotLivePreview;
 
 class LLSocialStatusPanel : public LLPanel
 {
@@ -64,7 +66,7 @@ class LLSocialPhotoPanel : public LLPanel
 
 		void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE);
 		void setNeedRefresh(bool need);
-		void checkAspectRatio(LLFloaterSnapshot *view, S32 index);
+		void checkAspectRatio(S32 index);
 		LLSnapshotLivePreview* getPreviewView();
 
 		void updateControls();
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index e8dc323ee6..7532ebfc57 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -35,6 +35,10 @@
 #include "llfloaterperms.h"
 #include "llfloaterreg.h"
 #include "llfloatersocial.h"
+#include "llimagebmp.h"
+#include "llimagej2c.h"
+#include "llimagejpeg.h"
+#include "llimagepng.h"
 #include "lllandmarkactions.h"
 #include "lllocalcliprect.h"
 #include "llnotificationsutil.h"
@@ -48,6 +52,7 @@
 #include "llvfs.h"
 #include "llwebsharing.h"
 #include "llwindow.h"
+#include "llworld.h"
 
 const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f;
 
@@ -57,7 +62,6 @@ F32 SHINE_OPACITY = 0.3f;
 F32 FALL_TIME = 0.6f;
 S32 BORDER_WIDTH = 6;
 
-const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
 
 std::set<LLSnapshotLivePreview*> LLSnapshotLivePreview::sList;
diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h
index b05032b858..fe3d257b02 100644
--- a/indra/newview/llsnapshotlivepreview.h
+++ b/indra/newview/llsnapshotlivepreview.h
@@ -27,13 +27,10 @@
 #ifndef LL_LLSNAPSHOTLIVEPREVIEW_H
 #define LL_LLSNAPSHOTLIVEPREVIEW_H
 
-#include "llimagebmp.h"
-#include "llimagej2c.h"
-#include "llimagejpeg.h"
-#include "llimagepng.h"
 #include "llpanelsnapshot.h"
 #include "llviewerwindow.h"
-#include "llworld.h"
+
+class LLImageJPEG;
 
 ///----------------------------------------------------------------------------
 /// Class LLSnapshotLivePreview 
-- 
cgit v1.2.3


From 26832818780ffe5052443db3c6bbfca15575a5b5 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 27 Jun 2013 19:34:39 +0100
Subject: changed FBC photo sharing to use JPEG instead of PNG for ACME-636

---
 indra/newview/llfacebookconnect.cpp | 23 ++++++++++++++++-------
 indra/newview/llfloatersocial.cpp   |  6 ++++--
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index fe4e7fe69e..cf0f554149 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -36,6 +36,7 @@
 #include "llnotificationsutil.h"
 #include "llurlaction.h"
 #include "llimagepng.h"
+#include "llimagejpeg.h"
 #include "lltrans.h"
 
 
@@ -352,14 +353,22 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri
 
 void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption)
 {
-	// All this code is mostly copied from LLWebProfile::post()
-	if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
+	std::string imageFormat;
+	if (dynamic_cast<LLImagePNG*>(image.get()))
+	{
+		imageFormat = "png";
+	}
+	else if (dynamic_cast<LLImageJPEG*>(image.get()))
+	{
+		imageFormat = "jpg";
+	}
+	else
 	{
-		llwarns << "Image to upload is not a PNG" << llendl;
-		llassert(dynamic_cast<LLImagePNG*>(image.get()) != 0);
+		llwarns << "Image to upload is not a PNG or JPEG" << llendl;
 		return;
 	}
-
+	
+	// All this code is mostly copied from LLWebProfile::post()
 	const std::string boundary = "----------------------------0123abcdefab";
 
 	LLSD headers;
@@ -373,8 +382,8 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std:
 			<< caption << "\r\n";
 
 	body	<< "--" << boundary << "\r\n"
-			<< "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot.png\"\r\n"
-			<< "Content-Type: image/png\r\n\r\n";
+			<< "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot." << 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 ...
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 7ef8f9f9e3..e305bfd10a 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -137,7 +137,7 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
 	mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
-
+	
 	LLRect full_screen_rect = getRootView()->getRect();
 	LLSnapshotLivePreview::Params p;
 	p.rect(full_screen_rect);
@@ -145,8 +145,10 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mPreviewHandle = previewp->getHandle();	
 
 	previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+	previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+	//previewp->setSnapshotQuality(98);
 	previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
-
+	
 	return LLPanel::postBuild();
 }
 
-- 
cgit v1.2.3


From 1d54e25990b5e28a6fd7f352bfa26473aec53d6d Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 27 Jun 2013 22:50:41 +0100
Subject: Fixed delay in loading tabs on Facebook floater for ACME-649

---
 indra/newview/llfloatersocial.cpp | 33 ++++++++++++++++++++++-----------
 indra/newview/llfloatersocial.h   |  1 +
 2 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index e305bfd10a..9198d9a07b 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -128,6 +128,8 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
 
 BOOL LLSocialPhotoPanel::postBuild()
 {
+	setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2));
+
 	mPostButton = getChild<LLUICtrl>("post_btn");
 	mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
 	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this));
@@ -138,17 +140,6 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
 	
-	LLRect full_screen_rect = getRootView()->getRect();
-	LLSnapshotLivePreview::Params p;
-	p.rect(full_screen_rect);
-	LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
-	mPreviewHandle = previewp->getHandle();	
-
-	previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
-	previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
-	//previewp->setSnapshotQuality(98);
-	previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
-	
 	return LLPanel::postBuild();
 }
 
@@ -293,6 +284,26 @@ void LLSocialPhotoPanel::updateControls()
 	updateResolution(combo, instance, FALSE);
 }
 
+void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
+{
+	bool visible = new_visibility.asBoolean();
+	if (visible && !mPreviewHandle.get())
+	{
+		LLRect full_screen_rect = getRootView()->getRect();
+		LLSnapshotLivePreview::Params p;
+		p.rect(full_screen_rect);
+		LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
+		mPreviewHandle = previewp->getHandle();	
+
+		previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+		previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+		//previewp->setSnapshotQuality(98);
+		previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
+
+		updateControls();
+	}
+}
+
 void LLSocialPhotoPanel::draw()
 { 
 	LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 6411843b9c..6675a990f4 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -70,6 +70,7 @@ class LLSocialPhotoPanel : public LLPanel
 		LLSnapshotLivePreview* getPreviewView();
 
 		void updateControls();
+		void onVisibilityChange(const LLSD& new_visibility);
 
 		LLUICtrl * mResolutionComboBox;
 		LLUICtrl *mRefreshBtn, *mRefreshLabel;
-- 
cgit v1.2.3


From 0b34d1c34cccd1ed95f17293ef941289b40e39f9 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 27 Jun 2013 16:47:00 -0700
Subject: ACME-630 Adjust floater_social.xml to load panels from files instead
 of in-lining

---
 indra/newview/llfloatersocial.cpp                  |   2 +-
 .../skins/default/xui/en/floater_social.xml        | 412 +--------------------
 2 files changed, 10 insertions(+), 404 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index e305bfd10a..594773c556 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -507,7 +507,7 @@ BOOL LLFloaterSocial::postBuild()
     // Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state)
     LLFacebookConnect::instance().getConnectionToFacebook();
     // Keep tab of the Photo Panel
-	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("social_photo_tab"));
+	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
 	return LLFloater::postBuild();
 }
 
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 960f883595..27c01eec4d 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -23,428 +23,34 @@
    height="430"
    halign="center">
     <panel
+     filename="panel_social_status.xml"
      class="llsocialstatuspanel"
      background_opaque="true"
      background_visible="true"
      bg_alpha_color="DkGray"
      bg_opaque_color="DkGray"
      label="STATUS"
-     help_topic="social_status_tab"
-     name="status_panel">
-      <text
-        length="1"
-        follows="top|left|right"
-        font="SansSerif"
-        height="16"
-        left="9"
-        name="caption_label"
-        top_pad="18"
-        type="string">
-        What's on your mind?
-      </text>
-      <text_editor
-        follows="left|top"
-        height="80"
-        width="280"
-        left="9"
-        length="1"
-        max_length="700"
-        name="status_message"
-        type="string"
-        word_wrap="true">
-      </text_editor>
-      <button
-        follows="left|top"
-        height="23"
-        label="Post"
-        name="post_status_btn"
-        top_pad="18"
-        width="100">
-        <button.commit_callback
-          function="SocialSharing.SendStatus" />
-      </button>
-      <button
-        follows="left|top"
-        height="23"
-        label="Cancel"
-        name="cancel_btn"
-        left_pad="15"
-        top_delta="0"
-        width="100">
-        <button.commit_callback
-          function="SocialSharing.Cancel" />
-      </button>
-    </panel>
+     help_topic="panel_social_status"
+     name="panel_social_status"/>
     <panel
+      filename="panel_social_photo.xml"
       class="llsocialphotopanel"
       follows="all"
-      height="430"
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
       label="PHOTO"
-      help_topic="social_photo_tab"
-      name="social_photo_tab">
-      <layout_stack
-       border_size="0"
-       height="422"
-       follows="all"
-       orientation="vertical"
-       name="stack1"
-       top="8">
-        <layout_panel
-         name="photo_detail_panel"
-         height="295">
-          <panel
-            top="0"
-            follows="all"
-            height="295"
-            width="286"
-            left="7"
-            background_opaque="true"
-            background_visible="true"
-            bg_opaque_color="DkGray2"
-            label="snapshot_panel"
-            help_topic="snapshot_panel"
-            name="snapshot_panel">
-            <combo_box
-             control_name="SocialPhotoResolution"
-             follows="left|top"
-             top="6"
-             left="9"
-             name="resolution_combobox"
-             tool_tip="Image resolution"
-             height="21"
-             width="135">
-              <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>
-            <text
-             follows="left|top"
-             font="SansSerifSmall"
-             height="14"
-             left="208"
-             length="1"
-             halign="right"
-             name="file_size_label"
-             top="12"
-             type="string"
-             width="50">
-              [SIZE] KB
-            </text>
-            <ui_ctrl
-                height="150"
-                width="250"
-                name="thumbnail_placeholder"
-                top_pad="5"
-                follows="left|top"
-                left="9">
-              <panel
-               background_visible="true"
-               bg_alpha_color="0.9 1 0.9 1"
-               follows="left|top"
-               font="SansSerifLarge"
-               halign="center"
-               height="20"
-               left="0"
-               length="1"
-               name="succeeded_panel"
-               right="-1"
-               top="0"
-               type="string"
-               visible="false">
-                <text
-                 follows="all"
-                 font="SansSerif"
-                 halign="center"
-                 height="18"
-                 left="1"
-                 length="1"
-                 name="succeeded_lbl"
-                 right="-1"
-                 text_color="0.2 0.5 0.2 1"
-                 top="4"
-                 translate="false"
-                 type="string">
-                  Succeeded
-                </text>
-              </panel>
-              <panel
-               background_visible="true"
-               bg_alpha_color="1 0.9 0.9 1"
-               follows="left|top"
-               font="SansSerifLarge"
-               halign="center"
-               height="20"
-               left_delta="0"
-               length="1"
-               name="failed_panel"
-               right="-1"
-               top="0"
-               type="string"
-               visible="false">
-                <text
-                 follows="all"
-                 font="SansSerif"
-                 halign="center"
-                 height="18"
-                 left="1"
-                 length="1"
-                 name="failed_lbl"
-                 right="-1"
-                 text_color="0.5 0.2 0.2 1"
-                 top="4"
-                 translate="false"
-                 type="string">
-                  Failed
-                </text>
-              </panel>
-              <loading_indicator
-               follows="left|top"
-               height="48"
-               name="working_indicator"
-               left="101"
-               top="46"
-               visible="false"
-               width="48" />
-              <text
-               follows="left|top|right"
-               font="SansSerifBold"
-               height="14"
-               left="5"
-               length="1"
-               halign="center"
-               name="working_lbl"
-               right="-5"
-               top="98"
-               translate="false"
-               type="string"
-               visible="false"
-               width="130">
-                Working
-              </text>
-              <button
-               follows="left|top"
-               height="22"
-               image_overlay="Refresh_Off"
-               left="20"
-               name="new_snapshot_btn"
-               bottom="-20"
-               visible="false"
-               width="22" />
-              <text
-               follows="left|top"
-               font="SansSerifBold"
-               halign="left"
-               height="18"
-               left_pad="10"
-               length="1"
-               name="refresh_lbl"
-               right="-5"
-               text_color="red"
-               top_delta="0"
-               translate="false"
-               type="string"
-               visible="false"
-               width="130">
-                Refresh to save.
-              </text>
-            </ui_ctrl>
-            <text
-             length="1"
-             follows="top|left|right"
-             font="SansSerif"
-             height="16"
-             left="9"
-             name="caption_label"
-             top_pad="12"
-             type="string">
-              Comment (optional):
-            </text>
-            <text_editor
-             follows="left|top"
-             height="47"
-             width="250"
-             left="9"
-             length="1"
-             max_length="700"
-             name="caption"
-             type="string"
-             word_wrap="true">
-            </text_editor>
-            <check_box
-             follows="left|top"
-             initial_value="true"
-             label="Include location in posting"
-             name="add_location_cb"
-             top_pad="19"/>            
-            </panel>
-        </layout_panel>
-        <layout_panel
-          name="photo_button_panel"
-          height="96">
-          <panel
-            height="96"
-            top="0"
-            follows="all"
-            left="7"
-            right="-10"
-            background_opaque="true"
-            background_visible="true"
-            bg_opaque_color="DkGray"
-            label="button_container"
-            help_topic="button_container"
-            name="button_container"/>
-          <button
-           follows="left|top"
-           top="15"
-           height="23"
-           label="Post"
-           name="post_btn"
-           width="100">
-            <button.commit_callback
-             function="PostToFacebook.Send" />
-          </button>
-          <button
-               follows="left|top"
-               height="23"
-               label="Cancel"
-               name="cancel_btn"
-               left_pad="15"
-               top_delta="0"
-               width="100">
-            <button.commit_callback
-             function="SocialSharing.Cancel" />
-          </button>          
-        </layout_panel>        
-      </layout_stack>
-    </panel>
+      help_topic="panel_social_photo"
+      name="panel_social_photo"/>
     <panel
+      filename="panel_social_place.xml"
       class="llsocialcheckinpanel"
       follows="all"
-      height="430"
       background_visible="true"
       bg_alpha_color="DkGray"
       bg_opaque_color="DkGray"
       label="PLACE"
-      help_topic="social_place_tab"
-      name="place_panel">
-      <layout_stack
-        border_size="0"
-        height="422"
-        follows="all"
-        orientation="vertical"
-        name="stack_place"
-        top="8">
-        <layout_panel
-          name="place_detail_panel"
-          height="122">
-          <text
-            length="1"
-            follows="top|left|right"
-            font="SansSerif"
-            height="16"
-            left="9"
-            name="place_caption_label"
-            top_pad="12"
-            type="string">
-            Say something about where you are:
-          </text>
-          <text_editor
-            follows="top|left|right"
-            height="94"
-            right="-9"
-            left="9"
-            length="1"
-            max_length="700"
-            name="place_caption"
-            type="string"
-            word_wrap="true">
-           </text_editor>
-          </layout_panel>
-          <layout_panel
-            name="place_map_panel"
-            height="133">
-              <loading_indicator
-              follows="left|top"
-              height="24"
-              width="24"
-              name="map_loading_indicator"
-              top="57"
-              left="61"
-              visible="true"/>
-              <icon
-                follows="left|top"
-                height="128"
-                width="128"
-                image_name="Map_Placeholder_Icon"
-                layout="topleft"
-                top="5"
-                left="9"
-                visible="false"
-                name="map_placeholder">
-              </icon>
-            <check_box
-              follows="left|top"
-              initial_value="true"
-              top_delta="8"
-              width="8"
-              label=""
-              name="add_place_view_cb"
-              left_pad="5"/>
-            <text
-              follows="left|top"
-              font="SansSerif"
-              height="32"
-              width="130"
-              word_wrap="true"
-              left_pad="12"
-              top_delta="-8"
-              type="string">
-              Include overhead view of location
-            </text>
-          </layout_panel>
-          <layout_panel
-            name="place_button_panel"
-            height="96">
-            <button
-              follows="left|top"
-              top="5"
-              left="9"
-              height="23"
-              label="Post"
-              name="post_place_btn"
-              width="100">
-              <button.commit_callback
-                 function="SocialSharing.SendCheckin" />
-            </button>
-            <button
-              follows="left|top"
-              height="23"
-              label="Cancel"
-              name="cancel_btn"
-              left_pad="15"
-              top_delta="0"
-              width="100">
-              <button.commit_callback
-                  function="SocialSharing.Cancel" />
-            </button>
-        </layout_panel>
-     </layout_stack>
-    </panel>
+      help_topic="panel_social_place"
+      name="panel_social_place"/>
   </tab_container>
 </floater>
-- 
cgit v1.2.3


From fc05dc5114785368e37e325fdb429fed7cd3c363 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 27 Jun 2013 16:52:53 -0700
Subject: ACME-630 Adding missing files

---
 .../skins/default/xui/en/panel_social_photo.xml    | 254 +++++++++++++++++++++
 .../skins/default/xui/en/panel_social_place.xml    | 108 +++++++++
 .../skins/default/xui/en/panel_social_status.xml   |  50 ++++
 3 files changed, 412 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/panel_social_photo.xml
 create mode 100644 indra/newview/skins/default/xui/en/panel_social_place.xml
 create mode 100644 indra/newview/skins/default/xui/en/panel_social_status.xml

diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
new file mode 100644
index 0000000000..e6742b0ea7
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -0,0 +1,254 @@
+    <panel
+      height="430"
+      width="304"
+      name="panel_social_photo">
+      <layout_stack
+	   layout="topleft"
+       border_size="0"
+       height="422"
+	   width="304"
+       follows="all"
+       orientation="vertical"
+       name="stack1"
+       top="8">
+        <layout_panel	
+         name="photo_detail_panel"
+         height="295">
+          <panel
+            top="0"
+            follows="all"
+            height="295"
+            width="286"
+            left="7"
+            background_opaque="true"
+            background_visible="true"
+            bg_opaque_color="DkGray2"
+            label="snapshot_panel"
+            help_topic="snapshot_panel"
+            name="snapshot_panel">
+            <combo_box
+             control_name="SocialPhotoResolution"
+             follows="left|top"
+             top="6"
+             left="9"
+             name="resolution_combobox"
+             tool_tip="Image resolution"
+             height="21"
+             width="135">
+              <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>
+            <text
+             follows="left|top"
+             font="SansSerifSmall"
+             height="14"
+             left="208"
+             length="1"
+             halign="right"
+             name="file_size_label"
+             top="12"
+             type="string"
+             width="50">
+              [SIZE] KB
+            </text>
+            <ui_ctrl
+                height="150"
+                width="250"
+                name="thumbnail_placeholder"
+                top_pad="5"
+                follows="left|top"
+                left="9">
+              <panel
+               background_visible="true"
+               bg_alpha_color="0.9 1 0.9 1"
+               follows="left|top"
+               font="SansSerifLarge"
+               halign="center"
+               height="20"
+               left="0"
+               length="1"
+               name="succeeded_panel"
+               right="-1"
+               top="0"
+               type="string"
+               visible="false">
+                <text
+                 follows="all"
+                 font="SansSerif"
+                 halign="center"
+                 height="18"
+                 left="1"
+                 length="1"
+                 name="succeeded_lbl"
+                 right="-1"
+                 text_color="0.2 0.5 0.2 1"
+                 top="4"
+                 translate="false"
+                 type="string">
+                  Succeeded
+                </text>
+              </panel>
+              <panel
+               background_visible="true"
+               bg_alpha_color="1 0.9 0.9 1"
+               follows="left|top"
+               font="SansSerifLarge"
+               halign="center"
+               height="20"
+               left_delta="0"
+               length="1"
+               name="failed_panel"
+               right="-1"
+               top="0"
+               type="string"
+               visible="false">
+                <text
+                 follows="all"
+                 font="SansSerif"
+                 halign="center"
+                 height="18"
+                 left="1"
+                 length="1"
+                 name="failed_lbl"
+                 right="-1"
+                 text_color="0.5 0.2 0.2 1"
+                 top="4"
+                 translate="false"
+                 type="string">
+                  Failed
+                </text>
+              </panel>
+              <loading_indicator
+               follows="left|top"
+               height="48"
+               name="working_indicator"
+               left="101"
+               top="46"
+               visible="false"
+               width="48" />
+              <text
+               follows="left|top|right"
+               font="SansSerifBold"
+               height="14"
+               left="5"
+               length="1"
+               halign="center"
+               name="working_lbl"
+               right="-5"
+               top="98"
+               translate="false"
+               type="string"
+               visible="false"
+               width="130">
+                Working
+              </text>
+              <button
+               follows="left|top"
+               height="22"
+               image_overlay="Refresh_Off"
+               left="20"
+               name="new_snapshot_btn"
+               bottom="-20"
+               visible="false"
+               width="22" />
+              <text
+               follows="left|top"
+               font="SansSerifBold"
+               halign="left"
+               height="18"
+               left_pad="10"
+               length="1"
+               name="refresh_lbl"
+               right="-5"
+               text_color="red"
+               top_delta="0"
+               translate="false"
+               type="string"
+               visible="false"
+               width="130">
+                Refresh to save.
+              </text>
+            </ui_ctrl>
+            <text
+             length="1"
+             follows="top|left|right"
+             font="SansSerif"
+             height="16"
+             left="9"
+             name="caption_label"
+             top_pad="12"
+             type="string">
+              Comment (optional):
+            </text>
+            <text_editor
+             follows="left|top"
+             height="47"
+             width="250"
+             left="9"
+             length="1"
+             max_length="700"
+             name="caption"
+             type="string"
+             word_wrap="true">
+            </text_editor>
+            <check_box
+             follows="left|top"
+             initial_value="true"
+             label="Include location in posting"
+             name="add_location_cb"
+             top_pad="19"/>            
+            </panel>
+        </layout_panel>
+        <layout_panel
+          name="photo_button_panel"
+          height="96">
+          <panel
+            height="96"
+            top="0"
+            follows="all"
+            left="7"
+            right="-10"
+            background_opaque="true"
+            background_visible="true"
+            bg_opaque_color="DkGray"
+            label="button_container"
+            help_topic="button_container"
+            name="button_container"/>
+          <button
+           follows="left|top"
+           top="15"
+           height="23"
+           label="Post"
+           name="post_btn"
+           width="100">
+            <button.commit_callback
+             function="PostToFacebook.Send" />
+          </button>
+          <button
+               follows="left|top"
+               height="23"
+               label="Cancel"
+               name="cancel_btn"
+               left_pad="15"
+               top_delta="0"
+               width="100">
+            <button.commit_callback
+             function="SocialSharing.Cancel" />
+          </button>          
+        </layout_panel>        
+      </layout_stack>
+    </panel>
\ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
new file mode 100644
index 0000000000..30b48d9bb1
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -0,0 +1,108 @@
+    <panel
+      height="430"
+      width="304"	  
+      name="panel_social_place">
+      <layout_stack
+	    layout="topleft"
+        border_size="0"
+        height="422"
+        follows="all"
+        orientation="vertical"
+        name="stack_place"
+        top="8">
+        <layout_panel
+          name="place_detail_panel"
+          height="122">
+          <text
+            length="1"
+            follows="top|left|right"
+            font="SansSerif"
+            height="16"
+            left="9"
+            name="place_caption_label"
+            top_pad="12"
+            type="string">
+            Say something about where you are:
+          </text>
+          <text_editor
+            follows="top|left|right"
+            height="94"
+            right="-9"
+            left="9"
+            length="1"
+            max_length="700"
+            name="place_caption"
+            type="string"
+            word_wrap="true">
+           </text_editor>
+          </layout_panel>
+          <layout_panel
+            name="place_map_panel"
+            height="133">
+              <loading_indicator
+              follows="left|top"
+              height="24"
+              width="24"
+              name="map_loading_indicator"
+              top="57"
+              left="61"
+              visible="true"/>
+              <icon
+                follows="left|top"
+                height="128"
+                width="128"
+                image_name="Map_Placeholder_Icon"
+                layout="topleft"
+                top="5"
+                left="9"
+                visible="false"
+                name="map_placeholder">
+              </icon>
+            <check_box
+              follows="left|top"
+              initial_value="true"
+              top_delta="8"
+              width="8"
+              label=""
+              name="add_place_view_cb"
+              left_pad="5"/>
+            <text
+              follows="left|top"
+              font="SansSerif"
+              height="32"
+              width="130"
+              word_wrap="true"
+              left_pad="12"
+              top_delta="-8"
+              type="string">
+              Include overhead view of location
+            </text>
+          </layout_panel>
+          <layout_panel
+            name="place_button_panel"
+            height="96">
+            <button
+              follows="left|top"
+              top="5"
+              left="9"
+              height="23"
+              label="Post"
+              name="post_place_btn"
+              width="100">
+              <button.commit_callback
+                 function="SocialSharing.SendCheckin" />
+            </button>
+            <button
+              follows="left|top"
+              height="23"
+              label="Cancel"
+              name="cancel_btn"
+              left_pad="15"
+              top_delta="0"
+              width="100">
+              <button.commit_callback
+                  function="SocialSharing.Cancel" />
+            </button>
+        </layout_panel>
+     </layout_stack>
+    </panel>
\ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
new file mode 100644
index 0000000000..ae199e7e38
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -0,0 +1,50 @@
+    <panel
+	 height="430"
+	 width="304"
+     name="panel_social_status">
+      <text
+        length="1"
+        follows="top|left|right"
+        font="SansSerif"
+        height="16"
+        left="9"
+        name="caption_label"
+        top_pad="18"
+        type="string">
+        What's on your mind?
+      </text>
+      <text_editor
+        follows="left|top"
+        height="80"
+        width="280"
+        left="9"
+        length="1"
+        max_length="700"
+        name="status_message"
+        type="string"
+        word_wrap="true">
+      </text_editor>
+      <button
+	    layout="topleft"
+        follows="left|top"
+        height="23"
+        label="Post"
+        name="post_status_btn"
+        top_pad="18"
+        width="100">
+        <button.commit_callback
+          function="SocialSharing.SendStatus" />
+      </button>
+      <button
+	    layout="topleft"
+        follows="left|top"
+        height="23"
+        label="Cancel"
+        name="cancel_btn"
+        left_pad="15"
+        top_delta="0"
+        width="100">
+        <button.commit_callback
+          function="SocialSharing.Cancel" />
+      </button>
+    </panel>
\ No newline at end of file
-- 
cgit v1.2.3


From 0e50cbc2edacdecf32071c97c2ce5349db5ef5e9 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 28 Jun 2013 01:21:14 +0100
Subject: made it optional to autoconnect in
 LLFacebookConnect::getConnectionToFacebook() for ACME-648

---
 indra/newview/llfacebookconnect.cpp       | 18 +++++++++++++-----
 indra/newview/llfacebookconnect.h         |  2 +-
 indra/newview/llfloatersocial.cpp         |  2 +-
 indra/newview/llpanelpeople.cpp           |  2 +-
 indra/newview/llpanelsnapshotfacebook.cpp |  2 +-
 indra/newview/llviewermenu.cpp            |  2 +-
 6 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index cf0f554149..52268daa36 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -201,9 +201,9 @@ class LLFacebookConnectedResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLFacebookConnectedResponder);
 public:
     
-	LLFacebookConnectedResponder()
+	LLFacebookConnectedResponder(bool auto_connect) : mAutoConnect(auto_connect)
     {
-        LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
     }
     
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
@@ -223,7 +223,14 @@ public:
 			// show the facebook login page if not connected yet
 			if (status == 404)
 			{
-				LLFacebookConnect::instance().connectToFacebook();
+				if (mAutoConnect)
+				{
+					LLFacebookConnect::instance().connectToFacebook();
+				}
+				else
+				{
+					LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+				}
 			}
             else
             {
@@ -234,6 +241,7 @@ public:
 	}
     
 private:
+	bool mAutoConnect;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -304,13 +312,13 @@ void LLFacebookConnect::disconnectFromFacebook()
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
 }
 
-void LLFacebookConnect::getConnectionToFacebook()
+void LLFacebookConnect::getConnectionToFacebook(bool auto_connect)
 {
     if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED))
     {
         const bool follow_redirects=false;
         const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(),
+        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect),
                           LLSD(), timeout, follow_redirects);
     }
 }
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index a19b6fbb98..c54da8e3f3 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -54,7 +54,7 @@ public:
 
 	void connectToFacebook(const std::string& auth_code = "");  // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use.
 	void disconnectFromFacebook();                              // Disconnect from the FBC service.
-    void getConnectionToFacebook();                             // Check if an access token is available on the FBC service. If not, call connectToFacebook().
+    void getConnectionToFacebook(bool auto_connect = false);     // Check if an access token is available on the FBC service. If not, call connectToFacebook().
     
     void loadFacebookFriends();
 	void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 8d026471dc..35761d5cc8 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -516,7 +516,7 @@ void LLFloaterSocial::onCancel()
 BOOL LLFloaterSocial::postBuild()
 {
     // Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state)
-    LLFacebookConnect::instance().getConnectionToFacebook();
+    LLFacebookConnect::instance().getConnectionToFacebook(true);
     // Keep tab of the Photo Panel
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
 	return LLFloater::postBuild();
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index b6b72800f9..92391f0537 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1683,7 +1683,7 @@ void LLPanelPeople::onLoginFbcButtonClicked()
 	}
 	else
 	{
-        LLFacebookConnect::instance().getConnectionToFacebook();
+        LLFacebookConnect::instance().getConnectionToFacebook(true);
 	}
 }
 
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 0a76bc3b9d..94fbb986c0 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -89,7 +89,7 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
 {
 	if (!LLFacebookConnect::instance().isConnected())
 	{
-        LLFacebookConnect::instance().getConnectionToFacebook();
+        LLFacebookConnect::instance().getConnectionToFacebook(true);
 	}
 	updateControls(key);
 	LLPanelSnapshot::onOpen(key);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index df2da12045..47787e2687 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5957,7 +5957,7 @@ void handle_facebook_connect()
 {
 	if (!LLFacebookConnect::instance().isConnected())
 	{
-        LLFacebookConnect::instance().getConnectionToFacebook();
+        LLFacebookConnect::instance().getConnectionToFacebook(true);
 	}
 }
 
-- 
cgit v1.2.3


From 06f0e4161b3c735678f9ace02d659cc838afc1d8 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 27 Jun 2013 18:30:27 -0700
Subject: ACME-629 Clean up names of variables and functions used in the
 Facebook photo panel

---
 indra/newview/llfloatersocial.cpp | 385 +++++++++++++++++++-------------------
 indra/newview/llfloatersocial.h   |  39 ++--
 2 files changed, 214 insertions(+), 210 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 35761d5cc8..dfc9024d54 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -64,6 +64,10 @@ std::string get_map_url()
     return map_url;
 }
 
+///////////////////////////
+//LLSocialStatusPanel//////
+///////////////////////////
+
 LLSocialStatusPanel::LLSocialStatusPanel() :
 	mMessageTextEditor(NULL),
 	mPostStatusButton(NULL)
@@ -108,12 +112,21 @@ void LLSocialStatusPanel::onSend()
 	}
 }
 
+///////////////////////////
+//LLSocialPhotoPanel///////
+///////////////////////////
+
 LLSocialPhotoPanel::LLSocialPhotoPanel() :
+mSnapshotPanel(NULL),
+mResolutionComboBox(NULL),
 mRefreshBtn(NULL),
 mRefreshLabel(NULL),
 mSucceessLblPanel(NULL),
 mFailureLblPanel(NULL),
-mThumbnailPlaceholder(NULL)
+mThumbnailPlaceholder(NULL),
+mCaptionTextBox(NULL),
+mLocationCheckbox(NULL),
+mPostButton(NULL)
 {
 	mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
 }
@@ -129,179 +142,21 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
 BOOL LLSocialPhotoPanel::postBuild()
 {
 	setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2));
-
-	mPostButton = getChild<LLUICtrl>("post_btn");
+	
+	mSnapshotPanel = getChild<LLUICtrl>("snapshot_panel");
 	mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
-	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this));
+	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE));
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
 	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
 	mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
 	mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
-	
-	return LLPanel::postBuild();
-}
-
-void LLSocialPhotoPanel::onResolutionComboCommit()
-{
-	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
-	updateResolution(mResolutionComboBox, instance); 
-}
-
-void LLSocialPhotoPanel::onClickNewSnapshot()
-{
-	LLSnapshotLivePreview* previewp = static_cast<LLSnapshotLivePreview*>(mPreviewHandle.get());
-	//LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
-	if (previewp /*&& view*/)
-	{
-		//view->impl.setStatus(Impl::STATUS_READY);
-		lldebugs << "updating snapshot" << llendl;
-		previewp->updateSnapshot(TRUE);
-	}
-}
-
-void LLSocialPhotoPanel::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update)
-{
-	LLComboBox* combobox = (LLComboBox*)ctrl;
-	LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
-
-	if (!view || !combobox)
-	{
-		llassert(view && combobox);
-		return;
-	}
-
-	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];
-
-	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
-			lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
-			previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
-		}
-		else
-		{
-			// use the resolution from the selected pre-canned drop-down choice
-			lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl;
-			previewp->setSize(width, height);
-		}
-
-		checkAspectRatio(width);
-
-		previewp->getSize(width, height);
-		
-		if(original_width != width || original_height != height)
-		{
-			previewp->setSize(width, height);
-
-			// hide old preview as the aspect ratio could be wrong
-			lldebugs << "updating thumbnail" << llendl;
-			
-			previewp->updateSnapshot(FALSE, TRUE);
-			if(do_update)
-			{
-				lldebugs << "Will update controls" << llendl;
-				updateControls();
-				setNeedRefresh(true);
-			}
-		}
-		
-	}
-}
-
-void LLSocialPhotoPanel::setNeedRefresh(bool need)
-{
-	mRefreshLabel->setVisible(need);
-	mNeedRefresh = need;
-}
-
-void LLSocialPhotoPanel::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;
-	}
-}
-
-LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
-{
-	LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
-	return previewp;
-}
-
-void LLSocialPhotoPanel::updateControls()
-{
-	LLSnapshotLivePreview* previewp = getPreviewView();
-	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
-	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
-	LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType();
-
-	// *TODO: Separate maximum size for Web images from postcards
-	lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
-
-	LLLocale locale(LLLocale::USER_LOCALE);
-	std::string bytes_string;
-	if (got_snap)
-	{
-		LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
-	}
-
-	//getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown"));
-	getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown");
-	getChild<LLUICtrl>("file_size_label")->setColor(
-		shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD 
-		&& got_bytes
-		&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
-
-	LLComboBox* combo = getChild<LLComboBox>("resolution_combobox");
-	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
-	updateResolution(combo, instance, FALSE);
-}
-
-void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
-{
-	bool visible = new_visibility.asBoolean();
-	if (visible && !mPreviewHandle.get())
-	{
-		LLRect full_screen_rect = getRootView()->getRect();
-		LLSnapshotLivePreview::Params p;
-		p.rect(full_screen_rect);
-		LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
-		mPreviewHandle = previewp->getHandle();	
-
-		previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
-		previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
-		//previewp->setSnapshotQuality(98);
-		previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
+	mCaptionTextBox = getChild<LLUICtrl>("caption");
+	mLocationCheckbox = getChild<LLUICtrl>("add_location_cb");
+	mPostButton = getChild<LLUICtrl>("post_btn");
 
-		updateControls();
-	}
+	return LLPanel::postBuild();
 }
 
 void LLSocialPhotoPanel::draw()
@@ -313,7 +168,7 @@ void LLSocialPhotoPanel::draw()
 	if(previewp && previewp->getThumbnailImage())
 	{
 		bool working = false; //impl.getStatus() == Impl::STATUS_WORKING;
-		const LLRect& thumbnail_rect = getThumbnailPlaceholderRect();
+		const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
 		const S32 thumbnail_w = previewp->getThumbnailWidth();
 		const S32 thumbnail_h = previewp->getThumbnailHeight();
 
@@ -325,8 +180,7 @@ void LLSocialPhotoPanel::draw()
 		S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
 		S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
 
-		LLUICtrl * snapshot_panel = getChild<LLUICtrl>("snapshot_panel");
-		snapshot_panel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, gFloaterView->getParentFloater(this));
+		mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType<LLFloater>());
 
 		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		// Apply floater transparency to the texture unless the floater is focused.
@@ -373,20 +227,57 @@ void LLSocialPhotoPanel::draw()
 		gGL.pushUIMatrix();
 		S32 x_pos;
 		S32 y_pos;
-		snapshot_panel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, gFloaterView->getParentFloater(this));
-		
+		mSnapshotPanel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, getParentByType<LLFloater>());
+
 		LLUI::translate((F32) x_pos, (F32) y_pos);
 		mThumbnailPlaceholder->draw();
 		gGL.popUIMatrix();
 	}
 
-    mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
+	mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
+}
+
+LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
+{
+	LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
+	return previewp;
+}
+
+void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
+{
+	bool visible = new_visibility.asBoolean();
+	if (visible && !mPreviewHandle.get())
+	{
+		LLRect full_screen_rect = getRootView()->getRect();
+		LLSnapshotLivePreview::Params p;
+		p.rect(full_screen_rect);
+		LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
+		mPreviewHandle = previewp->getHandle();	
+
+		previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+		previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+		//previewp->setSnapshotQuality(98);
+		previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
+
+		updateControls();
+	}
+}
+
+void LLSocialPhotoPanel::onClickNewSnapshot()
+{
+	LLSnapshotLivePreview* previewp = getPreviewView();
+	if (previewp)
+	{
+		//setStatus(Impl::STATUS_READY);
+		lldebugs << "updating snapshot" << llendl;
+		previewp->updateSnapshot(TRUE);
+	}
 }
 
 void LLSocialPhotoPanel::onSend()
 {
-	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
-	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
+	std::string caption = mCaptionTextBox->getValue().asString();
+	bool add_location = mLocationCheckbox->getValue().asBoolean();
 
 	if (add_location)
 	{
@@ -399,7 +290,6 @@ void LLSocialPhotoPanel::onSend()
 	}
 
 	LLSnapshotLivePreview* previewp = getPreviewView();
-
 	LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
 	updateControls();
 
@@ -411,6 +301,122 @@ void LLSocialPhotoPanel::onSend()
 	}
 }
 
+void LLSocialPhotoPanel::updateControls()
+{
+	LLSnapshotLivePreview* previewp = getPreviewView();
+	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
+	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
+	LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType();
+
+	// *TODO: Separate maximum size for Web images from postcards
+	lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
+
+	LLLocale locale(LLLocale::USER_LOCALE);
+	std::string bytes_string;
+	if (got_snap)
+	{
+		LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
+	}
+
+	//getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string
+	getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown");
+	getChild<LLUICtrl>("file_size_label")->setColor(
+		shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD 
+		&& got_bytes
+		&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
+
+	updateResolution(FALSE);
+}
+
+void LLSocialPhotoPanel::updateResolution(BOOL do_update)
+{
+	LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
+
+	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];
+
+	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
+			lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
+			previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
+		}
+		else
+		{
+			// use the resolution from the selected pre-canned drop-down choice
+			lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl;
+			previewp->setSize(width, height);
+		}
+
+		checkAspectRatio(width);
+
+		previewp->getSize(width, height);
+		
+		if(original_width != width || original_height != height)
+		{
+			previewp->setSize(width, height);
+
+			// hide old preview as the aspect ratio could be wrong
+			lldebugs << "updating thumbnail" << llendl;
+			
+			previewp->updateSnapshot(FALSE, TRUE);
+			if(do_update)
+			{
+				lldebugs << "Will update controls" << llendl;
+				updateControls();
+				setNeedRefresh(true);
+			}
+		}
+		
+	}
+}
+
+void LLSocialPhotoPanel::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;
+	}
+}
+
+void LLSocialPhotoPanel::setNeedRefresh(bool need)
+{
+	mRefreshLabel->setVisible(need);
+	mNeedRefresh = need;
+}
+
+LLUICtrl* LLSocialPhotoPanel::getRefreshBtn()
+{
+	return mRefreshBtn;
+}
+
+////////////////////////
+//LLSocialCheckinPanel//
+////////////////////////
 
 LLSocialCheckinPanel::LLSocialCheckinPanel() :
     mMapUrl(""),
@@ -501,6 +507,9 @@ void LLSocialCheckinPanel::onSend()
     }
 }
 
+////////////////////////
+//LLFloaterSocial///////
+////////////////////////
 
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
     mSocialPhotoPanel(NULL)
@@ -522,15 +531,9 @@ BOOL LLFloaterSocial::postBuild()
 	return LLFloater::postBuild();
 }
 
-/*virtual*/
-void LLFloaterSocial::draw()
-{
-    LLFloater::draw();
-}
-
 void LLFloaterSocial::onOpen(const LLSD& key)
 {
-	LLSnapshotLivePreview* preview = static_cast<LLSnapshotLivePreview *>(mSocialPhotoPanel->mPreviewHandle.get());
+	LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView();
 	if(preview)
 	{
 		lldebugs << "opened, updating snapshot" << llendl;
@@ -541,14 +544,13 @@ void LLFloaterSocial::onOpen(const LLSD& key)
 // static
 void LLFloaterSocial::preUpdate()
 {
-	// FIXME: duplicated code
 	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
 	if (instance)
 	{
-		// Disable the send/post/save buttons until snapshot is ready.
+		//Will set file size text to 'unknown'
 		instance->mSocialPhotoPanel->updateControls();
 
-		// Force hiding the "Refresh to save" hint because we know we've just started refresh.
+		//Hides the refresh text
 		instance->mSocialPhotoPanel->setNeedRefresh(false);
 	}
 }
@@ -556,21 +558,22 @@ void LLFloaterSocial::preUpdate()
 // static
 void LLFloaterSocial::postUpdate()
 {
-	// FIXME: duplicated code
 	LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
 	if (instance)
 	{
-		// Enable the send/post/save buttons.
+		//Will set the file size text
 		instance->mSocialPhotoPanel->updateControls();
 
-		// We've just done refresh.
+		//Hides the refresh text
 		instance->mSocialPhotoPanel->setNeedRefresh(false);
 
 		// The refresh button is initially hidden. We show it after the first update,
-		// i.e. when preview appears.
-		if (!instance->mSocialPhotoPanel->mRefreshBtn->getVisible())
+		// i.e. after snapshot is taken
+		LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn();
+
+		if (!refresh_button->getVisible())
 		{
-			instance->mSocialPhotoPanel->mRefreshBtn->setVisible(true);
+			refresh_button->setVisible(true);
 		}
 		
 	}
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 6675a990f4..95ba688430 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -50,37 +50,40 @@ private:
 class LLSocialPhotoPanel : public LLPanel
 {
 
-	public:
+public:
 		LLSocialPhotoPanel();
 		~LLSocialPhotoPanel();
 
 		BOOL postBuild();
 		void draw();
-		void onSend();
 
-		const LLRect& getThumbnailPlaceholderRect() { return mThumbnailPlaceholder->getRect(); }
-		void onResolutionComboCommit();
+		LLSnapshotLivePreview* getPreviewView();
+		void onVisibilityChange(const LLSD& new_visibility);
 		void onClickNewSnapshot();
+		void onSend();
 
-		LLHandle<LLView> mPreviewHandle;
-
-		void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE);
-		void setNeedRefresh(bool need);
+		void updateControls();
+		void updateResolution(BOOL do_update);
 		void checkAspectRatio(S32 index);
-		LLSnapshotLivePreview* getPreviewView();
+		void setNeedRefresh(bool need);
+		LLUICtrl* getRefreshBtn();
 
-		void updateControls();
-		void onVisibilityChange(const LLSD& new_visibility);
+private:
+
+		LLHandle<LLView> mPreviewHandle;
 
+		LLUICtrl * mSnapshotPanel;
 		LLUICtrl * mResolutionComboBox;
-		LLUICtrl *mRefreshBtn, *mRefreshLabel;
-		LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
-		LLUICtrl* mThumbnailPlaceholder;
+		LLUICtrl * mRefreshBtn;
+		LLUICtrl * mRefreshLabel;
+		LLUICtrl * mSucceessLblPanel;
+		LLUICtrl * mFailureLblPanel;
+		LLUICtrl * mThumbnailPlaceholder;
+		LLUICtrl * mCaptionTextBox;
+		LLUICtrl * mLocationCheckbox;
+		LLUICtrl * mPostButton;
 
 		bool mNeedRefresh;
-
-private:
-	LLUICtrl* mPostButton;
 };
 
 class LLSocialCheckinPanel : public LLPanel
@@ -108,8 +111,6 @@ public:
 	BOOL postBuild();
 	void onCancel();
 	void onOpen(const LLSD& key);
-	/*virtual*/ void draw();
-
 
 	static void preUpdate();
 	static void postUpdate();
-- 
cgit v1.2.3


From 7d17bbe132cf0f799b703bba978d48d44a1377c4 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 28 Jun 2013 19:26:07 +0100
Subject: removed unused Me menu items for ACME-637

---
 indra/newview/llfloatersocial.cpp                  |  2 +-
 indra/newview/llviewermenu.cpp                     | 60 ----------------------
 indra/newview/llviewermenu.h                       |  9 ----
 indra/newview/skins/default/xui/en/menu_viewer.xml | 20 --------
 .../newview/skins/default/xui/en/notifications.xml | 21 --------
 .../default/xui/en/panel_snapshot_facebook.xml     |  4 +-
 6 files changed, 3 insertions(+), 113 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index dfc9024d54..d6c00b7c86 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -128,7 +128,7 @@ mCaptionTextBox(NULL),
 mLocationCheckbox(NULL),
 mPostButton(NULL)
 {
-	mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
+	mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this));
 }
 
 LLSocialPhotoPanel::~LLSocialPhotoPanel()
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 47787e2687..137eeb6a99 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5953,56 +5953,6 @@ void handle_report_abuse()
 	LLFloaterReporter::showFromMenu(COMPLAINT_REPORT);
 }
 
-void handle_facebook_connect()
-{
-	if (!LLFacebookConnect::instance().isConnected())
-	{
-        LLFacebookConnect::instance().getConnectionToFacebook(true);
-	}
-}
-
-bool enable_facebook_connect()
-{
-    // The menu item will be disabled if we are already connected
-    return !LLFacebookConnect::instance().isConnected();
-}
-
-void handle_facebook_checkin()
-{
-
-	// Get the location SLURL 
-	LLSLURL slurl;
-	LLAgentUI::buildSLURL(slurl);
-	std::string slurl_string = slurl.getSLURLString();
-
-	std::string region_name = gAgent.getRegion()->getName();
-	std::string description;
-	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
-	LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal();
-	int x_pos = center_agent[0] / 256.0;
-	int y_pos = center_agent[1] / 256.0;
-	std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos);
-
-	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, "");
-}
-
-bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response)
-{
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-	if (option == 0)
-	{
-		std::string message = response["message"].asString();
-		if (!message.empty())
-			LLFacebookConnect::instance().updateStatus(message);
-	}
-	return false;
-}
-
-void handle_facebook_status()
-{
-	LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2));
-}
-
 void handle_buy_currency()
 {
 	LLBuyCurrencyHTML::openCurrencyFloater();
@@ -8801,14 +8751,4 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");
 	view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
 	view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
-    
-    // Facebook Connect
-	commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
-	enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect));
-    
-	// Facebook Checkin
-	commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
-    
-	// Facebook Status Update
-	commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status));
 }
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index e71beef10d..143420e227 100755
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -135,15 +135,6 @@ bool enable_pay_object();
 bool enable_buy_object();
 bool handle_go_to();
 
-// Facebook Connect
-void handle_facebook_connect();
-
-// Facebook Checkin
-void handle_facebook_checkin();
-
-// Facebook Status Update
-void handle_facebook_status();
-
 // Export to XML or Collada
 void handle_export_selected( void * );
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 733eb16c54..6da4b3d234 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -15,26 +15,6 @@
          function="ShowAgentProfile"
          parameter="agent" />
       </menu_item_call>
-      <menu_item_call
-        label="Connect to Facebook..."
-        name="ConnectToFacebook">
-        <menu_item_call.on_click
-          function="Facebook.Connect" />
-        <menu_item_call.on_enable
-          function="Facebook.EnableConnect" />
-      </menu_item_call>
-      <menu_item_call
-        label="Check in to Facebook..."
-        name="CheckinToFacebook">
-        <menu_item_call.on_click
-          function="Facebook.Checkin" />
-      </menu_item_call>
-      <menu_item_call
-        label="Update status on Facebook..."
-        name="UpdateStatusOnFacebook">
-        <menu_item_call.on_click
-          function="Facebook.UpdateStatus" />
-      </menu_item_call>
       <menu_item_call
         label="Post to Facebook..."
         name="PostToFacebook">
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 5f4869e110..c8911e47e8 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -10135,25 +10135,4 @@ Cannot create large prims that intersect other players.  Please re-try when othe
      yestext="OK"/>
   </notification>
   
-  <notification
-   icon="alertmodal.tga"
-   name="FacebookUpdateStatus"
-   type="alertmodal">
-    What's on your mind? (asks Facebook)
-    <tag>confirm</tag>
-    <form name="form">
-      <input name="message" type="text">
-      </input>
-      <button
-       default="true"
-       index="0"
-       name="OK"
-       text="OK"/>
-      <button
-       index="1"
-       name="Cancel"
-       text="Cancel"/>
-    </form>
-  </notification>
-  
 </notifications>
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
index 2810f97ca6..7a89ed69b5 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
@@ -182,7 +182,7 @@
      top="350"
      width="100">
       <button.commit_callback
-       function="PostToFacebook.Cancel" />
+       function="SocialSharing.Cancel" />
     </button>
     <button
      follows="right|bottom"
@@ -194,6 +194,6 @@
      top_delta="0"
      width="100">
       <button.commit_callback
-       function="PostToFacebook.Send" />
+       function="SocialSharing.SendPhoto" />
     </button>
 </panel>
-- 
cgit v1.2.3


From 89ae19e57edc9abfd300b17caf2719d7794dabf9 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 28 Jun 2013 20:19:17 +0100
Subject: removed old error popups and added better logging for ACME-653

---
 indra/newview/llfacebookconnect.cpp                | 29 ++++++----------------
 .../newview/skins/default/xui/en/notifications.xml | 11 --------
 2 files changed, 8 insertions(+), 32 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 52268daa36..dc450aab7a 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -41,19 +41,12 @@
 
 
 // Local functions
-void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description)
+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 prompting the user
+    // Note: 302 (redirect) is *not* an error that warrants logging
     if (status != 302)
     {
-        LLSD args(LLSD::emptyMap());
-        std::stringstream msg;
-        msg << status;
-        args["STATUS"] = msg.str();
-		args["REASON"] = reason;
-		args["CODE"] = code;
-		args["DESCRIPTION"] = description;
-        LLNotificationsUtil::add("FacebookCannotConnect", args);
+		LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << "(" << description << ")" << LL_ENDL;
     }
 }
 
@@ -113,8 +106,7 @@ public:
 		else
 		{
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
-            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
-            LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+            log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description"));
 		}
 	}
     
@@ -147,8 +139,7 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
-            LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
+            log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description"));
 		}
 		
 		if (mShareCallback)
@@ -188,8 +179,7 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
-			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+            log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
 		}
 	}
 };
@@ -218,8 +208,6 @@ public:
 		}
 		else
 		{
-			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
-            
 			// show the facebook login page if not connected yet
 			if (status == 404)
 			{
@@ -235,7 +223,7 @@ public:
             else
             {
                 LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
-				prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
+				log_facebook_connect_error("Connected", status, reason, content.get("error_code"), content.get("error_description"));
             }
 		}
 	}
@@ -261,8 +249,7 @@ public:
 		}
 		else
 		{
-            prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
-			LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+            log_facebook_connect_error("Friends", status, reason, content.get("error_code"), content.get("error_description"));
 		}
 	}
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index c8911e47e8..1f20d3ab58 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5439,17 +5439,6 @@ This day cycle file references a missing sky file: [SKY].
 Sorry, the settings couldn't be applied to the region.  Leaving the region and then returning may help rectify the problem.  The reason given was: [FAIL_REASON]
   </notification>
 
-  <notification
-   functor="GenericAcknowledge"
-   icon="alertmodal.tga"
-   name="FacebookCannotConnect"
-   type="alertmodal">
-Connection to Facebook failed. Reason: [STATUS] [REASON] ([CODE] - [DESCRIPTION])
-    <usetemplate
-     name="okbutton"
-     yestext="OK"/>
-  </notification>
-    
   <notification
    functor="GenericAcknowledge"
    icon="alertmodal.tga"
-- 
cgit v1.2.3


From db5aba55b1d51f083dd61781c32c57c0b986909a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 28 Jun 2013 13:48:44 -0700
Subject: ACME-638: Removed LLSocialList class and FBC Test tab in the People
 panel.

---
 indra/newview/CMakeLists.txt                       |   2 -
 indra/newview/llpanelpeople.cpp                    |  32 -----
 indra/newview/llpanelpeople.h                      |   2 -
 indra/newview/llsociallist.cpp                     | 154 ---------------------
 indra/newview/llsociallist.h                       | 102 --------------
 .../newview/skins/default/xui/en/panel_people.xml  |  95 -------------
 6 files changed, 387 deletions(-)
 delete mode 100644 indra/newview/llsociallist.cpp
 delete mode 100644 indra/newview/llsociallist.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index a5ad2e4d4e..f593375aed 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -513,7 +513,6 @@ set(viewer_SOURCE_FILES
     llsky.cpp
     llslurl.cpp
     llsnapshotlivepreview.cpp
-    llsociallist.cpp
     llspatialpartition.cpp
     llspeakers.cpp
     llspeakingindicatormanager.cpp
@@ -1092,7 +1091,6 @@ set(viewer_HEADER_FILES
     llsky.h
     llslurl.h
     llsnapshotlivepreview.h
-    llsociallist.h
     llspatialpartition.h
     llspeakers.h
     llspeakingindicatormanager.h
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 92391f0537..d3493373f6 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -72,7 +72,6 @@
 #include "llviewermenu.h"			// for gMenuHolder
 #include "llvoiceclient.h"
 #include "llworld.h"
-#include "llsociallist.h"
 #include "llspeakers.h"
 #include "llfloaterwebcontent.h"
 
@@ -87,7 +86,6 @@ static const std::string FRIENDS_TAB_NAME	= "friends_panel";
 static const std::string GROUP_TAB_NAME		= "groups_panel";
 static const std::string RECENT_TAB_NAME	= "recent_panel";
 static const std::string BLOCKED_TAB_NAME	= "blocked_panel"; // blocked avatars
-static const std::string FBCTEST_TAB_NAME	= "fbctest_panel";
 static const std::string FBCTESTTWO_TAB_NAME	= "fbctesttwo_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
@@ -528,7 +526,6 @@ LLPanelPeople::LLPanelPeople()
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this));
 	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
-	mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this));
 	mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this));
 
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
@@ -648,13 +645,6 @@ BOOL LLPanelPeople::postBuild()
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
 
-    //===Temporary ========================================================================
-
-	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME);
-	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");
-    // Note: we use the same updater for both test lists (brute force but OK since it's temporary)
-	social_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2));
-
 	//===Test START========================================================================
 
 	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
@@ -1025,8 +1015,6 @@ LLUUID LLPanelPeople::getCurrentItemID() const
 	if (cur_tab == BLOCKED_TAB_NAME)
 		return LLUUID::null; // FIXME?
 	
-	if (cur_tab == FBCTEST_TAB_NAME)
-		return LLUUID::null;
 
 	if (cur_tab == FBCTESTTWO_TAB_NAME)
 		return LLUUID::null;
@@ -1054,8 +1042,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
 		mGroupList->getSelectedUUIDs(selected_uuids);
 	else if (cur_tab == BLOCKED_TAB_NAME)
 		selected_uuids.clear(); // FIXME?
-	else if (cur_tab == FBCTEST_TAB_NAME)
-		return;
 	else if (cur_tab == FBCTESTTWO_TAB_NAME)
 		return;
 	else
@@ -1695,22 +1681,4 @@ void LLPanelPeople::onFacebookAppSendClicked()
 {
 }
 
-static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test");
-
-void LLPanelPeople::onFacebookTestAddClicked()
-{
-	LLFastTimer _(FTM_AVATAR_LIST_TEST);
-
-	mFacebookFriends->clear();
-
-	LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL;
-
-	for(int i = 0; i < 300; ++i)
-	{
-		mFacebookFriends->addNewItem(LLUUID(), "Test", false);
-	}
-
-	LL_INFOS("LLPanelPeople") << "finished adding 300 users" << LL_ENDL;
-}
-
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 1cd2a05e91..cbfd74a2a0 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -35,7 +35,6 @@
 #include "llvoiceclient.h"
 
 class LLAvatarList;
-class LLAvatarListSocial;
 class LLAvatarName;
 class LLFilterEditor;
 class LLGroupList;
@@ -123,7 +122,6 @@ private:
 	void					onLoginFbcButtonClicked();
 	void					onFacebookAppRequestClicked();
 	void					onFacebookAppSendClicked();
-	void					onFacebookTestAddClicked();
 
 	bool					onFriendsViewSortMenuItemCheck(const LLSD& userdata);
 	bool					onRecentViewSortMenuItemCheck(const LLSD& userdata);
diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp
deleted file mode 100644
index 9f827cf04f..0000000000
--- a/indra/newview/llsociallist.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/** 
-* @file llsociallist.cpp
-* @brief Implementation of llsociallist
-* @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 "llsociallist.h"
-
-#include "llavataractions.h"
-#include "llfloaterreg.h"
-#include "llavatariconctrl.h"
-#include "llavatarnamecache.h"
-#include "lloutputmonitorctrl.h"
-#include "lltextutil.h"
-
-static LLDefaultChildRegistry::Register<LLSocialList> r("social_list");
-
-LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p)
-{
-
-}
-
-LLSocialList::~LLSocialList()
-{
-
-}
-
-void LLSocialList::draw()
-{
-	LLFlatListView::draw();
-}
-
-void LLSocialList::refresh()
-{
-
-}
-
-void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
-{
-	LLSocialListItem * item = new LLSocialListItem();
-	LLAvatarName avatar_name;
-	bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name);
-
-	item->mAvatarId = id;
-	if(id.notNull())
-	{
-		item->mIcon->setValue(id);
-	}
-
-	item->setName(has_avatar_name ? name + " (" + avatar_name.getDisplayName() + ")" : name, mNameFilter);
-	addItem(item, id, pos);
-}
-
-LLSocialListItem::LLSocialListItem()
-{
-	buildFromFile("panel_avatar_list_item.xml");
-}
-
-LLSocialListItem::~LLSocialListItem()
-{
-
-}
-
-BOOL LLSocialListItem::postBuild()
-{
-	mIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
-	mLabelTextBox = getChild<LLTextBox>("avatar_name");
-
-	mLastInteractionTime = getChild<LLTextBox>("last_interaction");
-	mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon");
-	mIconPermissionMap = getChild<LLIconCtrl>("permission_map_icon");
-	mIconPermissionEditMine = getChild<LLIconCtrl>("permission_edit_mine_icon");
-	mIconPermissionEditTheirs = getChild<LLIconCtrl>("permission_edit_theirs_icon");
-	mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
-	mInfoBtn = getChild<LLButton>("info_btn");
-	mProfileBtn = getChild<LLButton>("profile_btn");
-
-	mLastInteractionTime->setVisible(false);
-	mIconPermissionOnline->setVisible(false);
-	mIconPermissionMap->setVisible(false);
-	mIconPermissionEditMine->setVisible(false);
-	mIconPermissionEditTheirs->setVisible(false);
-	mSpeakingIndicator->setVisible(false);
-	mInfoBtn->setVisible(false);
-	mProfileBtn->setVisible(false);
-
-	mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this));
-	mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this));
-
-	return TRUE;
-}
-
-void LLSocialListItem::setName(const std::string& name, const std::string& highlight)
-{
-	mLabel = name;
-	LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight);
-}
-
-void LLSocialListItem::setValue(const LLSD& value)
-{
-	getChildView("selected_icon")->setVisible( value["selected"]);
-}
-
-void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask)
-{
-	getChildView("hovered_icon")->setVisible( true);
-	mInfoBtn->setVisible(true);
-	mProfileBtn->setVisible(true);
-
-	LLPanel::onMouseEnter(x, y, mask);
-}
-
-void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask)
-{
-	getChildView("hovered_icon")->setVisible( false);
-	mInfoBtn->setVisible(false);
-	mProfileBtn->setVisible(false);
-
-	LLPanel::onMouseLeave(x, y, mask);
-}
-
-void LLSocialListItem::onInfoBtnClick()
-{
-	LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId));
-}
-
-void LLSocialListItem::onProfileBtnClick()
-{
-	LLAvatarActions::showProfile(mAvatarId);
-}
diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h
deleted file mode 100644
index bc667fc400..0000000000
--- a/indra/newview/llsociallist.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/** 
-* @file   llsociallist.h
-* @brief  Header file for llsociallist
-* @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_LLSOCIALLIST_H
-#define LL_LLSOCIALLIST_H
-
-#include "llflatlistview.h"
-#include "llstyle.h"
-
-
-/**
- * Generic list of avatars.
- * 
- * Updates itself when it's dirty, using optional name filter.
- * To initiate update, modify the UUID list and call setDirty().
- * 
- * @see getIDs()
- * @see setDirty()
- * @see setNameFilter()
- */
-
-class LLAvatarIconCtrl;
-class LLIconCtrl;
-class LLOutputMonitorCtrl;
-
-class LLSocialList : public LLFlatListViewEx
-{
-public:
-
-	struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params>
-	{
-	};
-
-	LLSocialList(const Params&p);
-	virtual	~LLSocialList();
-
-	virtual void draw();
-	void refresh();
-	void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM);
-
-
-
-	std::string mNameFilter;
-};
-
-class LLSocialListItem : public LLPanel
-{
-	public:
-	LLSocialListItem();
-	~LLSocialListItem();
-
-	BOOL postBuild();
-	void setName(const std::string& name, const std::string& highlight = LLStringUtil::null);
-	void setValue(const LLSD& value);
-	void onMouseEnter(S32 x, S32 y, MASK mask);
-	void onMouseLeave(S32 x, S32 y, MASK mask);
-	void onInfoBtnClick();
-	void onProfileBtnClick();
-
-	LLUUID mAvatarId;
-
-	LLTextBox * mLabelTextBox;
-	std::string mLabel;
-	LLStyle::Params mLabelTextBoxStyle;
-
-
-	LLAvatarIconCtrl * mIcon;
-	LLTextBox * mLastInteractionTime;
-	LLIconCtrl * mIconPermissionOnline;
-	LLIconCtrl * mIconPermissionMap;
-	LLIconCtrl * mIconPermissionEditMine;
-	LLIconCtrl * mIconPermissionEditTheirs;
-	LLOutputMonitorCtrl * mSpeakingIndicator;
-	LLButton * mInfoBtn;
-	LLButton * mProfileBtn;
-};	
-
-
-#endif // LL_LLSOCIALLIST_H
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 451095c7d8..76124148a0 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -651,101 +651,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            right="-1" />
         </panel>
         
-<!-- ================================= FBC TEST tab (Temporary) ========================== -->
-        
-        <panel
-           background_opaque="true"
-           background_visible="true"
-           bg_alpha_color="DkGray"
-           bg_opaque_color="DkGray"
-           follows="all"
-           height="383"
-           label="FBC TEST"
-           layout="topleft"
-           left="0"
-           help_topic="people_fbctest_tab"
-           name="fbctest_panel"
-           top="0"
-           width="313">
-          <accordion
-                    background_visible="true"
-                    bg_alpha_color="DkGray2"
-                    bg_opaque_color="DkGray2"
-                      follows="all"
-                      height="356"
-                      layout="topleft"
-                      left="3"
-                      name="friends_accordion"
-                      top="0"
-                      width="307">
-            <accordion_tab
-             layout="topleft"
-             height="172"
-             min_height="150"
-             name="tab_facebook"
-             title="Facebook Friends">
-              <social_list
-               allow_select="true"
-               follows="all"
-               height="172"
-               layout="topleft"
-               left="0"
-               multi_select="true"
-               name="facebook_friends"
-               show_permissions_granted="true"
-               top="0"
-               width="307" />
-            </accordion_tab>
-          </accordion>
-          <panel
-           background_visible="true"
-           follows="left|right|bottom"
-           height="27"
-           label="bottom_panel"
-           layout="topleft"
-           left="3"
-           name="bottom_panel"
-           top_pad="0"
-           width="313">
-            <menu_button
-              follows="bottom|left"
-              tool_tip="Options"
-              height="25"
-              image_hover_unselected="Toolbar_Left_Over"
-              image_overlay="OptionsMenu_Off"
-              image_selected="Toolbar_Left_Selected"
-              image_unselected="Toolbar_Left_Off"
-              layout="topleft"
-              name="fbc_options_btn"
-              top="1"
-              width="31" />
-            <button
-               follows="bottom|left"
-               height="25"
-               image_hover_unselected="Toolbar_Middle_Over"
-               image_overlay="AddItem_Off"
-               image_selected="Toolbar_Middle_Selected"
-               image_unselected="Toolbar_Middle_Off"
-               layout="topleft"
-               left_pad="1"
-               name="fbc_login_btn"
-               tool_tip="Log in to FBC"
-               width="31">
-              <commit_callback
-                 function="People.loginFBC" />
-            </button>
-            <icon
-             follows="bottom|left|right"
-             height="25"
-             image_name="Toolbar_Right_Off"
-             layout="topleft"
-             left_pad="1"
-             name="dummy_icon"
-             width="244"
-             />
-          </panel>
-        </panel>
-        
 <!-- ================================= FBC TEST TWO tab (Final, to be renamed) ========================== -->
         
         <panel
-- 
cgit v1.2.3


From 8c36966a07a599269c3a0fa2fca2f8ba1844e06f Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 28 Jun 2013 14:06:29 -0700
Subject: ACME-638: Removing non-used variable

---
 indra/newview/llpanelpeople.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index cbfd74a2a0..55c2c3cdae 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -150,7 +150,6 @@ private:
 	LLAvatarList*			mNearbyList;
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
-	LLSocialList*			mFacebookFriends;
     S32                     mFacebookListGeneration;
 	LLNetMap*				mMiniMap;
 
-- 
cgit v1.2.3


From db8422f7841ab875c9dc636e10ae5993216d4a5b Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 28 Jun 2013 22:31:18 +0100
Subject: made sure photo preview is only generated when photo tab is visible
 for ACME-649

---
 indra/newview/llfloatersocial.cpp | 48 ++++++++++++++++++++-------------------
 indra/newview/llfloatersocial.h   |  1 -
 2 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d6c00b7c86..4660644969 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -246,20 +246,32 @@ LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
 void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
 {
 	bool visible = new_visibility.asBoolean();
-	if (visible && !mPreviewHandle.get())
+	if (visible)
 	{
-		LLRect full_screen_rect = getRootView()->getRect();
-		LLSnapshotLivePreview::Params p;
-		p.rect(full_screen_rect);
-		LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
-		mPreviewHandle = previewp->getHandle();	
-
-		previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
-		previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
-		//previewp->setSnapshotQuality(98);
-		previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
-
-		updateControls();
+		if (mPreviewHandle.get())
+		{
+			LLSnapshotLivePreview* preview = getPreviewView();
+			if(preview)
+			{
+				lldebugs << "opened, updating snapshot" << llendl;
+				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();	
+
+			previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+			previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+			//previewp->setSnapshotQuality(98);
+			previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
+
+			updateControls();
+		}
 	}
 }
 
@@ -531,16 +543,6 @@ BOOL LLFloaterSocial::postBuild()
 	return LLFloater::postBuild();
 }
 
-void LLFloaterSocial::onOpen(const LLSD& key)
-{
-	LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView();
-	if(preview)
-	{
-		lldebugs << "opened, updating snapshot" << llendl;
-		preview->updateSnapshot(TRUE);
-	}
-}
-
 // static
 void LLFloaterSocial::preUpdate()
 {
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 95ba688430..89b9e2016a 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -110,7 +110,6 @@ public:
 	LLFloaterSocial(const LLSD& key);
 	BOOL postBuild();
 	void onCancel();
-	void onOpen(const LLSD& key);
 
 	static void preUpdate();
 	static void postUpdate();
-- 
cgit v1.2.3


From 1c7a7fe2d1c3f9399a6248551b7b2a8a7e68afdd Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 28 Jun 2013 23:08:03 +0100
Subject: removed FB photo sharing from snapshot floater for ACME-639

---
 indra/newview/CMakeLists.txt                       |   1 -
 indra/newview/llpanelsnapshotfacebook.cpp          | 139 --------------
 indra/newview/llpanelsnapshotoptions.cpp           |   7 -
 .../skins/default/xui/en/floater_snapshot.xml      |   6 -
 .../default/xui/en/panel_snapshot_facebook.xml     | 199 ---------------------
 .../default/xui/en/panel_snapshot_options.xml      |  19 --
 6 files changed, 371 deletions(-)
 delete mode 100755 indra/newview/llpanelsnapshotfacebook.cpp
 delete mode 100755 indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f593375aed..3d6d315454 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -438,7 +438,6 @@ set(viewer_SOURCE_FILES
     llpanelprimmediacontrols.cpp
     llpanelprofile.cpp
     llpanelsnapshot.cpp
-    llpanelsnapshotfacebook.cpp
     llpanelsnapshotinventory.cpp
     llpanelsnapshotlocal.cpp
     llpanelsnapshotoptions.cpp
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
deleted file mode 100755
index 94fbb986c0..0000000000
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/** 
- * @file llpanelsnapshotfacebook.cpp
- * @brief Posts a snapshot to the resident Facebook account.
- *
- * $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"
-
-// libs
-#include "llcombobox.h"
-#include "llfloaterreg.h"
-#include "llpanel.h"
-#include "llspinctrl.h"
-
-// newview
-#include "llfloatersnapshot.h"
-#include "llpanelsnapshot.h"
-#include "llsidetraypanelcontainer.h"
-#include "llwebprofile.h"
-
-#include "llfacebookconnect.h"
-#include "llslurl.h"
-#include "llagentui.h"
-
-/**
- * Posts a snapshot to the resident Facebook account.
- */
-class LLPanelSnapshotFacebook
-:	public LLPanelSnapshot
-{
-	LOG_CLASS(LLPanelSnapshotFacebook);
-
-public:
-	LLPanelSnapshotFacebook();
-
-	/*virtual*/ BOOL postBuild();
-	/*virtual*/ void onOpen(const LLSD& key);
-
-private:
-	/*virtual*/ void updateCustomResControls(); ///< Show/hide facebook custom controls
-	/*virtual*/ std::string getWidthSpinnerName() const		{ return "facebook_snapshot_width"; }
-	/*virtual*/ std::string getHeightSpinnerName() const	{ return "facebook_snapshot_height"; }
-	/*virtual*/ std::string getAspectRatioCBName() const	{ return "facebook_keep_aspect_check"; }
-	/*virtual*/ std::string getImageSizeComboName() const	{ return "facebook_size_combo"; }
-	/*virtual*/ std::string getImageSizePanelName() const	{ return "facebook_image_size_lp"; }
-	/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; }
-	/*virtual*/ void updateControls(const LLSD& info);
-
-	void onSend();
-	void onImageUploaded(const std::string& caption, const std::string& image_url);
-};
-
-static LLRegisterPanelClassWrapper<LLPanelSnapshotFacebook> panel_class("llpanelsnapshotfacebook");
-
-LLPanelSnapshotFacebook::LLPanelSnapshotFacebook()
-{
-	mCommitCallbackRegistrar.add("PostToFacebook.Send",		boost::bind(&LLPanelSnapshotFacebook::onSend,		this));
-	mCommitCallbackRegistrar.add("PostToFacebook.Cancel",	boost::bind(&LLPanelSnapshotFacebook::cancel,		this));
-}
-
-// virtual
-BOOL LLPanelSnapshotFacebook::postBuild()
-{
-	return LLPanelSnapshot::postBuild();
-}
-
-// virtual
-void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
-{
-	if (!LLFacebookConnect::instance().isConnected())
-	{
-        LLFacebookConnect::instance().getConnectionToFacebook(true);
-	}
-	updateControls(key);
-	LLPanelSnapshot::onOpen(key);
-}
-
-// virtual
-void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
-{
-	const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
-    const bool is_connected = LLFacebookConnect::instance().isConnected();
-	getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot && is_connected);
-}
-
-// virtual
-void LLPanelSnapshotFacebook::updateCustomResControls()
-{
-    LLPanelSnapshot::updateCustomResControls();
-    const bool is_connected = LLFacebookConnect::instance().isConnected();
-	getChild<LLUICtrl>("post_btn")->setEnabled(is_connected);
-}
-
-void LLPanelSnapshotFacebook::onSend()
-{
-	std::string caption = getChild<LLUICtrl>("caption")->getValue().asString();
-	bool add_location = getChild<LLUICtrl>("add_location_cb")->getValue().asBoolean();
-	
-	if (add_location)
-	{
-		LLSLURL slurl;
-		LLAgentUI::buildSLURL(slurl);
-		if (caption.empty())
-			caption = slurl.getSLURLString();
-		else
-			caption = caption + " " + slurl.getSLURLString();
-	}
-	LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption);
-	//LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1));
-	LLFloaterSnapshot::postSave();
-}
-
-void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url)
-{
-	if (!image_url.empty())
-	{
-		LLFacebookConnect::instance().sharePhoto(image_url, caption);
-	}
-}
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 14953f3cf9..554fabe5b3 100755
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -51,7 +51,6 @@ private:
 	void updateUploadCost();
 	void openPanel(const std::string& panel_name);
 	void onSaveToProfile();
-	void onSaveToFacebook();
 	void onSaveToEmail();
 	void onSaveToInventory();
 	void onSaveToComputer();
@@ -61,7 +60,6 @@ static LLRegisterPanelClassWrapper<LLPanelSnapshotOptions> panel_class("llpanels
 
 LLPanelSnapshotOptions::LLPanelSnapshotOptions()
 {
-	mCommitCallbackRegistrar.add("Snapshot.SaveToFacebook",		boost::bind(&LLPanelSnapshotOptions::onSaveToFacebook,	this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToProfile",		boost::bind(&LLPanelSnapshotOptions::onSaveToProfile,	this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToEmail",		boost::bind(&LLPanelSnapshotOptions::onSaveToEmail,		this));
 	mCommitCallbackRegistrar.add("Snapshot.SaveToInventory",	boost::bind(&LLPanelSnapshotOptions::onSaveToInventory,	this));
@@ -101,11 +99,6 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
 	LLFloaterSnapshot::postPanelSwitch();
 }
 
-void LLPanelSnapshotOptions::onSaveToFacebook()
-{
-	openPanel("panel_snapshot_facebook");
-}
-
 void LLPanelSnapshotOptions::onSaveToProfile()
 {
 	openPanel("panel_snapshot_profile");
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index e8e7fb77c1..853c209bca 100755
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -268,12 +268,6 @@
        left="0"
        name="panel_snapshot_options"
        top="0" />
-      <panel
-       class="llpanelsnapshotfacebook"
-       follows="all"
-       layout="topleft"
-       name="panel_snapshot_facebook"
-       filename="panel_snapshot_facebook.xml" />
       <panel
        class="llpanelsnapshotprofile"
        follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
deleted file mode 100755
index 7a89ed69b5..0000000000
--- a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
+++ /dev/null
@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- height="380"
- layout="topleft"
- name="panel_snapshot_facebook"
- width="490">
-    <icon
-     follows="top|left"
-     height="18"
-     image_name="Snapshot_Facebook"
-     layout="topleft"
-     left="12"
-     mouse_opaque="true"
-     name="title_icon"
-     top="5"
-     width="18" />
-    <text
-     follows="top|left|right"
-     font="SansSerifBold"
-     height="20"
-     layout="topleft"
-     left_pad="12"
-     length="1"
-     name="title"
-     right="-10"
-     text_color="white"
-     type="string"
-     top_delta="4">
-        Post to my Facebook timeline
-    </text>
-    <view_border 
-     bevel_style="in"
-     follows="left|top|right" 
-     height="1"
-     left="10"
-     layout="topleft"
-     name="hr"
-     right="-10"
-     top_pad="5"
-     />
-    <combo_box
-     follows="left|top"
-     height="23"
-     label="Resolution"
-     layout="topleft"
-     left_delta="0"
-     name="facebook_size_combo"
-     top_pad="10"
-     width="250">
-        <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="Custom"
-         name="Custom"
-         value="[i-1,i-1]" />
-    </combo_box>
-    <layout_stack
-     animate="false"
-     follows="all"
-     height="270"
-     layout="bottomleft"
-     name="facebook_image_params_ls"
-     left_delta="0"
-     orientation="vertical"
-     top_pad="10"
-     right="-10">
-        <layout_panel
-         follows="top|left|right"
-         height="55"
-         layout="topleft"
-         left="0"
-         name="facebook_image_size_lp"
-         auto_resize="false"
-         top="0"
-         right="-1"
-         visible="true">
-            <spinner
-             allow_text_entry="false"
-             decimal_digits="0"
-             follows="left|top"
-             height="20"
-             increment="32"
-             label="Width"
-             label_width="40"
-             layout="topleft"
-             left="10"
-             max_val="6016"
-             min_val="32"
-             name="facebook_snapshot_width"
-             top_pad="10"
-             width="95" />
-            <spinner
-             allow_text_entry="false"
-             decimal_digits="0"
-             follows="left|top"
-             height="20"
-             increment="32"
-             label="Height"
-             label_width="40"
-             layout="topleft"
-             left_pad="5"
-             max_val="6016"
-             min_val="32"
-             name="facebook_snapshot_height"
-             top_delta="0"
-             width="95" />
-            <check_box
-              height="10"
-             bottom_delta="20"
-             label="Constrain proportions"
-             layout="topleft"
-             left="10"
-             name="facebook_keep_aspect_check" />
-        </layout_panel>
-        <layout_panel
-         follows="top|left|right"
-         height="200"
-         layout="topleft"
-         left="0"
-         name="facebook_image_metadata_lp"
-         auto_resize="true"
-         top="0"
-         right="-1"
-         visible="true">
-            <text
-             length="1"
-             follows="top|left|right"
-             font="SansSerif"
-             height="16"
-             layout="topleft"
-             left="0"
-             name="caption_label"
-             right="-10"
-             top_pad="0"
-             type="string">
-                Caption:
-            </text>
-            <text_editor
-             follows="all"
-             height="155"
-             layout="topleft"
-             left_delta="0"
-             length="1"
-             max_length="700"
-             name="caption"
-             right="-10"
-             top_pad="5"
-             type="string"
-             word_wrap="true">
-            </text_editor>
-            <check_box
-             follows="left|bottom"
-             initial_value="true"
-             label="Include location"
-             layout="topleft"
-             left_delta="0"
-             name="add_location_cb"
-             top_pad="15" />
-        </layout_panel>
-    </layout_stack>
-    <button
-     follows="right|bottom"
-     height="23"
-     label="Cancel"
-     layout="topleft"
-     name="cancel_btn"
-     right="-32"
-     top="350"
-     width="100">
-      <button.commit_callback
-       function="SocialSharing.Cancel" />
-    </button>
-    <button
-     follows="right|bottom"
-     height="23"
-     label="Post"
-     layout="topleft"
-     left_delta="-106"
-     name="post_btn"
-     top_delta="0"
-     width="100">
-      <button.commit_callback
-       function="SocialSharing.SendPhoto" />
-    </button>
-</panel>
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 8cf5bfb426..61c8c971c2 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -5,25 +5,6 @@
  layout="topleft"
  name="panel_snapshot_options"
  width="490">
- <button
-  follows="left|top|right"
-  font="SansSerif"
-  halign="left"
-  height="38"
-  image_overlay="Snapshot_Facebook"
-  image_overlay_alignment="left"
-  image_top_pad="-2"
-  imgoverlay_label_space="10"
-  label="Post to my Facebook timeline"
-  layout="topleft"
-  left="10"
-  name="save_to_facebook_btn"
-  pad_left="10"
-  right="-10"
-  top="5">
-  <button.commit_callback
-   function="Snapshot.SaveToFacebook" />
-  </button>
   <button
    follows="left|top|right"
    font="SansSerif"
-- 
cgit v1.2.3


From a32522b99a9e9f98a689f07344f4fad0fc221d06 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 28 Jun 2013 15:23:07 -0700
Subject: ACME-638: Removing the personfolderview, personmodelcommon and
 persontabview. Also removing FBC Test Two tab from the 'People' panel.

---
 indra/newview/CMakeLists.txt                       |   6 -
 indra/newview/llpanelpeople.cpp                    | 121 ------
 indra/newview/llpanelpeople.h                      |  11 -
 indra/newview/llpersonfolderview.cpp               | 149 -------
 indra/newview/llpersonfolderview.h                 |  70 ----
 indra/newview/llpersonmodelcommon.cpp              | 313 --------------
 indra/newview/llpersonmodelcommon.h                | 248 -----------
 indra/newview/llpersontabview.cpp                  | 465 ---------------------
 indra/newview/llpersontabview.h                    | 151 -------
 .../newview/skins/default/xui/en/panel_people.xml  | 100 -----
 10 files changed, 1634 deletions(-)
 delete mode 100644 indra/newview/llpersonfolderview.cpp
 delete mode 100644 indra/newview/llpersonfolderview.h
 delete mode 100644 indra/newview/llpersonmodelcommon.cpp
 delete mode 100644 indra/newview/llpersonmodelcommon.h
 delete mode 100644 indra/newview/llpersontabview.cpp
 delete mode 100644 indra/newview/llpersontabview.h

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f593375aed..1f43debe1b 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -467,9 +467,6 @@ set(viewer_SOURCE_FILES
     llpathfindingobjectlist.cpp
     llpathfindingpathtool.cpp
     llpersistentnotificationstorage.cpp
-    llpersonfolderview.cpp
-    llpersonmodelcommon.cpp
-    llpersontabview.cpp
     llphysicsmotion.cpp
     llphysicsshapebuilderutil.cpp
     llpipelinelistener.cpp
@@ -1044,9 +1041,6 @@ set(viewer_HEADER_FILES
     llpathfindingobjectlist.h
     llpathfindingpathtool.h
     llpersistentnotificationstorage.h
-    llpersonfolderview.h
-    llpersonmodelcommon.h
-    llpersontabview.h
     llphysicsmotion.h
     llphysicsshapebuilderutil.h
     llpipelinelistener.h
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index d3493373f6..457ccb8285 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -63,9 +63,6 @@
 #include "llnetmap.h"
 #include "llpanelpeoplemenus.h"
 #include "llparticipantlist.h"
-#include "llpersonfolderview.h"
-#include "llpersonmodelcommon.h"
-#include "llpersontabview.h"
 #include "llsidetraypanelcontainer.h"
 #include "llrecentpeople.h"
 #include "llviewercontrol.h"		// for gSavedSettings
@@ -86,7 +83,6 @@ static const std::string FRIENDS_TAB_NAME	= "friends_panel";
 static const std::string GROUP_TAB_NAME		= "groups_panel";
 static const std::string RECENT_TAB_NAME	= "recent_panel";
 static const std::string BLOCKED_TAB_NAME	= "blocked_panel"; // blocked avatars
-static const std::string FBCTESTTWO_TAB_NAME	= "fbctesttwo_panel";
 static const std::string COLLAPSED_BY_USER  = "collapsed_by_user";
 
 
@@ -507,7 +503,6 @@ public:
 
 LLPanelPeople::LLPanelPeople()
 	:	LLPanel(),
-		mPersonFolderView(NULL),
 		mTryToConnectToFbc(true),
 		mTabContainer(NULL),
 		mOnlineFriendList(NULL),
@@ -526,7 +521,6 @@ LLPanelPeople::LLPanelPeople()
 	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this));
 	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
-	mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this));
 
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.AddFriendWizard",	boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked,	this));
@@ -645,47 +639,6 @@ BOOL LLPanelPeople::postBuild()
 	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 	mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
 
-	//===Test START========================================================================
-
-	LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME);
-	socialtwo_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2));
-
-	//Create folder view
-	LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel);
-
-	LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLPersonFolderView>());
-    
-	folder_view_params.parent_panel = socialtwo_tab;
-	folder_view_params.listener = base_item;
-	folder_view_params.view_model = &mPersonFolderViewModel;
-	folder_view_params.root = NULL;
-	folder_view_params.use_ellipses = true;
-	folder_view_params.use_label_suffix = true;
-	folder_view_params.options_menu = "menu_conversation.xml";
-	folder_view_params.name = "fbcfolderview";
-	mPersonFolderView = LLUICtrlFactory::create<LLPersonFolderView>(folder_view_params);
-
-	//Create scroller
-	LLRect scroller_view_rect = socialtwo_tab->getRect();
-	scroller_view_rect.mTop -= 2+27; // 27 is the height of the top toolbar
-	scroller_view_rect.mRight -= 4;
-	scroller_view_rect.mLeft += 2;
-	LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams<LLFolderViewScrollContainer>());
-	scroller_params.rect(scroller_view_rect);
-
-	LLScrollContainer* scroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
-	socialtwo_tab->addChildInBack(scroller);
-	scroller->addChild(mPersonFolderView);
-	scroller->setFollowsAll();
-	mPersonFolderView->setScrollContainer(scroller);
-	mPersonFolderView->setFollowsAll();
-	
-	gIdleCallbacks.addFunction(idle, this);
-
-	//===Test END========================================================================
-
-
-
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
 	setSortOrder(mNearbyList,		(ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"),	false);
@@ -765,12 +718,6 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI,
 	updateButtons();
 }
 
-void LLPanelPeople::idle(void * user_data)
-{
-	LLPanelPeople * self = static_cast<LLPanelPeople *>(user_data);
-	self->mPersonFolderView->update();
-}
-
 void LLPanelPeople::updateFriendListHelpText()
 {
 	// show special help text for just created account to help finding friends. EXT-4836
@@ -1014,11 +961,6 @@ LLUUID LLPanelPeople::getCurrentItemID() const
 
 	if (cur_tab == BLOCKED_TAB_NAME)
 		return LLUUID::null; // FIXME?
-	
-
-	if (cur_tab == FBCTESTTWO_TAB_NAME)
-		return LLUUID::null;
-
 
 	llassert(0 && "unknown tab selected");
 	return LLUUID::null;
@@ -1042,8 +984,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
 		mGroupList->getSelectedUUIDs(selected_uuids);
 	else if (cur_tab == BLOCKED_TAB_NAME)
 		selected_uuids.clear(); // FIXME?
-	else if (cur_tab == FBCTESTTWO_TAB_NAME)
-		return;
 	else
 		llassert(0 && "unknown tab selected");
 
@@ -1167,11 +1107,6 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
 	{
 		mRecentList->setNameFilter(filter);
 	}
-    else if (cur_tab == FBCTESTTWO_TAB_NAME)
-    {
-        mPersonFolderViewModel.getFilter().setFilterSubString(filter);
-        mPersonFolderView->requestArrange();
-    }
 }
 
 void LLPanelPeople::onTabSelected(const LLSD& param)
@@ -1605,62 +1540,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
-void LLPanelPeople::addTestParticipant()
-{
-    std::string suffix("Aa");
-    std::string prefix("FB Name");
-	LLPersonTabModel * person_tab_model;
-	LLUUID agentID;
-	std::string name;
-	LLPersonTabModel::tab_type tab_type;
-
-	for(int i = 0; i < 300; ++i)
-	{
-		//Adds FB+SL people that aren't yet SL friends
-		if(i < 10)
-		{
-			tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;	
-			agentID = gAgent.getID();
-		}
-		//Adds FB only friends
-		else
-		{
-			tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
-			agentID = LLUUID(NULL);
-		}
-
-		person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
-        name = prefix + " " + suffix;
-		addParticipantToModel(person_tab_model, agentID, name);
-        // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ...
-        suffix[1]+=1;
-        if (suffix[1]=='{')
-        {
-            suffix[1]='a';
-            suffix[0]+=1;
-            if (suffix[0]=='[')
-                suffix[0]='A';
-        }
-	}
-}
-
-void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model, const LLUUID& agent_id, const std::string& name)
-{
-	LLPersonModel* person_model = NULL;
-
-	LLAvatarName avatar_name;
-	bool has_name = agent_id.notNull() ? LLAvatarNameCache::get(agent_id, &avatar_name) : false;
-	std::string avatar_name_string;
-	
-	if(has_name)
-	{
-		avatar_name_string = avatar_name.getDisplayName();
-	}
-
-	person_model = new LLPersonModel(agent_id, avatar_name_string, name, mPersonFolderViewModel);
-	person_folder_model->addParticipant(person_model);
-}
-
 void LLPanelPeople::onLoginFbcButtonClicked()
 {
 	if (LLFacebookConnect::instance().isConnected())
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 55c2c3cdae..db8eddb376 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -30,7 +30,6 @@
 #include <llpanel.h>
 
 #include "llcallingcard.h" // for avatar tracker
-#include "llpersonmodelcommon.h"
 #include "llfloaterwebcontent.h"
 #include "llvoiceclient.h"
 
@@ -38,8 +37,6 @@ class LLAvatarList;
 class LLAvatarName;
 class LLFilterEditor;
 class LLGroupList;
-class LLPersonFolderView;
-class LLSocialList;
 class LLMenuButton;
 class LLTabContainer;
 
@@ -59,11 +56,6 @@ public:
 	// when voice is available
 	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
 
-	static void idle(void * user_data);
-
-	void addTestParticipant();
-	void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name);
-	
     bool mTryToConnectToFbc;
 
 	// internals
@@ -165,9 +157,6 @@ private:
 	Updater*				mButtonsUpdater;
 	LLMenuButton*			mFBCGearButton;
     LLHandle< LLFloater >	mPicker;
-
-	LLPersonFolderViewModel mPersonFolderViewModel;
-	LLPersonFolderView* mPersonFolderView;
 };
 
 #endif //LL_LLPANELPEOPLE_H
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
deleted file mode 100644
index 7e969fc96c..0000000000
--- a/indra/newview/llpersonfolderview.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/** 
-* @file llpersonfolderview.cpp
-* @brief Implementation of llpersonfolderview
-* @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 "llpersonfolderview.h"
-
-#include "llpersontabview.h"
-
-
-LLPersonFolderView::LLPersonFolderView(const Params &p) : 
-LLFolderView(p),
-	mConversationsEventStream("ConversationsEventsTwo")
-{
-    rename("Persons");  // For tracking!
-	mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1));
-
-	createPersonTabs();
-}
-
-LLPersonFolderView::~LLPersonFolderView()
-{
-	mConversationsEventStream.stopListening("ConversationsRefresh");
-}
-
-BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
-{
-	LLFolderViewItem * item = getCurSelectedItem();
-
-	//Will disable highlight on tab
-	if(item)
-	{
-		LLPersonTabView * person_tab= dynamic_cast<LLPersonTabView *>(item);
-		if(person_tab)
-		{
-			person_tab->highlight = false;
-		}
-		else
-		{
-			person_tab = dynamic_cast<LLPersonTabView *>(item->getParent());
-			person_tab->highlight = false;
-		}
-	}
-
-	mKeyboardSelection = FALSE; 
-	mSearchString.clear();
-
-	LLEditMenuHandler::gEditMenuHandler = this;
-
-	return LLView::handleMouseDown( x, y, mask );
-}
-
-void LLPersonFolderView::createPersonTabs()
-{
-	createPersonTab(LLPersonTabModel::FB_SL_NON_SL_FRIEND, "SL residents you may want to friend");
-	createPersonTab(LLPersonTabModel::FB_ONLY_FRIEND, "Invite people you know to SL");
-}
-
-void LLPersonFolderView::createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name)
-{
-	//Create a person tab
-	LLPersonTabModel* item = new LLPersonTabModel(tab_type, tab_name, *mViewModel);
-	LLPersonTabView::Params params;
-	params.name = item->getDisplayName();
-	params.root = this;
-	params.listener = item;
-	params.tool_tip = params.name;
-	LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
-	widget->addToFolder(this);
-
-	mIndexToFolderMap[tab_type] = item->getID();
-	mPersonFolderModelMap[item->getID()] = item;
-	mPersonFolderViewMap[item->getID()] = widget;
-}
-
-bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
-{
-	std::string type = event.get("type").asString();
-	LLUUID folder_id = event.get("folder_id").asUUID();
-	LLUUID person_id = event.get("person_id").asUUID();
-
-	if(type == "add_participant")
-	{
-		LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]);
-		LLPersonTabView * person_tab_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[folder_id]);
-
-		if(person_tab_model)
-		{
-			LLPersonModel * person_model = person_tab_model->findParticipant(person_id);
-
-			if(person_model)
-			{
-				LLPersonView * person_view = createConversationViewParticipant(person_model);
-				person_view->addToFolder(person_tab_view);
-			}
-		}
-	}
-
-	return false;
-}
-
-LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonModel * item)
-{
-	LLPersonView::Params params;
-
-	params.name = item->getDisplayName();
-	params.root = this;
-	params.listener = item;
-
-	//24 should be loaded from .xml somehow
-	params.rect = LLRect (0, 24, getRect().getWidth(), 0);
-	params.tool_tip = params.name;
-
-	return LLUICtrlFactory::create<LLPersonView>(params);
-}
-
-LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type)
-{
-	return mPersonFolderModelMap[mIndexToFolderMap[tab_type]];
-}
-
-LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type)
-{
-	return mPersonFolderViewMap[mIndexToFolderMap[tab_type]];
-}
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
deleted file mode 100644
index 85dec6515d..0000000000
--- a/indra/newview/llpersonfolderview.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/** 
-* @file   llpersonfolderview.h
-* @brief  Header file for llpersonfolderview
-* @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_LLPERSONFOLDERVIEW_H
-#define LL_LLPERSONFOLDERVIEW_H
-
-#include "llevents.h"
-#include "llfolderview.h"
-#include "llpersonmodelcommon.h"
-
-class LLPersonTabView;
-class LLPersonView;
-class LLPersonModel;
-
-typedef std::map<LLUUID, LLPersonTabModel *> person_folder_model_map;
-typedef std::map<LLUUID, LLPersonTabView *> person_folder_view_map;
-
-class LLPersonFolderView : public LLFolderView
-{
-public:
-	struct Params : public LLInitParam::Block<Params, LLFolderView::Params>
-	{
-		Params()
-		{}
-	};
-
-	LLPersonFolderView(const Params &p);
-	~LLPersonFolderView();
-
-	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
-	
-	void createPersonTabs();
-	void createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name);
-	bool onConversationModelEvent(const LLSD &event);
-	LLPersonView * createConversationViewParticipant(LLPersonModel * item);
-
-	LLPersonTabModel * getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type);
-	LLPersonTabView * getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type);
-
-	person_folder_model_map mPersonFolderModelMap;
-	person_folder_view_map mPersonFolderViewMap;
-	std::map<LLPersonTabModel::tab_type, LLUUID> mIndexToFolderMap;
-	LLEventStream mConversationsEventStream;
-};
-
-#endif // LL_LLPERSONFOLDERVIEW_H
-
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp
deleted file mode 100644
index 73239dcb8d..0000000000
--- a/indra/newview/llpersonmodelcommon.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-/** 
-* @file llavatarfolder.cpp
-* @brief Implementation of llavatarfolder
-* @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 "llpersonmodelcommon.h"
-
-#include "llevents.h"
-#include "llsdutil.h"
-#include "llstring.h"
-
-//
-// LLPersonModelCommon
-// 
-
-LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) :
-    LLFolderViewModelItemCommon(root_view_model),
-	mLabelSuffix(""),
-	mID(LLUUID().generateNewID())
-{
-    renameItem(display_name);
-}
-
-LLPersonModelCommon::LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model) :
-LLFolderViewModelItemCommon(root_view_model),
-	mID(LLUUID().generateNewID())
-{
-	mLabelSuffix = suffix;
-	renameItem(display_name);
-}
-
-LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) :
-    LLFolderViewModelItemCommon(root_view_model),
-	mName(""),
-	mLabelSuffix(""),
-    mSearchableName(""),
-    mPrevPassedAllFilters(false),
-	mID(LLUUID().generateNewID())
-{
-}
-
-LLPersonModelCommon::~LLPersonModelCommon()
-{
-
-}
-
-BOOL LLPersonModelCommon::renameItem(const std::string& new_name)
-{
-    mName = new_name;
-    mSearchableName = new_name + " " + mLabelSuffix;
-    LLStringUtil::toUpper(mSearchableName);
-    return TRUE;
-}
-
-void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person)
-{
-	LLUUID folder_id = folder->getID();
-	LLUUID person_id = person->getID();
-	LLSD event(LLSDMap("type", event_type)("folder_id", folder_id)("person_id", person_id));
-	LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event);
-}
-
-// Virtual action callbacks
-void LLPersonModelCommon::performAction(LLInventoryModel* model, std::string action)
-{
-}
-
-void LLPersonModelCommon::openItem( void )
-{
-}
-
-void LLPersonModelCommon::closeItem( void )
-{
-}
-
-void LLPersonModelCommon::previewItem( void )
-{
-}
-
-void LLPersonModelCommon::showProperties(void)
-{
-}
-
-bool LLPersonModelCommon::filter( LLFolderViewFilter& filter)
-{
-/*
- Hack: for the moment, we always apply the filter if we're called
-    if (!filter.isModified())
-    {
-        llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl;
-        return true;
-    }
- */
-    if (!mChildren.empty())
-    {
-        // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders)
-        setPassedFilter(1, filter.getCurrentGeneration());
-        // Call filter recursively on all children
-        for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end();
-            iter != end_iter;
-            ++iter)
-        {
-            LLPersonModelCommon* item = dynamic_cast<LLPersonModelCommon*>(*iter);
-            item->filter(filter);
-        }
-    }
-    else
-    {
-        // If there's no children, the current instance is a person and we check and set the passed filter flag on it
-        const bool passed_filter = filter.check(this);
-        setPassedFilter(passed_filter, filter.getCurrentGeneration(), filter.getStringMatchOffset(this), filter.getFilterStringSize());
-    }
-    
-    filter.clearModified();
-    return true;
-}
-
-void LLPersonModelCommon::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size)
-{
-	LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size);
-	bool before = mPrevPassedAllFilters;
-	mPrevPassedAllFilters = passedFilter(filter_generation);
-    
-    if (before != mPrevPassedAllFilters)
-	{
-        // Need to rearrange the folder if the filtered state of the item changed
-		LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder();
-		if (parent_folder)
-		{
-			parent_folder->requestArrange();
-		}
-	}
-}
-
-
-//
-// LLPersonTabModel
-// 
-
-LLPersonTabModel::LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(display_name,root_view_model),
-mTabType(tab_type)
-{
-
-}
-
-LLPersonTabModel::LLPersonTabModel(LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(root_view_model)
-{
-
-}
-
-void LLPersonTabModel::addParticipant(LLPersonModel* participant)
-{
-	addChild(participant);
-	postEvent("add_participant", this, participant);
-}
-
-void LLPersonTabModel::removeParticipant(LLPersonModel* participant)
-{
-	removeChild(participant);
-	postEvent("remove_participant", this, participant);
-}
-
-void LLPersonTabModel::removeParticipant(const LLUUID& participant_id)
-{
-	LLPersonModel* participant = findParticipant(participant_id);
-	if (participant)
-	{
-		removeParticipant(participant);
-	}
-}
-
-void LLPersonTabModel::clearParticipants()
-{
-	clearChildren();
-}
-
-LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id)
-{
-	LLPersonModel * person_model = NULL;
-	child_list_t::iterator iter;
-
-	for(iter = mChildren.begin(); iter != mChildren.end(); ++iter)
-	{
-		person_model = static_cast<LLPersonModel *>(*iter);
-
-		if(person_model->getID() == person_id)
-		{
-			break;
-		}
-	}
-
-	return iter == mChildren.end() ? NULL : person_model;
-}
-
-//
-// LLPersonModel
-// 
-
-LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(display_name, suffix, root_view_model),
-mAgentID(agent_id)
-{
-}
-
-LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) :
-LLPersonModelCommon(root_view_model),
-mAgentID(LLUUID(NULL))
-{
-}
-
-LLUUID LLPersonModel::getAgentID()
-{
-	return mAgentID;
-}
-
-//
-// LLPersonViewFilter
-//
-
-LLPersonViewFilter::LLPersonViewFilter() :
-    mEmptyLookupMessage(""),
-    mFilterSubString(""),
-    mName(""),
-    mFilterModified(FILTER_NONE),
-    mCurrentGeneration(0)
-{
-}
-
-void LLPersonViewFilter::setFilterSubString(const std::string& string)
-{
-	std::string filter_sub_string_new = string;
-	LLStringUtil::trimHead(filter_sub_string_new);
-	LLStringUtil::toUpper(filter_sub_string_new);
-    
-	if (mFilterSubString != filter_sub_string_new)
-	{
-        // *TODO : Add logic to support more and less restrictive filtering
-        setModified(FILTER_RESTART);
-		mFilterSubString = filter_sub_string_new;
-	}
-}
-
-bool LLPersonViewFilter::showAllResults() const
-{
-	return mFilterSubString.size() > 0;
-}
-
-bool LLPersonViewFilter::check(const LLFolderViewModelItem* item)
-{
-	return (mFilterSubString.size() ? (item->getSearchableName().find(mFilterSubString) != std::string::npos) : true);
-}
-
-std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
-{
-	return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
-}
-
-std::string::size_type LLPersonViewFilter::getFilterStringSize() const
-{
-	return mFilterSubString.size();
-}
-
-bool LLPersonViewFilter::isActive() const
-{
-	return mFilterSubString.size();
-}
-
-bool LLPersonViewFilter::isModified() const
-{
-	return mFilterModified != FILTER_NONE;
-}
-
-void LLPersonViewFilter::clearModified()
-{
-    mFilterModified = FILTER_NONE;
-}
-
-void LLPersonViewFilter::setEmptyLookupMessage(const std::string& message)
-{
-	mEmptyLookupMessage = message;
-}
-
-std::string LLPersonViewFilter::getEmptyLookupMessage() const
-{
-	return mEmptyLookupMessage;
-}
-
diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h
deleted file mode 100644
index 74598eaee0..0000000000
--- a/indra/newview/llpersonmodelcommon.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/** 
-* @file   llavatarfolder.h
-* @brief  Header file for llavatarfolder
-* @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_LLPERSONMODELCOMMON_H
-#define LL_LLPERSONMODELCOMMON_H
-
-#include "../llui/llfolderviewitem.h"
-#include "../llui/llfolderviewmodel.h"
-
-class LLPersonTabModel;
-class LLPersonModel;
-
-// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each  
-// that we tuck into the mConversationsListPanel. 
-class LLPersonModelCommon : public LLFolderViewModelItemCommon
-{
-public:
-
-	LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model);
-	LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model);
-	LLPersonModelCommon(LLFolderViewModelInterface& root_view_model);
-	virtual ~LLPersonModelCommon();
-
-	// Stub those things we won't really be using in this conversation context
-	virtual const std::string& getName() const { return mName; }
-	virtual const std::string& getDisplayName() const { return mName; }
-	virtual const std::string& getSearchableName() const { return mSearchableName; }
-
-	virtual LLPointer<LLUIImage> getIcon() const { return NULL; }
-	virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
-	virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
-	virtual std::string getLabelSuffix() const { return mLabelSuffix; }
-	virtual BOOL isItemRenameable() const { return TRUE; }
-	virtual BOOL renameItem(const std::string& new_name);
-	virtual BOOL isItemMovable( void ) const { return FALSE; }
-	virtual BOOL isItemRemovable( void ) const { return FALSE; }
-	virtual BOOL isItemInTrash( void) const { return FALSE; }
-	virtual BOOL removeItem() { return FALSE; }
-	virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) { }
-	virtual void move( LLFolderViewModelItem* parent_listener ) { }
-	virtual BOOL isItemCopyable() const { return FALSE; }
-	virtual BOOL copyToClipboard() const { return FALSE; }
-	virtual BOOL cutToClipboard() const { return FALSE; }
-	virtual BOOL isClipboardPasteable() const { return FALSE; }
-	virtual void pasteFromClipboard() { }
-	virtual void pasteLinkFromClipboard() { }
-	virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { }
-	virtual BOOL isUpToDate() const { return TRUE; }
-	virtual bool hasChildren() const { return FALSE; }
-
-	virtual bool potentiallyVisible() { return true; }
-    
-	virtual bool filter( LLFolderViewFilter& filter);
-
-	virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; }
-	virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0);
-	virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; }
-
-	// The action callbacks
-	virtual void performAction(LLInventoryModel* model, std::string action);
-	virtual void openItem( void );
-	virtual void closeItem( void );
-	virtual void previewItem( void );
-	virtual void selectItem(void) { } 
-	virtual void showProperties(void);
-
-	// This method will be called to determine if a drop can be
-	// performed, and will set drop to TRUE if a drop is
-	// requested. 
-	// Returns TRUE if a drop is possible/happened, FALSE otherwise.
-	virtual BOOL dragOrDrop(MASK mask, BOOL drop,
-		EDragAndDropType cargo_type,
-		void* cargo_data,
-		std::string& tooltip_msg) { return FALSE; }
-
-	const LLUUID& getID() {return mID;}
-	void postEvent(const std::string& event_type, LLPersonTabModel* session, LLPersonModel* participant);
-
-protected:
-
-	std::string mName;              // Name of the person
-	std::string mLabelSuffix;
-	std::string mSearchableName;	// Name used in string matching for this person
-    bool mPrevPassedAllFilters;
-	LLUUID mID;
-};	
-
-class LLPersonTabModel : public LLPersonModelCommon
-{
-public:
-	enum tab_type
-	{
-		FB_SL_NON_SL_FRIEND,
-		FB_ONLY_FRIEND,
-	};
-
-	LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model);
-	LLPersonTabModel(LLFolderViewModelInterface& root_view_model);
-
-	LLPointer<LLUIImage> getIcon() const { return NULL; }
-	void addParticipant(LLPersonModel* participant);
-	void removeParticipant(LLPersonModel* participant);
-	void removeParticipant(const LLUUID& participant_id);
-	void clearParticipants();
-	LLPersonModel* findParticipant(const LLUUID& person_id);
-
-	tab_type mTabType;
-
-private:
-};
-
-class LLPersonModel : public LLPersonModelCommon
-{
-public:
-	LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model);
-	LLPersonModel(LLFolderViewModelInterface& root_view_model);
-
-	LLUUID getAgentID();
-
-private:
-	LLUUID mAgentID;
-};
-
-// Filtering functional object
-
-class LLPersonViewFilter : public LLFolderViewFilter
-{
-public:
-
-	enum ESortOrderType
-	{
-		SO_NAME = 0,						// Sort by name
-		SO_ONLINE_STATUS = 0x1				// Sort by online status (i.e. online or not)
-	};
-	// Default sort order is by name
-	static const U32 SO_DEFAULT = SO_NAME;
-
-	LLPersonViewFilter();
-	~LLPersonViewFilter() {}
-
-	// +-------------------------------------------------------------------+
-	// + Execution And Results
-	// +-------------------------------------------------------------------+
-	bool 				check(const LLFolderViewModelItem* item);
-	bool				checkFolder(const LLFolderViewModelItem* folder) const { return true; }
-    
-	void 				setEmptyLookupMessage(const std::string& message);
-	std::string			getEmptyLookupMessage() const;
-    
-	bool				showAllResults() const;
-    
-	std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const;
-	std::string::size_type getFilterStringSize() const;
-
- 	// +-------------------------------------------------------------------+
-	// + Status
-	// +-------------------------------------------------------------------+
- 	bool 				isActive() const;
-	bool 				isModified() const;
-	void 				clearModified();
-	const std::string& 	getName() const { return mName; }
-	const std::string& 	getFilterText() { return mName; }
-	void 				setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; mCurrentGeneration++; }
-    
-	// +-------------------------------------------------------------------+
-	// + Time
-	// +-------------------------------------------------------------------+
-    // Note : we currently filter the whole person list at once, no need to timeout then.
-	void 				resetTime(S32 timeout) { }
-    bool                isTimedOut() { return false; }
-    
-	// +-------------------------------------------------------------------+
-	// + Default
-	// +-------------------------------------------------------------------+
-    // Note : we don't support runtime default setting for person filter
-	bool 				isDefault() const  { return !isActive(); }
-	bool 				isNotDefault() const { return isActive(); }
-	void 				markDefault() { }
-	void 				resetDefault() { setModified(); }
-    
-	// +-------------------------------------------------------------------+
-	// + Generation
-	// +-------------------------------------------------------------------+
-    // Note : For the moment, we do not support restrictive filtering so all generation indexes are pointing to the current generation
-	S32 				getCurrentGeneration() const { return mCurrentGeneration; }
-	S32 				getFirstSuccessGeneration() const { return mCurrentGeneration; }
-	S32 				getFirstRequiredGeneration() const { return mCurrentGeneration; }
-
-    // Non Virtual Methods (i.e. specific to this class)
-	void 				setFilterSubString(const std::string& string);
-   
-private:
-	std::string         mName;
-	std::string         mEmptyLookupMessage;
-	std::string			mFilterSubString;
-	EFilterModified 	mFilterModified;
-	S32					mCurrentGeneration;
-};
-
-class LLPersonViewSort
-{
-public:
-	LLPersonViewSort(U32 order = LLPersonViewFilter::SO_DEFAULT) : mSortOrder(order) { }
-
-	bool operator()(const LLPersonModelCommon* const& a, const LLPersonModelCommon* const& b) const {return false;}
-	operator U32() const { return mSortOrder; }
-private:
-	// Note: we're treating this value as a sort order bitmask as done in other places in the code (e.g. inventory)
-	U32  mSortOrder;
-};
-
-
-class LLPersonFolderViewModel
-	: public  LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter>
-{
-public:
-	typedef LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter> base_t;
-
-	void sort(LLFolderViewFolder* folder) { base_t::sort(folder);}
-	bool startDrag(std::vector<LLFolderViewModelItem*>& items) { return false; } // We do not allow drag of conversation items
-};
-
-
-#endif // LL_LLPERSONMODELCOMMON_H
-
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
deleted file mode 100644
index 34ffc6ffce..0000000000
--- a/indra/newview/llpersontabview.cpp
+++ /dev/null
@@ -1,465 +0,0 @@
-/** 
-* @file llpersontabview.cpp
-* @brief Implementation of llpersontabview
-* @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 "llpersontabview.h"
-
-#include "llavataractions.h"
-#include "llfloaterreg.h"
-#include "llpersonmodelcommon.h"
-
-static LLDefaultChildRegistry::Register<LLPersonTabView> r_person_tab_view("person_tab_view");
-
-const LLColor4U DEFAULT_WHITE(255, 255, 255);
-
-LLPersonTabView::Params::Params()
-{}
-
-LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) :
-LLFolderViewFolder(p),
-highlight(false),
-mImageHeader(LLUI::getUIImage("Accordion_Off")),
-mImageHeaderOver(LLUI::getUIImage("Accordion_Over")),
-mImageHeaderFocused(LLUI::getUIImage("Accordion_Selected"))
-{
-}
-
-S32 LLPersonTabView::getLabelXPos()
-{ 
-	return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash;
-}
-
-LLPersonTabView::~LLPersonTabView()
-{
-
-}
-
-BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask )
-{
-	bool selected_item = LLFolderViewFolder::handleMouseDown(x, y, mask);
-
-	if(selected_item)
-	{
-		gFocusMgr.setKeyboardFocus( this );
-		highlight = true;
-	}
-
-	return selected_item;
-}
-
-void LLPersonTabView::draw()
-{
-	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
-	static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonTabView>();
-
-	const LLFontGL * font = LLFontGL::getFontSansSerif();
-	F32 text_left = (F32)getLabelXPos();
-	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
-	LLColor4 color = sFgColor;
-	F32 right_x  = 0;
-
-	drawHighlight();
-	updateLabelRotation();
-	drawOpenFolderArrow(default_params, sFgColor);
-
-	drawLabel(font, text_left, y, color, right_x);
-
-	LLView::draw();
-}
-
-void LLPersonTabView::drawHighlight()
-{
-	S32 width = getRect().getWidth();
-	S32 height = mItemHeight;
-	S32 x = 1;
-	S32 y = getRect().getHeight() - mItemHeight;
-
-	if(highlight)
-	{
-		mImageHeaderFocused->draw(x,y,width,height);
-	}
-	else
-	{
-		mImageHeader->draw(x,y,width,height);
-	}
-
-	if(mIsMouseOverTitle)
-	{
-		mImageHeaderOver->draw(x,y,width,height);
-	}
-
-}
-
-//
-// LLPersonView
-// 
-
-static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
-
-bool LLPersonView::sChildrenWidthsInitialized = false;
-ChildWidthVec LLPersonView::mChildWidthVec;
-
-LLPersonView::Params::Params() :
-facebook_icon("facebook_icon"),
-avatar_icon("avatar_icon"),
-last_interaction_time_textbox("last_interaction_time_textbox"),
-permission_edit_theirs_icon("permission_edit_theirs_icon"),
-permission_edit_mine_icon("permission_edit_mine_icon"),
-permission_map_icon("permission_map_icon"),
-permission_online_icon("permission_online_icon"),
-info_btn("info_btn"),
-profile_btn("profile_btn"),
-output_monitor("output_monitor")
-{}
-
-LLPersonView::LLPersonView(const LLPersonView::Params& p) :
-LLFolderViewItem(p),
-mImageOver(LLUI::getUIImage("ListItem_Over")),
-mImageSelected(LLUI::getUIImage("ListItem_Select")),
-mFacebookIcon(NULL),
-mAvatarIcon(NULL),
-mLastInteractionTimeTextbox(NULL),
-mPermissionEditTheirsIcon(NULL),
-mPermissionEditMineIcon(NULL),
-mPermissionMapIcon(NULL),
-mPermissionOnlineIcon(NULL),
-mInfoBtn(NULL),
-mProfileBtn(NULL),
-mOutputMonitorCtrl(NULL)
-{
-}
-
-S32 LLPersonView::getLabelXPos()
-{
-	S32 label_x_pos;
-
-	if(mAvatarIcon->getVisible())
-	{
-		label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;
-	}
-	else
-	{
-		label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad;
-	}
-
-
-	return label_x_pos;
-}
-
-void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view)
-{
-	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
-
-	LLFolderViewItem::addToFolder(person_folder_view);
-	//Added item to folder could change folder's mHasVisibleChildren flag so call arrange
-	person_folder_view->requestArrange();
-
-	mPersonTabModel = static_cast<LLPersonTabModel *>(getParentFolder()->getViewModelItem());
-
-	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
-	{
-		mAvatarIcon->setVisible(TRUE);
-		mFacebookIcon->setVisible(TRUE); 
-
-		S32 label_width = font->getWidth(mLabel);
-		F32 text_left = (F32)getLabelXPos();
-
-		LLRect mFacebookIconRect = mFacebookIcon->getRect();
-		S32 new_left = text_left + label_width + 7;
-		mFacebookIconRect.set(new_left, 
-			mFacebookIconRect.mTop, 
-			new_left + mFacebookIconRect.getWidth(),
-			mFacebookIconRect.mBottom);
-		mFacebookIcon->setRect(mFacebookIconRect);
-	}
-	else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND)
-	{
-		mFacebookIcon->setVisible(TRUE); 
-	}
-
-}
-
-LLPersonView::~LLPersonView()
-{
-
-}
-
-BOOL LLPersonView::postBuild()
-{
-	if(!sChildrenWidthsInitialized)
-	{
-		initChildrenWidthVec(this);
-		sChildrenWidthsInitialized = true;
-	}
-	
-	initChildVec();
-	updateChildren();
-
-	LLPersonModel * person_model = static_cast<LLPersonModel *>(getViewModelItem());
-
-	mAvatarIcon->setValue(person_model->getAgentID());
-	mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE));
-	mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID()));
-
-	return LLFolderViewItem::postBuild();
-}
-
-void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask)
-{
-	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
-	{
-		mInfoBtn->setVisible(TRUE);
-		mProfileBtn->setVisible(TRUE);
-	}
-
-	updateChildren();
-	LLFolderViewItem::onMouseEnter(x, y, mask);
-}
-
-void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask)
-{
-	if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND)
-	{
-		mInfoBtn->setVisible(FALSE);
-		mProfileBtn->setVisible(FALSE);
-	}
-
-	updateChildren();
-	LLFolderViewItem::onMouseLeave(x, y, mask);
-}
-
-BOOL LLPersonView::handleMouseDown( S32 x, S32 y, MASK mask)
-{
-	if(!LLView::childrenHandleMouseDown(x, y, mask))
-	{
-		gFocusMgr.setMouseCapture( this );
-	}
-
-	if (!mIsSelected)
-	{
-		if(mask & MASK_CONTROL)
-		{
-			getRoot()->changeSelection(this, !mIsSelected);
-		}
-		else if (mask & MASK_SHIFT)
-		{
-			getParentFolder()->extendSelectionTo(this);
-		}
-		else
-		{
-			getRoot()->setSelection(this, FALSE);
-		}
-		make_ui_sound("UISndClick");
-	}
-	else
-	{
-		// If selected, we reserve the decision of deselecting/reselecting to the mouse up moment.
-		// This is necessary so we maintain selection consistent when starting a drag.
-		mSelectPending = TRUE;
-	}
-
-	mDragStartX = x;
-	mDragStartY = y;
-	return TRUE;
-}
-
-void LLPersonView::draw()
-{
-	static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
-	static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
-
-	const LLFontGL * font = LLFontGL::getFontSansSerifSmall();
-	F32 text_left = (F32)getLabelXPos();
-	F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
-	LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor;
-	F32 right_x  = 0;
-
-	drawHighlight();
-	if(mLabel.length())
-	{
-		drawLabel(mLabel, font, text_left, y, color, right_x);
-	}
-	if(mLabelSuffix.length())
-	{
-		drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x);
-	}
-
-	LLView::draw();
-}
-
-void LLPersonView::drawHighlight()
-{
-	static LLUIColor outline_color = LLUIColorTable::instance().getColor("EmphasisColor", DEFAULT_WHITE);
-
-	S32 width = getRect().getWidth();
-	S32 height = mItemHeight;
-	S32 x = 1;
-	S32 y = 0;
-
-	if(mIsSelected)
-	{
-		mImageSelected->draw(x, y, width, height);
-		//Draw outline
-		gl_rect_2d(x, 
-			height, 
-			width,
-			y,
-			outline_color, FALSE);
-	}
-
-	if(mIsMouseOverTitle)
-	{
-		mImageOver->draw(x, y, width, height);
-	}
-}
-
-void LLPersonView::drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x)
-{
-	font->renderUTF8(text, 0, x, y, color,
-		LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
-		S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE);
-}
-
-void LLPersonView::initFromParams(const LLPersonView::Params & params)
-{
-	LLIconCtrl::Params facebook_icon_params(params.facebook_icon());
-	applyXUILayout(facebook_icon_params, this);
-	mFacebookIcon = LLUICtrlFactory::create<LLIconCtrl>(facebook_icon_params);
-	addChild(mFacebookIcon);
-
-	LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon());
-	applyXUILayout(avatar_icon_params, this);
-	mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params);
-	addChild(mAvatarIcon);
-
-	LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox());
-	applyXUILayout(last_interaction_time_textbox, this);
-	mLastInteractionTimeTextbox = LLUICtrlFactory::create<LLTextBox>(last_interaction_time_textbox);
-	addChild(mLastInteractionTimeTextbox);
-
-	LLIconCtrl::Params permission_edit_theirs_icon(params.permission_edit_theirs_icon());
-	applyXUILayout(permission_edit_theirs_icon, this);
-	mPermissionEditTheirsIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_theirs_icon);
-	addChild(mPermissionEditTheirsIcon);
-
-	LLIconCtrl::Params permission_edit_mine_icon(params.permission_edit_mine_icon());
-	applyXUILayout(permission_edit_mine_icon, this);
-	mPermissionEditMineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_mine_icon);
-	addChild(mPermissionEditMineIcon);
-
-	LLIconCtrl::Params permission_map_icon(params.permission_map_icon());
-	applyXUILayout(permission_map_icon, this);
-	mPermissionMapIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_map_icon);
-	addChild(mPermissionMapIcon);
-
-	LLIconCtrl::Params permission_online_icon(params.permission_online_icon());
-	applyXUILayout(permission_online_icon, this);
-	mPermissionOnlineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_online_icon);
-	addChild(mPermissionOnlineIcon);
-
-	LLButton::Params info_btn(params.info_btn());
-	applyXUILayout(info_btn, this);
-	mInfoBtn = LLUICtrlFactory::create<LLButton>(info_btn);
-	addChild(mInfoBtn);
-
-	LLButton::Params profile_btn(params.profile_btn());
-	applyXUILayout(profile_btn, this);
-	mProfileBtn = LLUICtrlFactory::create<LLButton>(profile_btn);
-	addChild(mProfileBtn);
-	
-	LLOutputMonitorCtrl::Params output_monitor(params.output_monitor());
-	applyXUILayout(output_monitor, this);
-	mOutputMonitorCtrl = LLUICtrlFactory::create<LLOutputMonitorCtrl>(output_monitor);
-	addChild(mOutputMonitorCtrl);
-}
-
-void LLPersonView::initChildrenWidthVec(LLPersonView* self)
-{
-	S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft;
-	S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft;
-	S32 info_btn_width = self->mProfileBtn->getRect().mLeft - self->mInfoBtn->getRect().mLeft;
-	S32 permission_online_icon_width = self->mInfoBtn->getRect().mLeft - self->mPermissionOnlineIcon->getRect().mLeft;
-	S32 permissions_map_icon_width = self->mPermissionOnlineIcon->getRect().mLeft - self->mPermissionMapIcon->getRect().mLeft;
-	S32 permission_edit_mine_icon_width = self->mPermissionMapIcon->getRect().mLeft - self->mPermissionEditMineIcon->getRect().mLeft;
-	S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft;
-	S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft;
-
-	self->mChildWidthVec.push_back(output_monitor_width);
-	self->mChildWidthVec.push_back(profile_btn_width);
-	self->mChildWidthVec.push_back(info_btn_width);
-	self->mChildWidthVec.push_back(permission_online_icon_width);
-	self->mChildWidthVec.push_back(permissions_map_icon_width);
-	self->mChildWidthVec.push_back(permission_edit_mine_icon_width);
-	self->mChildWidthVec.push_back(permission_edit_theirs_icon_width);
-	self->mChildWidthVec.push_back(last_interaction_time_textbox_width);
-}
-
-void LLPersonView::initChildVec()
-{
-	mChildVec.push_back(mOutputMonitorCtrl);
-	mChildVec.push_back(mProfileBtn);
-	mChildVec.push_back(mInfoBtn);
-	mChildVec.push_back(mPermissionOnlineIcon);
-	mChildVec.push_back(mPermissionMapIcon);
-	mChildVec.push_back(mPermissionEditMineIcon);
-	mChildVec.push_back(mPermissionEditTheirsIcon);
-	mChildVec.push_back(mLastInteractionTimeTextbox);
-}
-
-void LLPersonView::updateChildren()
-{
-	mLabelPaddingRight = 0;
-	LLView * control;
-	S32 control_width;
-	LLRect control_rect;
-
-	llassert(mChildWidthVec.size() == mChildVec.size());
-
-	for(S32 i = 0; i < mChildWidthVec.size(); ++i)
-	{
-		control = mChildVec[i];
-
-		if(!control->getVisible())
-		{
-			continue;
-		}
-
-		control_width = mChildWidthVec[i];
-		mLabelPaddingRight += control_width;
-
-		control_rect = control->getRect();
-		control_rect.setLeftTopAndSize(
-			getLocalRect().getWidth() - mLabelPaddingRight,
-			control_rect.mTop,
-			control_rect.getWidth(),
-			control_rect.getHeight());
-
-		control->setShape(control_rect);
-
-	}
-}
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
deleted file mode 100644
index 6f244c2794..0000000000
--- a/indra/newview/llpersontabview.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/** 
-* @file   llpersontabview.h
-* @brief  Header file for llpersontabview
-* @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_LLPERSONTABVIEW_H
-#define LL_LLPERSONTABVIEW_H
-
-#include "llavatariconctrl.h"
-#include "llbutton.h"
-#include "llfolderviewitem.h"
-#include "lloutputmonitorctrl.h"
-#include "lltextbox.h"
-
-class LLPersonTabModel;
-
-class LLPersonTabView : public LLFolderViewFolder
-{
-
-public:
-
-	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
-	{
-		Params();
-	};
-
-	LLPersonTabView(const LLPersonTabView::Params& p);
-	virtual ~LLPersonTabView();
-
-	S32 getLabelXPos();
-	bool highlight;
-
-	BOOL handleMouseDown( S32 x, S32 y, MASK mask );
-
-protected:	
-	 void draw();
-	 void drawHighlight();
-
-private:
-
-	// Background images
-	LLPointer<LLUIImage> mImageHeader;
-	LLPointer<LLUIImage> mImageHeaderOver;
-	LLPointer<LLUIImage> mImageHeaderFocused;
-
-};
-
-typedef std::vector<S32> ChildWidthVec;
-typedef std::vector<LLView *> ChildVec;
-
-class LLPersonView : public LLFolderViewItem
-{
-
-public:
-
-	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
-	{
-		Params();
-		Optional<LLIconCtrl::Params> facebook_icon;
-		Optional<LLAvatarIconCtrl::Params> avatar_icon;
-		Optional<LLTextBox::Params> last_interaction_time_textbox;
-		Optional<LLIconCtrl::Params> permission_edit_theirs_icon;
-		Optional<LLIconCtrl::Params> permission_edit_mine_icon;
-		Optional<LLIconCtrl::Params> permission_map_icon;
-		Optional<LLIconCtrl::Params> permission_online_icon;
-		Optional<LLButton::Params> info_btn;
-		Optional<LLButton::Params> profile_btn;
-		Optional<LLOutputMonitorCtrl::Params> output_monitor;
-	};
-
-	LLPersonView(const LLPersonView::Params& p);
-	virtual ~LLPersonView();
-
-	S32 getLabelXPos();
-	void addToFolder(LLFolderViewFolder * person_folder_view);
-	void initFromParams(const LLPersonView::Params & params);
-	BOOL postBuild();
-	void onMouseEnter(S32 x, S32 y, MASK mask);
-	void onMouseLeave(S32 x, S32 y, MASK mask);
-	BOOL handleMouseDown( S32 x, S32 y, MASK mask);
-
-protected:	
-	
-	void draw();
-	void drawHighlight();
-	void drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
-
-private:
-
-	//Short-cut to tab model
-	LLPersonTabModel * mPersonTabModel;
-
-	LLPointer<LLUIImage> mImageOver;
-	LLPointer<LLUIImage> mImageSelected;
-	LLIconCtrl * mFacebookIcon;
-	LLAvatarIconCtrl* mAvatarIcon;
-	LLTextBox * mLastInteractionTimeTextbox;
-	LLIconCtrl * mPermissionEditTheirsIcon;
-	LLIconCtrl * mPermissionEditMineIcon;
-	LLIconCtrl * mPermissionMapIcon;
-	LLIconCtrl * mPermissionOnlineIcon;
-	LLButton * mInfoBtn;
-	LLButton * mProfileBtn;
-	LLOutputMonitorCtrl * mOutputMonitorCtrl;
-
-	typedef enum e_avatar_item_child {
-		ALIC_SPEAKER_INDICATOR,
-		ALIC_PROFILE_BUTTON,
-		ALIC_INFO_BUTTON,
-		ALIC_PERMISSION_ONLINE,
-		ALIC_PERMISSION_MAP,
-		ALIC_PERMISSION_EDIT_MINE,
-		ALIC_PERMISSION_EDIT_THEIRS,
-		ALIC_INTERACTION_TIME,
-		ALIC_COUNT,
-	} EAvatarListItemChildIndex;
-
-	//Widths of controls are same for every instance so can be static
-	static ChildWidthVec mChildWidthVec;
-	//Control pointers are different for each instance so non-static
-	ChildVec mChildVec;
-
-	static bool	sChildrenWidthsInitialized;
-	static void initChildrenWidthVec(LLPersonView* self);
-	void initChildVec();
-	void updateChildren();
-};
-
-#endif // LL_LLPERSONTABVIEW_H
-
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index 76124148a0..1b394a3dca 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -650,105 +650,5 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
            top="0"
            right="-1" />
         </panel>
-        
-<!-- ================================= FBC TEST TWO tab (Final, to be renamed) ========================== -->
-        
-        <panel
-           background_opaque="true"
-           background_visible="true"
-           bg_alpha_color="DkGray"
-           bg_opaque_color="DkGray"
-           follows="all"
-           height="383"
-           label="FBC TEST TWO"
-           layout="topleft"
-           left="0"
-           help_topic="people_fbctest_tab"
-           name="fbctesttwo_panel"
-           top="0">
-            <panel
-                follows="left|top|right"
-                height="27"
-                label="bottom_panel"
-                layout="topleft"
-                left="0"
-                name="fbc_buttons_panel"
-                right="-1"
-                top="0">
-                <filter_editor
-                follows="left|top|right"
-                height="23"
-                layout="topleft"
-                left="6"
-                label="Filter People"
-                max_length_chars="300"
-                name="fbc_filter_input"
-                text_color="Black"
-                text_pad_left="10"
-                top="4"
-                width="177" />
-                <button
-                commit_callback.function="People.Gear"
-                follows="right"
-                height="25"
-                image_hover_unselected="Toolbar_Middle_Over"
-                image_overlay="OptionsMenu_Off"
-                image_selected="Toolbar_Middle_Selected"
-                image_unselected="Toolbar_Middle_Off"
-                layout="topleft"
-                left_pad="8"
-                name="gear_btn"
-                tool_tip="Actions on selected person"
-                top="3"
-                width="31" />
-                <menu_button
-                follows="right"
-                height="25"
-                image_hover_unselected="Toolbar_Middle_Over"
-                image_overlay="Conv_toolbar_sort"
-                image_selected="Toolbar_Middle_Selected"
-                image_unselected="Toolbar_Middle_Off"
-                layout="topleft"
-                left_pad="2"
-                menu_filename="menu_people_friends_view.xml"
-                menu_position="bottomleft"
-                name="fbc_view_btn"
-                tool_tip="View/sort options"
-                top_delta="0"
-                width="31" />
-                <button
-                    follows="right"
-                    height="25"
-                    image_hover_unselected="Toolbar_Middle_Over"
-                    image_overlay="AddItem_Off"
-                    image_selected="Toolbar_Middle_Selected"
-                    image_unselected="Toolbar_Middle_Off"
-                    layout="topleft"
-                    left_pad="2"
-                    name="fbc_add_btn"
-                    tool_tip="Offer friendship to a resident"
-                    top_delta="0"
-                    width="31">
-                    <commit_callback
-                    function="People.AddFriendWizard" />
-                </button>
-                <dnd_button
-                    follows="right"
-                    height="25"
-                    image_hover_unselected="Toolbar_Middle_Over"
-                    image_overlay="TrashItem_Off"
-                    image_selected="Toolbar_Middle_Selected"
-                    image_unselected="Toolbar_Middle_Off"
-                    left_pad="2"
-                    layout="topleft"
-                    name="fbc_del_btn"
-                    tool_tip="Remove selected person as a friend"
-                    top_delta="0"
-                    width="31">
-                    <commit_callback
-                    function="People.DelFriend" />
-                </dnd_button>
-            </panel>
-        </panel>
     </tab_container>
 </panel>
-- 
cgit v1.2.3


From 3325c8ecb3eec0a126ef4b7be338ed5a2f8a8ee8 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 28 Jun 2013 17:15:55 -0700
Subject: ACME-629: Posting a photo to facebook works again. The post button
 callback was not being called due to a name change.

---
 indra/newview/skins/default/xui/en/panel_social_photo.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index e6742b0ea7..fc86349235 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -236,7 +236,7 @@
            name="post_btn"
            width="100">
             <button.commit_callback
-             function="PostToFacebook.Send" />
+             function="SocialSharing.SendPhoto" />
           </button>
           <button
                follows="left|top"
-- 
cgit v1.2.3


From 90b5bd51486e8a5cb5072974c331d1ed61b7e08b Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 1 Jul 2013 15:06:30 -0700
Subject: ACME-645 : Implement the Facebook FUI button. No code, all xml
 wizardry...

---
 indra/newview/app_settings/commands.xml           | 10 ++++++++++
 indra/newview/app_settings/toolbars.xml           |  1 +
 indra/newview/skins/default/textures/textures.xml |  1 +
 indra/newview/skins/default/xui/en/strings.xml    |  2 ++
 4 files changed, 14 insertions(+)

diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 4659673333..60c942094a 100755
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -216,6 +216,16 @@
            is_running_function="Floater.IsOpen"
            is_running_parameters="snapshot"
            />
+  <command name="social"
+           available_in_toybox="true"
+           icon="Command_Social_Icon"
+           label_ref="Command_Social_Label"
+           tooltip_ref="Command_Social_Tooltip"
+           execute_function="Floater.ToggleOrBringToFront"
+           execute_parameters="social"
+           is_running_function="Floater.IsOpen"
+           is_running_parameters="social"
+           />
   <command name="speak"
            available_in_toybox="true"
            icon="Command_Speak_Icon"
diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index 29c019719d..86f9912815 100755
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -6,6 +6,7 @@
     <command name="speak"/>
     <command name="destinations"/>
     <command name="people"/>
+    <command name="social"/>
     <command name="profile"/>
     <command name="move"/>
     <command name="view"/>
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 731bbe8994..4100849f6f 100755
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -148,6 +148,7 @@ with the same filename but different name
   <texture name="Command_Preferences_Icon"  file_name="toolbar_icons/preferences.png"  preload="true" />
   <texture name="Command_Profile_Icon"      file_name="toolbar_icons/profile.png"      preload="true" />
   <texture name="Command_Search_Icon"       file_name="toolbar_icons/search.png"       preload="true" />
+  <texture name="Command_Social_Icon"       file_name="toolbar_icons/facebook.png"     preload="true" />
   <texture name="Command_Snapshot_Icon"     file_name="toolbar_icons/snapshot.png"     preload="true" />
   <texture name="Command_Speak_Icon"        file_name="toolbar_icons/speak.png"        preload="true" />
   <texture name="Command_View_Icon"         file_name="toolbar_icons/view.png"         preload="true" />
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 4613ae054f..0f3f4619f6 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3856,6 +3856,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Profile_Label">Profile</string>
   <string name="Command_Search_Label">Search</string>
   <string name="Command_Snapshot_Label">Snapshot</string>
+  <string name="Command_Social_Label">Facebook</string>
   <string name="Command_Speak_Label">Speak</string>
   <string name="Command_View_Label">Camera controls</string>
   <string name="Command_Voice_Label">Voice settings</string>
@@ -3883,6 +3884,7 @@ Try enclosing path to the editor with double quotes.
   <string name="Command_Profile_Tooltip">Edit or view your profile</string>
   <string name="Command_Search_Tooltip">Find places, events, people</string>
   <string name="Command_Snapshot_Tooltip">Take a picture</string>
+  <string name="Command_Social_Tooltip">Post to Facebook</string>
   <string name="Command_Speak_Tooltip">Speak with people nearby using your microphone</string>
   <string name="Command_View_Tooltip">Changing camera angle</string>
   <string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string>
-- 
cgit v1.2.3


From fa1e0e486a2c32911e6bfe9d72264c3d9ebe1d9f Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Mon, 1 Jul 2013 23:27:52 +0100
Subject: Removed image URL callback from LLWebProfile for ACME-657

---
 indra/newview/llfacebookconnect.cpp |  2 --
 indra/newview/llwebprofile.cpp      | 44 +++++++------------------------------
 indra/newview/llwebprofile.h        |  5 ++---
 3 files changed, 10 insertions(+), 41 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index dc450aab7a..24100a9a55 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -101,7 +101,6 @@ public:
 			
 			// Grab some graph data now that we are connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
-			LLFacebookConnect::instance().loadFacebookFriends();
 		}
 		else
 		{
@@ -204,7 +203,6 @@ public:
             
 			// Grab some graph data if already connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
-			LLFacebookConnect::instance().loadFacebookFriends();
 		}
 		else
 		{
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 6923724de2..69255af179 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLWebProfileResponders::ConfigResponder);
 
 public:
-	ConfigResponder(LLPointer<LLImageFormatted> imagep, LLWebProfile::image_url_callback_t cb)
-	:	mImagep(imagep), mImageCallback(cb)
+	ConfigResponder(LLPointer<LLImageFormatted> imagep)
+	:	mImagep(imagep)
 	{
 	}
 
@@ -113,12 +113,11 @@ public:
 
 		// Do the actual image upload using the configuration.
 		LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
-		LLWebProfile::post(mImagep, config, upload_url, mImageCallback);
+		LLWebProfile::post(mImagep, config, upload_url);
 	}
 
 private:
 	LLPointer<LLImageFormatted> mImagep;
-	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -128,22 +127,6 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
 	LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder);
 
 public:
-	PostImageRedirectResponder(LLWebProfile::image_url_callback_t cb)
-	:	mImageCallback(cb)
-	{
-	}
-
-	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (status == 200)
-		{
-			std::string image_url = content.get("Location");
-			llinfos << "Image uploaded to " << image_url << llendl;
-			if (!mImageCallback.empty() && !image_url.empty())
-				mImageCallback(image_url);
-		}
-	}
-
 	/*virtual*/ void completedRaw(
 		U32 status,
 		const std::string& reason,
@@ -165,9 +148,6 @@ public:
 		LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl;
 		LLWebProfile::reportImageUploadStatus(true);
 	}
-	
-private:
-	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
 
@@ -178,11 +158,6 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
 	LOG_CLASS(LLWebProfileResponders::PostImageResponder);
 
 public:
-	PostImageResponder(LLWebProfile::image_url_callback_t cb)
-	:	mImageCallback(cb)
-	{
-	}
-
 	/*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
 	{
 		// Viewer seems to fail to follow a 303 redirect on POST request
@@ -194,7 +169,7 @@ public:
 			headers["Cookie"] = LLWebProfile::getAuthCookie();
 			const std::string& redir_url = content["location"];
 			LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl;
-			LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCallback), headers);
+			LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(), headers);
 		}
 		else
 		{
@@ -210,9 +185,6 @@ public:
 							  const LLIOPipe::buffer_ptr_t& buffer)
 	{
 	}
-	
-private:
-	LLWebProfile::image_url_callback_t mImageCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -222,7 +194,7 @@ std::string LLWebProfile::sAuthCookie;
 LLWebProfile::status_callback_t LLWebProfile::mStatusCallback;
 
 // static
-void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, LLWebProfile::image_url_callback_t cb)
+void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location)
 {
 	// Get upload configuration data.
 	std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config");
@@ -232,7 +204,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
 	LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
 	LLSD headers = LLViewerMedia::getHeaders();
 	headers["Cookie"] = getAuthCookie();
-	LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, cb), headers);
+	LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers);
 }
 
 // static
@@ -243,7 +215,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie)
 }
 
 // static
-void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, LLWebProfile::image_url_callback_t cb)
+void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url)
 {
 	if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
 	{
@@ -309,7 +281,7 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
 	memcpy(data, body.str().data(), size);
 
 	// Send request, successful upload will trigger posting metadata.
-	LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(cb), headers);
+	LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(), headers);
 }
 
 // static
diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h
index 63dccf80af..10279bffac 100755
--- a/indra/newview/llwebprofile.h
+++ b/indra/newview/llwebprofile.h
@@ -48,9 +48,8 @@ class LLWebProfile
 
 public:
 	typedef boost::function<void(bool ok)> status_callback_t;
-	typedef boost::function<void(const std::string& image_url)> image_url_callback_t;
 
-	static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t());
+	static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location);
 	static void setAuthCookie(const std::string& cookie);
 	static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; }
 
@@ -59,7 +58,7 @@ private:
 	friend class LLWebProfileResponders::PostImageResponder;
 	friend class LLWebProfileResponders::PostImageRedirectResponder;
 
-	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url, image_url_callback_t cb);
+	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url);
 	static void reportImageUploadStatus(bool ok);
 	static std::string getAuthCookie();
 
-- 
cgit v1.2.3


From 1449e645c61f3b31568e38e3c4daf531189323c6 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 2 Jul 2013 01:21:38 +0100
Subject: added callback to LLFacebookConnect upon connect for ACME-659

---
 indra/newview/llfacebookconnect.cpp | 35 +++++++++++++++++++++++++++++------
 indra/newview/llfacebookconnect.h   |  9 +++++----
 indra/newview/llpanelpeople.cpp     |  2 +-
 3 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 24100a9a55..5d6c496275 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -88,7 +88,13 @@ class LLFacebookConnectResponder : public LLHTTPClient::Responder
 {
 	LOG_CLASS(LLFacebookConnectResponder);
 public:
+	
     LLFacebookConnectResponder()
+    {
+        LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
+    }
+	
+    LLFacebookConnectResponder(LLFacebookConnect::connect_callback_t cb) : mConnectCallback(cb)
     {
         LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
     }
@@ -101,6 +107,11 @@ public:
 			
 			// Grab some graph data now that we are connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+		
+			if (mConnectCallback)
+			{
+				mConnectCallback();
+			}
 		}
 		else
 		{
@@ -117,6 +128,8 @@ public:
         }
     }
     
+private:
+	LLFacebookConnect::connect_callback_t mConnectCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -195,14 +208,23 @@ public:
 		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
     }
     
+	LLFacebookConnectedResponder(bool auto_connect, LLFacebookConnect::connect_callback_t cb) : mAutoConnect(auto_connect), mConnectCallback(cb)
+    {
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
+    }
+    
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		if (isGoodStatus(status))
 		{
 			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
             
-			// Grab some graph data if already connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+			
+			if (mConnectCallback)
+			{
+				mConnectCallback();
+			}
 		}
 		else
 		{
@@ -228,6 +250,7 @@ public:
     
 private:
 	bool mAutoConnect;
+	LLFacebookConnect::connect_callback_t mConnectCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -283,13 +306,13 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 	return url;
 }
 
-void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
+void LLFacebookConnect::connectToFacebook(const std::string& auth_code, connect_callback_t cb)
 {
 	LLSD body;
 	if (!auth_code.empty())
 		body["code"] = auth_code;
     
-	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder());
+	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder(cb));
 }
 
 void LLFacebookConnect::disconnectFromFacebook()
@@ -297,13 +320,13 @@ void LLFacebookConnect::disconnectFromFacebook()
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
 }
 
-void LLFacebookConnect::getConnectionToFacebook(bool auto_connect)
+void LLFacebookConnect::getConnectionToFacebook(bool auto_connect, connect_callback_t cb)
 {
     if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED))
     {
-        const bool follow_redirects=false;
+        const bool follow_redirects = false;
         const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect),
+        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect, cb),
                           LLSD(), timeout, follow_redirects);
     }
 }
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index c54da8e3f3..abd6fb385d 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -48,13 +48,14 @@ public:
 		FB_CONNECTED = 2,
 		FB_CONNECTION_FAILED = 3
 	};
-
+	
+	typedef boost::function<void()> connect_callback_t;
 	typedef boost::function<void(bool ok)> share_callback_t;
 	typedef boost::function<void()> content_updated_callback_t;
 
-	void connectToFacebook(const std::string& auth_code = "");  // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use.
-	void disconnectFromFacebook();                              // Disconnect from the FBC service.
-    void getConnectionToFacebook(bool auto_connect = false);     // Check if an access token is available on the FBC service. If not, call connectToFacebook().
+	void connectToFacebook(const std::string& auth_code = "", connect_callback_t cb = connect_callback_t());	// Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use.
+	void disconnectFromFacebook();																				// Disconnect from the FBC service.
+    void getConnectionToFacebook(bool auto_connect = false, connect_callback_t cb = connect_callback_t());		// Check if an access token is available on the FBC service. If not, call connectToFacebook().
     
     void loadFacebookFriends();
 	void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 457ccb8285..6568b7054e 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -863,7 +863,7 @@ void LLPanelPeople::updateFacebookList(bool visible)
 		if (mTryToConnectToFbc)
 		{	
 			// try to reconnect to facebook!
-			LLFacebookConnect::instance().getConnectionToFacebook();
+			LLFacebookConnect::instance().getConnectionToFacebook(false, boost::bind(&LLFacebookConnect::loadFacebookFriends, &LLFacebookConnect::instance()));
 
 			// don't try again
 			mTryToConnectToFbc = false;
-- 
cgit v1.2.3


From f04c88493fe69d608a82f453248f38be2882fe3a Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 2 Jul 2013 01:43:29 +0100
Subject: removed remaining LLFacebookConnect references from
 llfloatersnapshot.cpp for ACME-660

---
 indra/newview/llfloatersnapshot.cpp | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index a0771ff220..ea385d7baf 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1064,7 +1064,6 @@ BOOL LLFloaterSnapshot::postBuild()
 	getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));
 	childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this);
 	
-	LLFacebookConnect::instance().setSharePhotoCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
 	LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
 	LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1));
 
@@ -1278,14 +1277,6 @@ void LLFloaterSnapshot::update()
 		changed |= LLSnapshotLivePreview::onIdle(*iter);
 	}
     
-    // We need to pool on facebook connection as it might change any time
-    static bool s_facebook_connected = false;
-    if (LLFacebookConnect::instance().isConnected() != s_facebook_connected)
-    {
-        s_facebook_connected = LLFacebookConnect::instance().isConnected();
-        changed = true;
-    }
-    
 	if (inst && changed)
 	{
 		lldebugs << "changed" << llendl;
-- 
cgit v1.2.3


From 0ecfc4a1861fded92b4e24741622e0656a0e3b90 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 2 Jul 2013 01:58:40 +0100
Subject: removed remaining FBC test stuff from llpanelpeople.cpp for ACME-661

---
 indra/newview/llpanelpeople.cpp                    | 34 -----------------
 indra/newview/llpanelpeople.h                      |  7 ----
 .../newview/skins/default/xui/en/menu_gear_fbc.xml | 44 ----------------------
 3 files changed, 85 deletions(-)
 delete mode 100644 indra/newview/skins/default/xui/en/menu_gear_fbc.xml

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 6568b7054e..bd4813f945 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -518,10 +518,6 @@ LLPanelPeople::LLPanelPeople()
 	mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList,	this));
 	mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
 
-	mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this));
-	mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this));
-	mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this));
-
 	mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
 	mCommitCallbackRegistrar.add("People.AddFriendWizard",	boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked,	this));
 	mCommitCallbackRegistrar.add("People.DelFriend",		boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked,	this));
@@ -553,8 +549,6 @@ LLPanelPeople::~LLPanelPeople()
 	{
 		LLVoiceClient::getInstance()->removeObserver(this);
 	}
-
-	if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die();
 }
 
 void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
@@ -687,15 +681,6 @@ BOOL LLPanelPeople::postBuild()
 	// Must go after setting commit callback and initializing all pointers to children.
 	mTabContainer->selectTabByName(NEARBY_TAB_NAME);
 
-	mFBCGearButton = getChild<LLMenuButton>("fbc_options_btn");
-
-	LLToggleableMenu* fbc_menu  = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_gear_fbc.xml",  gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
-	if(fbc_menu)
-	{
-		mFBCMenuHandle = fbc_menu->getHandle();
-		mFBCGearButton->setMenu(fbc_menu);
-	}
-
 	LLVoiceClient::getInstance()->addObserver(this);
 
 	// call this method in case some list is empty and buttons can be in inconsistent state
@@ -1540,24 +1525,5 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name)
 	return isAccordionCollapsedByUser(getChild<LLUICtrl>(name));
 }
 
-void LLPanelPeople::onLoginFbcButtonClicked()
-{
-	if (LLFacebookConnect::instance().isConnected())
-	{
-		LLFacebookConnect::instance().disconnectFromFacebook();
-	}
-	else
-	{
-        LLFacebookConnect::instance().getConnectionToFacebook(true);
-	}
-}
-
-void LLPanelPeople::onFacebookAppRequestClicked()
-{
-}
-
-void LLPanelPeople::onFacebookAppSendClicked()
-{
-}
 
 // EOF
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index db8eddb376..666702a08c 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -111,10 +111,6 @@ private:
 	void					onGroupsViewSortMenuItemClicked(const LLSD& userdata);
 	void					onRecentViewSortMenuItemClicked(const LLSD& userdata);
 
-	void					onLoginFbcButtonClicked();
-	void					onFacebookAppRequestClicked();
-	void					onFacebookAppSendClicked();
-
 	bool					onFriendsViewSortMenuItemCheck(const LLSD& userdata);
 	bool					onRecentViewSortMenuItemCheck(const LLSD& userdata);
 	bool					onNearbyViewSortMenuItemCheck(const LLSD& userdata);
@@ -147,15 +143,12 @@ private:
 
 	std::vector<std::string> mSavedOriginalFilters;
 	std::vector<std::string> mSavedFilters;
-	LLHandle<LLView>		mFBCMenuHandle;
-	LLHandle<LLFloater>		mFbcTestBrowserHandle;
 
 	Updater*				mFriendListUpdater;
 	Updater*				mNearbyListUpdater;
 	Updater*				mRecentListUpdater;
 	Updater*				mFacebookListUpdater;
 	Updater*				mButtonsUpdater;
-	LLMenuButton*			mFBCGearButton;
     LLHandle< LLFloater >	mPicker;
 };
 
diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
deleted file mode 100644
index cf27f528ee..0000000000
--- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<toggleable_menu 
-     name="menu_group_plus"
-     left="0" bottom="0" visible="false"
-     mouse_opaque="false">
-  <menu_item_check
-   label="Facebook App Settings"
-   layout="topleft"
-   name="Facebook App Settings">
-      <menu_item_check.on_click
-       function="Advanced.WebContentTest"
-       parameter="http://www.facebook.com/settings?tab=applications" />
-  </menu_item_check>
-  <menu_item_check
-   label="Facebook App Request"
-   layout="topleft"
-   name="Facebook App Request">
-    <menu_item_check.on_click
-     function="People.requestFBC"
-     parameter="http://www.facebook.com/settings?tab=applications" />
-  </menu_item_check>
-  <menu_item_check
-   label="Facebook App Send"
-   layout="topleft"
-   name="Facebook App Send">
-    <menu_item_check.on_click
-     function="People.sendFBC"
-     parameter="http://www.facebook.com/settings?tab=applications" />
-  </menu_item_check>
-  <menu_item_check
-   label="Facebook Add 300 test users to AvatarList"
-   layout="topleft"
-   name="Facebook App Add">
-    <menu_item_check.on_click
-     function="People.testaddFBC"/>
-  </menu_item_check>
-  <menu_item_check
-   label="Facebook Add 300 test users to FolderView"
-   layout="topleft"
-   name="Facebook App Add">
-    <menu_item_check.on_click
-     function="People.testaddFBCFolderView"/>
-  </menu_item_check>
-</toggleable_menu>
-- 
cgit v1.2.3


From 00ef5e101c64bdcb85698e574d8f730e139fedeb Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 2 Jul 2013 13:27:23 -0700
Subject: ACME-626 : Add xml widgets for the connection status in the Facebook
 panel

---
 .../skins/default/xui/en/floater_social.xml        | 29 +++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 27c01eec4d..c571497769 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -20,7 +20,7 @@
    tab_height="30"
    tab_position="top"
    top="7"
-   height="430"
+   height="395"
    halign="center">
     <panel
      filename="panel_social_status.xml"
@@ -53,4 +53,31 @@
       help_topic="panel_social_place"
       name="panel_social_place"/>
   </tab_container>
+  <panel
+   name="connection_status_panel"
+   follows="left|top"
+   height="26">
+   <loading_indicator
+     follows="left|top"
+     height="24"
+     width="24"
+     name="connection_loading_indicator"
+     top="0"
+     left="9"
+     visible="true"/>
+   <text
+     name="connection_status_text"
+     type="string"
+     follows="left|top"
+     top="3"
+     left_pad="5"
+     width="250"
+     height="20"
+     wrap="true"
+     halign="left"
+     valign="center"
+     font="SansSerif">
+      Test text
+   </text>
+  </panel>
 </floater>
-- 
cgit v1.2.3


From 853ad9d70ddcf0cdd354672a5c7baa858de1bb22 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Jul 2013 00:35:10 +0100
Subject: Implemented events for LLFacebookConnect state changes for ACME-662

---
 indra/newview/llfacebookconnect.cpp | 53 +++++++++++++++----------------------
 indra/newview/llfacebookconnect.h   | 15 ++++++-----
 indra/newview/llfloatersocial.cpp   |  4 +--
 indra/newview/llpanelpeople.cpp     | 26 +++++++++++++++---
 indra/newview/llpanelpeople.h       |  2 ++
 5 files changed, 58 insertions(+), 42 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 5d6c496275..8a86ff6377 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -38,7 +38,9 @@
 #include "llimagepng.h"
 #include "llimagejpeg.h"
 #include "lltrans.h"
+#include "llevents.h"
 
+boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState"));
 
 // 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)
@@ -90,11 +92,6 @@ class LLFacebookConnectResponder : public LLHTTPClient::Responder
 public:
 	
     LLFacebookConnectResponder()
-    {
-        LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
-    }
-	
-    LLFacebookConnectResponder(LLFacebookConnect::connect_callback_t cb) : mConnectCallback(cb)
     {
         LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
     }
@@ -107,11 +104,6 @@ public:
 			
 			// Grab some graph data now that we are connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
-		
-			if (mConnectCallback)
-			{
-				mConnectCallback();
-			}
 		}
 		else
 		{
@@ -127,9 +119,6 @@ public:
             LLFacebookConnect::instance().openFacebookWeb(content["location"]);
         }
     }
-    
-private:
-	LLFacebookConnect::connect_callback_t mConnectCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -208,11 +197,6 @@ public:
 		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
     }
     
-	LLFacebookConnectedResponder(bool auto_connect, LLFacebookConnect::connect_callback_t cb) : mAutoConnect(auto_connect), mConnectCallback(cb)
-    {
-		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
-    }
-    
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		if (isGoodStatus(status))
@@ -220,11 +204,6 @@ public:
 			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
             
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
-			
-			if (mConnectCallback)
-			{
-				mConnectCallback();
-			}
 		}
 		else
 		{
@@ -250,7 +229,6 @@ public:
     
 private:
 	bool mAutoConnect;
-	LLFacebookConnect::connect_callback_t mConnectCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -306,13 +284,13 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 	return url;
 }
 
-void LLFacebookConnect::connectToFacebook(const std::string& auth_code, connect_callback_t cb)
+void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
 {
 	LLSD body;
 	if (!auth_code.empty())
 		body["code"] = auth_code;
     
-	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder(cb));
+	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder());
 }
 
 void LLFacebookConnect::disconnectFromFacebook()
@@ -320,21 +298,21 @@ void LLFacebookConnect::disconnectFromFacebook()
 	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
 }
 
-void LLFacebookConnect::getConnectionToFacebook(bool auto_connect, connect_callback_t cb)
+void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
 {
     if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED))
     {
         const bool follow_redirects = false;
-        const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
-        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect, cb),
+        const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect),
                           LLSD(), timeout, follow_redirects);
     }
 }
 
 void LLFacebookConnect::loadFacebookFriends()
 {
-	const bool follow_redirects=false;
-	const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
+	const bool follow_redirects = false;
+	const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
 	LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(),
 					  LLSD(), timeout, follow_redirects);
 }
@@ -451,6 +429,19 @@ void LLFacebookConnect::clearContent()
     mContent = LLSD();
 }
 
+void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state)
+{
+	if (mConnectionState != connection_state)
+	{
+		LLSD state_info;
+		state_info["enum"] = connection_state;
+		sStateWatcher->post(state_info);
+	}
+	
+	mConnectionState = connection_state;
+}
+    
+
 
 
 
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index abd6fb385d..4e95fc3545 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -31,6 +31,8 @@
 #include "llsingleton.h"
 #include "llimage.h"
 
+class LLEventPump;
+
 /**
  * @class LLFacebookConnect
  *
@@ -49,13 +51,12 @@ public:
 		FB_CONNECTION_FAILED = 3
 	};
 	
-	typedef boost::function<void()> connect_callback_t;
 	typedef boost::function<void(bool ok)> share_callback_t;
 	typedef boost::function<void()> content_updated_callback_t;
 
-	void connectToFacebook(const std::string& auth_code = "", connect_callback_t cb = connect_callback_t());	// Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use.
-	void disconnectFromFacebook();																				// Disconnect from the FBC service.
-    void getConnectionToFacebook(bool auto_connect = false, connect_callback_t cb = connect_callback_t());		// Check if an access token is available on the FBC service. If not, call connectToFacebook().
+	void connectToFacebook(const std::string& auth_code = "");	// 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 loadFacebookFriends();
 	void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
@@ -72,8 +73,8 @@ public:
 	void storeContent(const LLSD& content);
     const LLSD& getContent() const;
     
-    void setConnectionState(EConnectionState connection_state) { mConnectionState = connection_state; }
-    bool isConnected() { return (mConnectionState == FB_CONNECTED); }
+    void setConnectionState(EConnectionState connection_state);
+	bool isConnected() { return (mConnectionState == FB_CONNECTED); }
     S32  generation() { return mGeneration; }
     
     void openFacebookWeb(std::string url);
@@ -93,6 +94,8 @@ private:
 	share_callback_t mSharePhotoCallback;
 	share_callback_t mUpdateStatusCallback;
 	content_updated_callback_t mContentUpdatedCallback;
+
+	static boost::scoped_ptr<LLEventPump> sStateWatcher;
 };
 
 #endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4660644969..50d641865b 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -536,8 +536,8 @@ void LLFloaterSocial::onCancel()
 
 BOOL LLFloaterSocial::postBuild()
 {
-    // Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state)
-    LLFacebookConnect::instance().getConnectionToFacebook(true);
+    // Initiate a connection to Facebook
+    LLFacebookConnect::instance().checkConnectionToFacebook(true);
     // Keep tab of the Photo Panel
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
 	return LLFloater::postBuild();
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index bd4813f945..8c8cad0743 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -839,16 +839,36 @@ void LLPanelPeople::updateRecentList()
 	mRecentList->setDirty();
 }
 
+bool LLPanelPeople::onConnectedToFacebook(const LLSD& data)
+{
+	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople");
+
+		LLFacebookConnect::instance().loadFacebookFriends();
+	}
+
+	return false;
+}
+
 void LLPanelPeople::updateFacebookList(bool visible)
 {
-	if(visible)
+	if (visible)
 	{
 		LLFacebookConnect::instance().setContentUpdatedCallback(boost::bind(&LLPanelPeople::updateSuggestedFriendList, this));
 
 		if (mTryToConnectToFbc)
-		{	
+		{
 			// try to reconnect to facebook!
-			LLFacebookConnect::instance().getConnectionToFacebook(false, boost::bind(&LLFacebookConnect::loadFacebookFriends, &LLFacebookConnect::instance()));
+			if (LLFacebookConnect::instance().isConnected())
+			{
+				LLFacebookConnect::instance().loadFacebookFriends();
+			}
+			else
+			{
+				LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1));
+				LLFacebookConnect::instance().checkConnectionToFacebook();
+			}
 
 			// don't try again
 			mTryToConnectToFbc = false;
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 666702a08c..c6ee7b8165 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -126,6 +126,8 @@ 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);
-- 
cgit v1.2.3


From eef8579dd7f9af558041d4d3a4b4aeb39bf280a1 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Jul 2013 01:16:41 +0100
Subject: Moved auto-connect to happen when Post button is clicked for ACME-654
 and ACME-652

---
 indra/newview/llfloatersocial.cpp | 84 +++++++++++++++++++++++++++++++++------
 indra/newview/llfloatersocial.h   | 60 ++++++++++++++--------------
 2 files changed, 103 insertions(+), 41 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 50d641865b..061bcf246d 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -88,7 +88,7 @@ void LLSocialStatusPanel::draw()
 	if (mMessageTextEditor && mPostStatusButton)
 	{
 		std::string message = mMessageTextEditor->getValue().asString();
-		mPostStatusButton->setEnabled(!message.empty() && LLFacebookConnect::instance().isConnected());
+		mPostStatusButton->setEnabled(!message.empty());
 	}
 
 	LLPanel::draw();
@@ -101,8 +101,18 @@ void LLSocialStatusPanel::onSend()
 		std::string message = mMessageTextEditor->getValue().asString();
 		if (!message.empty())
 		{
-			LLFacebookConnect::instance().updateStatus(message);
-	
+			// Connect to Facebook if necessary and then post
+			if (LLFacebookConnect::instance().isConnected())
+			{
+				LLFacebookConnect::instance().updateStatus(message);
+			}
+			else
+			{
+				LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onConnectedToFacebook, this, _1, message));
+				LLFacebookConnect::instance().checkConnectionToFacebook(true);
+			}
+			
+			// Close the floater once "Post" has been pushed
 			LLFloater* floater = getParentByType<LLFloater>();
 			if (floater)
 			{
@@ -112,6 +122,18 @@ void LLSocialStatusPanel::onSend()
 	}
 }
 
+bool LLSocialStatusPanel::onConnectedToFacebook(const LLSD& data, const std::string& message)
+{
+	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel");
+		
+		LLFacebookConnect::instance().updateStatus(message);
+	}
+
+	return false;
+}
+
 ///////////////////////////
 //LLSocialPhotoPanel///////
 ///////////////////////////
@@ -233,8 +255,6 @@ void LLSocialPhotoPanel::draw()
 		mThumbnailPlaceholder->draw();
 		gGL.popUIMatrix();
 	}
-
-	mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
 }
 
 LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
@@ -302,7 +322,18 @@ void LLSocialPhotoPanel::onSend()
 	}
 
 	LLSnapshotLivePreview* previewp = getPreviewView();
-	LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
+	
+	// Connect to Facebook if necessary and then post
+	if (LLFacebookConnect::instance().isConnected())
+	{
+		LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
+	}
+	else
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onConnectedToFacebook, this, _1, previewp->getFormattedImage(), caption));
+		LLFacebookConnect::instance().checkConnectionToFacebook(true);
+	}
+
 	updateControls();
 
 	// Close the floater once "Post" has been pushed
@@ -313,6 +344,18 @@ void LLSocialPhotoPanel::onSend()
 	}
 }
 
+bool LLSocialPhotoPanel::onConnectedToFacebook(const LLSD& data, LLPointer<LLImageFormatted> image, const std::string& caption)
+{
+	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel");
+		
+		LLFacebookConnect::instance().sharePhoto(image, caption);
+	}
+
+	return false;
+}
+
 void LLSocialPhotoPanel::updateControls()
 {
 	LLSnapshotLivePreview* previewp = getPreviewView();
@@ -482,8 +525,7 @@ void LLSocialCheckinPanel::draw()
         mMapCheckBox->setEnabled(true);
         mMapCheckBox->set(mMapCheckBoxValue);
     }
-    mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
-    
+
 	LLPanel::draw();
 }
 
@@ -508,8 +550,16 @@ void LLSocialCheckinPanel::onSend()
 	// Get the caption
 	std::string caption = getChild<LLUICtrl>("place_caption")->getValue().asString();
 
-    // Post all that to Facebook
-	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
+	// Connect to Facebook if necessary and then post
+	if (LLFacebookConnect::instance().isConnected())
+	{
+		LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
+	}
+	else
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onConnectedToFacebook, this, _1, slurl_string, region_name, description, map_url, caption));
+		LLFacebookConnect::instance().checkConnectionToFacebook(true);
+	}
     
     // Close the floater once "Post" has been pushed
 	LLFloater* floater = getParentByType<LLFloater>();
@@ -519,6 +569,18 @@ void LLSocialCheckinPanel::onSend()
     }
 }
 
+bool LLSocialCheckinPanel::onConnectedToFacebook(const LLSD& data, const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message)
+{
+	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
+		
+		LLFacebookConnect::instance().postCheckin(location, name, description, picture, message);
+	}
+
+	return false;
+}
+
 ////////////////////////
 //LLFloaterSocial///////
 ////////////////////////
@@ -536,8 +598,6 @@ void LLFloaterSocial::onCancel()
 
 BOOL LLFloaterSocial::postBuild()
 {
-    // Initiate a connection to Facebook
-    LLFacebookConnect::instance().checkConnectionToFacebook(true);
     // Keep tab of the Photo Panel
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
 	return LLFloater::postBuild();
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 89b9e2016a..4970f95e89 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -41,6 +41,7 @@ public:
 	BOOL postBuild();
 	void draw();
     void onSend();
+	bool onConnectedToFacebook(const LLSD& data, const std::string& message);
 
 private:
 	LLUICtrl* mMessageTextEditor;
@@ -49,41 +50,40 @@ private:
 
 class LLSocialPhotoPanel : public LLPanel
 {
-
 public:
-		LLSocialPhotoPanel();
-		~LLSocialPhotoPanel();
+	LLSocialPhotoPanel();
+	~LLSocialPhotoPanel();
 
-		BOOL postBuild();
-		void draw();
+	BOOL postBuild();
+	void draw();
 
-		LLSnapshotLivePreview* getPreviewView();
-		void onVisibilityChange(const LLSD& new_visibility);
-		void onClickNewSnapshot();
-		void onSend();
+	LLSnapshotLivePreview* getPreviewView();
+	void onVisibilityChange(const LLSD& new_visibility);
+	void onClickNewSnapshot();
+	void onSend();
+	bool onConnectedToFacebook(const LLSD& data, LLPointer<LLImageFormatted> image, const std::string& caption);
 
-		void updateControls();
-		void updateResolution(BOOL do_update);
-		void checkAspectRatio(S32 index);
-		void setNeedRefresh(bool need);
-		LLUICtrl* getRefreshBtn();
+	void updateControls();
+	void updateResolution(BOOL do_update);
+	void checkAspectRatio(S32 index);
+	void setNeedRefresh(bool need);
+	LLUICtrl* getRefreshBtn();
 
 private:
-
-		LLHandle<LLView> mPreviewHandle;
-
-		LLUICtrl * mSnapshotPanel;
-		LLUICtrl * mResolutionComboBox;
-		LLUICtrl * mRefreshBtn;
-		LLUICtrl * mRefreshLabel;
-		LLUICtrl * mSucceessLblPanel;
-		LLUICtrl * mFailureLblPanel;
-		LLUICtrl * mThumbnailPlaceholder;
-		LLUICtrl * mCaptionTextBox;
-		LLUICtrl * mLocationCheckbox;
-		LLUICtrl * mPostButton;
-
-		bool mNeedRefresh;
+	LLHandle<LLView> mPreviewHandle;
+
+	LLUICtrl * mSnapshotPanel;
+	LLUICtrl * mResolutionComboBox;
+	LLUICtrl * mRefreshBtn;
+	LLUICtrl * mRefreshLabel;
+	LLUICtrl * mSucceessLblPanel;
+	LLUICtrl * mFailureLblPanel;
+	LLUICtrl * mThumbnailPlaceholder;
+	LLUICtrl * mCaptionTextBox;
+	LLUICtrl * mLocationCheckbox;
+	LLUICtrl * mPostButton;
+
+	bool mNeedRefresh;
 };
 
 class LLSocialCheckinPanel : public LLPanel
@@ -93,6 +93,8 @@ public:
 	BOOL postBuild();
 	void draw();
     void onSend();
+	bool onConnectedToFacebook(const LLSD& data, const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
+
 private:
     std::string mMapUrl;
     LLPointer<LLViewerFetchedTexture> mMapTexture;
-- 
cgit v1.2.3


From b070533bdaa78fb2d94ec49a2ea3d9a9ada3d437 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Jul 2013 01:38:30 +0100
Subject: added FB_POSTING and PB_POST_FAILED states to LLFacebookConnect for
 ACME-663

---
 indra/newview/llfacebookconnect.cpp | 16 +++++++++++++---
 indra/newview/llfacebookconnect.h   |  6 ++++--
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 8a86ff6377..30fb63084b 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -128,8 +128,15 @@ class LLFacebookShareResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLFacebookShareResponder);
 public:
     
-	LLFacebookShareResponder() {}
-	LLFacebookShareResponder(LLFacebookConnect::share_callback_t cb) : mShareCallback(cb) {}
+	LLFacebookShareResponder()
+	{
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING);
+	}
+	
+	LLFacebookShareResponder(LLFacebookConnect::share_callback_t cb) : mShareCallback(cb)
+	{
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING);
+	}
     
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
@@ -137,9 +144,12 @@ public:
 		{
             toast_user_for_success();
 			LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL;
+			
+			LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
 		}
 		else
 		{
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POST_FAILED);
             log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description"));
 		}
 		
@@ -300,7 +310,7 @@ void LLFacebookConnect::disconnectFromFacebook()
 
 void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
 {
-    if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED))
+    if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED) || (mConnectionState == FB_POST_FAILED))
     {
         const bool follow_redirects = false;
         const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 4e95fc3545..7d6bca5a25 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -48,7 +48,9 @@ public:
 		FB_NOT_CONNECTED = 0,
 		FB_CONNECTION_IN_PROGRESS = 1,
 		FB_CONNECTED = 2,
-		FB_CONNECTION_FAILED = 3
+		FB_CONNECTION_FAILED = 3,
+		FB_POSTING = 4,
+		FB_POST_FAILED = 5
 	};
 	
 	typedef boost::function<void(bool ok)> share_callback_t;
@@ -74,7 +76,7 @@ public:
     const LLSD& getContent() const;
     
     void setConnectionState(EConnectionState connection_state);
-	bool isConnected() { return (mConnectionState == FB_CONNECTED); }
+	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING)); }
     S32  generation() { return mGeneration; }
     
     void openFacebookWeb(std::string url);
-- 
cgit v1.2.3


From 8c4a39b2025ef64f6218dc112e37f71c65aac446 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 2 Jul 2013 18:34:17 -0700
Subject: ACME-626 : Implement status and progress update text

---
 indra/newview/llfacebookconnect.h                  |  1 +
 indra/newview/llfloatersocial.cpp                  | 36 +++++++++++++++++++++-
 indra/newview/llfloatersocial.h                    |  7 ++++-
 .../skins/default/xui/en/floater_social.xml        | 19 ++++++++++--
 4 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index abd6fb385d..1044c05e45 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -73,6 +73,7 @@ public:
     const LLSD& getContent() const;
     
     void setConnectionState(EConnectionState connection_state) { mConnectionState = connection_state; }
+    EConnectionState getConnectionState() { return mConnectionState; }
     bool isConnected() { return (mConnectionState == FB_CONNECTED); }
     S32  generation() { return mGeneration; }
     
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4660644969..ddbaa2d704 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -524,7 +524,10 @@ void LLSocialCheckinPanel::onSend()
 ////////////////////////
 
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
-    mSocialPhotoPanel(NULL)
+    mSocialPhotoPanel(NULL),
+    mStatusErrorText(NULL),
+    mStatusLoadingText(NULL),
+    mStatusLoadingIndicator(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
 }
@@ -540,6 +543,10 @@ BOOL LLFloaterSocial::postBuild()
     LLFacebookConnect::instance().getConnectionToFacebook(true);
     // Keep tab of the Photo Panel
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_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();
 }
 
@@ -580,3 +587,30 @@ void LLFloaterSocial::postUpdate()
 		
 	}
 }
+
+void LLFloaterSocial::draw()
+{
+    if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
+    {
+        mStatusErrorText->setVisible(false);
+        mStatusLoadingText->setVisible(false);
+        mStatusLoadingIndicator->setVisible(false);
+        LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
+        switch (connection_state)
+        {
+        case LLFacebookConnect::FB_NOT_CONNECTED:
+            break;
+        case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
+            mStatusLoadingText->setVisible(true);
+            mStatusLoadingIndicator->setVisible(true);
+            break;
+        case LLFacebookConnect::FB_CONNECTED:
+            break;
+        case LLFacebookConnect::FB_CONNECTION_FAILED:
+            mStatusErrorText->setVisible(true);
+            break;
+        }
+    }
+	LLFloater::draw();
+}
+
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 89b9e2016a..f90deb9f85 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -28,6 +28,7 @@
 #define LL_LLFLOATERSOCIAL_H
 
 #include "llfloater.h"
+#include "lltextbox.h"
 #include "llviewertexture.h"
 
 class LLIconCtrl;
@@ -109,13 +110,17 @@ class LLFloaterSocial : public LLFloater
 public:
 	LLFloaterSocial(const LLSD& key);
 	BOOL postBuild();
+	void draw();
 	void onCancel();
 
 	static void preUpdate();
 	static void postUpdate();
 
 private:
-	LLSocialPhotoPanel * mSocialPhotoPanel;
+	LLSocialPhotoPanel* mSocialPhotoPanel;
+    LLTextBox* mStatusErrorText;
+    LLTextBox* mStatusLoadingText;
+    LLUICtrl* mStatusLoadingIndicator;
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index c571497769..61210135ee 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -57,6 +57,21 @@
    name="connection_status_panel"
    follows="left|top"
    height="26">
+   <text
+     name="connection_error_text"
+     type="string"
+     follows="left|top"
+     top="3"
+     left="12"
+     width="250"
+     height="20"
+     wrap="true"
+     halign="left"
+     valign="center"
+     text_color="Yellow"
+     font="SansSerif">
+     Problem Connecting to Facebook 
+   </text>
    <loading_indicator
      follows="left|top"
      height="24"
@@ -66,7 +81,7 @@
      left="9"
      visible="true"/>
    <text
-     name="connection_status_text"
+     name="connection_loading_text"
      type="string"
      follows="left|top"
      top="3"
@@ -77,7 +92,7 @@
      halign="left"
      valign="center"
      font="SansSerif">
-      Test text
+      Connecting to Facebook...
    </text>
   </panel>
 </floater>
-- 
cgit v1.2.3


From 55077fd1ae7a00b1a49993d124f2640b17d95bb8 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 2 Jul 2013 20:00:10 -0700
Subject: ACME-626 : Suppress the closing of the floater when clicking Post or
 we can't see the status

---
 indra/newview/llfloatersocial.cpp | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 684b177f24..a0dbb7ea95 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -111,13 +111,6 @@ void LLSocialStatusPanel::onSend()
 				LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onConnectedToFacebook, this, _1, message));
 				LLFacebookConnect::instance().checkConnectionToFacebook(true);
 			}
-			
-			// Close the floater once "Post" has been pushed
-			LLFloater* floater = getParentByType<LLFloater>();
-			if (floater)
-			{
-				floater->closeFloater();
-			}
 		}
 	}
 }
@@ -335,13 +328,6 @@ void LLSocialPhotoPanel::onSend()
 	}
 
 	updateControls();
-
-	// Close the floater once "Post" has been pushed
-	LLFloater* floater = getParentByType<LLFloater>();
-	if (floater)
-	{
-		floater->closeFloater();
-	}
 }
 
 bool LLSocialPhotoPanel::onConnectedToFacebook(const LLSD& data, LLPointer<LLImageFormatted> image, const std::string& caption)
@@ -560,13 +546,6 @@ void LLSocialCheckinPanel::onSend()
 		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onConnectedToFacebook, this, _1, slurl_string, region_name, description, map_url, caption));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
-    
-    // Close the floater once "Post" has been pushed
-	LLFloater* floater = getParentByType<LLFloater>();
-    if (floater)
-    {
-        floater->closeFloater();
-    }
 }
 
 bool LLSocialCheckinPanel::onConnectedToFacebook(const LLSD& data, const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message)
-- 
cgit v1.2.3


From 4ed5e21ae3fe069126bd43ae0785aa74ba3d0cf7 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Jul 2013 22:07:50 +0100
Subject: made some slight reorganizations for ACME-662

---
 indra/newview/llfloatersocial.cpp | 137 +++++++++++++++++++++-----------------
 indra/newview/llfloatersocial.h   |  12 +++-
 2 files changed, 86 insertions(+), 63 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index a0dbb7ea95..57b6cccd32 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -96,37 +96,39 @@ void LLSocialStatusPanel::draw()
 
 void LLSocialStatusPanel::onSend()
 {
-	if (mMessageTextEditor)
+	// Connect to Facebook if necessary and then post
+	if (LLFacebookConnect::instance().isConnected())
 	{
-		std::string message = mMessageTextEditor->getValue().asString();
-		if (!message.empty())
-		{
-			// Connect to Facebook if necessary and then post
-			if (LLFacebookConnect::instance().isConnected())
-			{
-				LLFacebookConnect::instance().updateStatus(message);
-			}
-			else
-			{
-				LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onConnectedToFacebook, this, _1, message));
-				LLFacebookConnect::instance().checkConnectionToFacebook(true);
-			}
-		}
+		sendStatus();
+	}
+	else
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1));
+		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
 }
 
-bool LLSocialStatusPanel::onConnectedToFacebook(const LLSD& data, const std::string& message)
+bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data)
 {
 	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
 	{
 		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel");
 		
-		LLFacebookConnect::instance().updateStatus(message);
+		sendStatus();
 	}
 
 	return false;
 }
 
+void LLSocialStatusPanel::sendStatus()
+{
+	std::string message = mMessageTextEditor->getValue().asString();
+	if (!message.empty())
+	{
+		LLFacebookConnect::instance().updateStatus(message);
+	}
+}
+
 ///////////////////////////
 //LLSocialPhotoPanel///////
 ///////////////////////////
@@ -301,47 +303,56 @@ void LLSocialPhotoPanel::onClickNewSnapshot()
 
 void LLSocialPhotoPanel::onSend()
 {
-	std::string caption = mCaptionTextBox->getValue().asString();
-	bool add_location = mLocationCheckbox->getValue().asBoolean();
-
-	if (add_location)
-	{
-		LLSLURL slurl;
-		LLAgentUI::buildSLURL(slurl);
-		if (caption.empty())
-			caption = slurl.getSLURLString();
-		else
-			caption = caption + " " + slurl.getSLURLString();
-	}
-
-	LLSnapshotLivePreview* previewp = getPreviewView();
-	
 	// Connect to Facebook if necessary and then post
 	if (LLFacebookConnect::instance().isConnected())
 	{
-		LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
+		sendPhoto();
 	}
 	else
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onConnectedToFacebook, this, _1, previewp->getFormattedImage(), caption));
+		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
-
-	updateControls();
 }
 
-bool LLSocialPhotoPanel::onConnectedToFacebook(const LLSD& data, LLPointer<LLImageFormatted> image, const std::string& caption)
+bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
 {
 	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
 	{
 		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel");
 		
-		LLFacebookConnect::instance().sharePhoto(image, caption);
+		sendPhoto();
 	}
 
 	return false;
 }
 
+void LLSocialPhotoPanel::sendPhoto()
+{
+	// Get the caption
+	std::string caption = mCaptionTextBox->getValue().asString();
+
+	// Add the location if required
+	bool add_location = mLocationCheckbox->getValue().asBoolean();
+	if (add_location)
+	{
+		LLSLURL slurl;
+		LLAgentUI::buildSLURL(slurl);
+		if (caption.empty())
+			caption = slurl.getSLURLString();
+		else
+			caption = caption + " " + slurl.getSLURLString();
+	}
+
+	// Get the image
+	LLSnapshotLivePreview* previewp = getPreviewView();
+	
+	// Post to Facebook
+	LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption);
+
+	updateControls();
+}
+
 void LLSocialPhotoPanel::updateControls()
 {
 	LLSnapshotLivePreview* previewp = getPreviewView();
@@ -516,6 +527,32 @@ void LLSocialCheckinPanel::draw()
 }
 
 void LLSocialCheckinPanel::onSend()
+{
+	// Connect to Facebook if necessary and then post
+	if (LLFacebookConnect::instance().isConnected())
+	{
+		sendCheckin();
+	}
+	else
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1));
+		LLFacebookConnect::instance().checkConnectionToFacebook(true);
+	}
+}
+
+bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
+{
+	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
+		
+		sendCheckin();
+	}
+
+	return false;
+}
+
+void LLSocialCheckinPanel::sendCheckin()
 {
 	// Get the location SLURL
 	LLSLURL slurl;
@@ -536,28 +573,8 @@ void LLSocialCheckinPanel::onSend()
 	// Get the caption
 	std::string caption = getChild<LLUICtrl>("place_caption")->getValue().asString();
 
-	// Connect to Facebook if necessary and then post
-	if (LLFacebookConnect::instance().isConnected())
-	{
-		LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
-	}
-	else
-	{
-		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onConnectedToFacebook, this, _1, slurl_string, region_name, description, map_url, caption));
-		LLFacebookConnect::instance().checkConnectionToFacebook(true);
-	}
-}
-
-bool LLSocialCheckinPanel::onConnectedToFacebook(const LLSD& data, const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message)
-{
-	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
-	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
-		
-		LLFacebookConnect::instance().postCheckin(location, name, description, picture, message);
-	}
-
-	return false;
+	// Post to Facebook
+	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
 }
 
 ////////////////////////
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 07236c2838..e37facbbce 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -42,7 +42,9 @@ public:
 	BOOL postBuild();
 	void draw();
     void onSend();
-	bool onConnectedToFacebook(const LLSD& data, const std::string& message);
+	bool onFacebookConnectStateChange(const LLSD& data);
+
+	void sendStatus();
 
 private:
 	LLUICtrl* mMessageTextEditor;
@@ -62,7 +64,9 @@ public:
 	void onVisibilityChange(const LLSD& new_visibility);
 	void onClickNewSnapshot();
 	void onSend();
-	bool onConnectedToFacebook(const LLSD& data, LLPointer<LLImageFormatted> image, const std::string& caption);
+	bool onFacebookConnectStateChange(const LLSD& data);
+
+	void sendPhoto();
 
 	void updateControls();
 	void updateResolution(BOOL do_update);
@@ -94,7 +98,9 @@ public:
 	BOOL postBuild();
 	void draw();
     void onSend();
-	bool onConnectedToFacebook(const LLSD& data, const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
+	bool onFacebookConnectStateChange(const LLSD& data);
+
+	void sendCheckin();
 
 private:
     std::string mMapUrl;
-- 
cgit v1.2.3


From e7cb0fe13be7f1b37d24cea5e8ea070cdcf7b5a6 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 3 Jul 2013 14:48:22 -0700
Subject: ACME-626 : Unify the xml of status and place so things line up.
 Simplify the xml of photo

---
 .../skins/default/xui/en/floater_social.xml        |  2 +-
 .../skins/default/xui/en/panel_social_photo.xml    | 20 ++-------
 .../skins/default/xui/en/panel_social_place.xml    | 11 ++---
 .../skins/default/xui/en/panel_social_status.xml   | 49 +++++++++++++++-------
 4 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 61210135ee..3ce6841a3a 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -25,7 +25,7 @@
     <panel
      filename="panel_social_status.xml"
      class="llsocialstatuspanel"
-     background_opaque="true"
+     follows="all"
      background_visible="true"
      bg_alpha_color="DkGray"
      bg_opaque_color="DkGray"
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index fc86349235..c15b2f02d4 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -1,11 +1,11 @@
     <panel
-      height="430"
+      height="395"
       width="304"
       name="panel_social_photo">
       <layout_stack
 	   layout="topleft"
        border_size="0"
-       height="422"
+       height="395"
 	   width="304"
        follows="all"
        orientation="vertical"
@@ -20,9 +20,6 @@
             height="295"
             width="286"
             left="7"
-            background_opaque="true"
-            background_visible="true"
-            bg_opaque_color="DkGray2"
             label="snapshot_panel"
             help_topic="snapshot_panel"
             name="snapshot_panel">
@@ -216,21 +213,10 @@
         <layout_panel
           name="photo_button_panel"
           height="96">
-          <panel
-            height="96"
-            top="0"
-            follows="all"
-            left="7"
-            right="-10"
-            background_opaque="true"
-            background_visible="true"
-            bg_opaque_color="DkGray"
-            label="button_container"
-            help_topic="button_container"
-            name="button_container"/>
           <button
            follows="left|top"
            top="15"
+           left="9"
            height="23"
            label="Post"
            name="post_btn"
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
index 30b48d9bb1..03068dddc6 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -1,11 +1,12 @@
     <panel
-      height="430"
-      width="304"	  
+      height="395"
+      width="304"
+	  layout="topleft"
       name="panel_social_place">
       <layout_stack
 	    layout="topleft"
         border_size="0"
-        height="422"
+        height="395"
         follows="all"
         orientation="vertical"
         name="stack_place"
@@ -20,13 +21,13 @@
             height="16"
             left="9"
             name="place_caption_label"
-            top_pad="12"
+            top="1"
             type="string">
             Say something about where you are:
           </text>
           <text_editor
             follows="top|left|right"
-            height="94"
+            height="80"
             right="-9"
             left="9"
             length="1"
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
index ae199e7e38..f817a515e7 100644
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -1,42 +1,57 @@
     <panel
-	 height="430"
+	 height="395"
 	 width="304"
+	 layout="topleft"
      name="panel_social_status">
-      <text
+     <layout_stack
+      layout="topleft"
+      border_size="0"
+      height="395"
+      follows="all"
+      orientation="vertical"
+      name="stack_status"
+      top="8">
+      <layout_panel
+       name="status_detail_panel"
+       height="255">
+       <text
         length="1"
         follows="top|left|right"
         font="SansSerif"
         height="16"
         left="9"
-        name="caption_label"
-        top_pad="18"
+        name="status_caption_label"
+        top="1"
         type="string">
         What's on your mind?
-      </text>
-      <text_editor
-        follows="left|top"
+       </text>
+       <text_editor
+        follows="left|top|right"
         height="80"
-        width="280"
+        right="-9"
         left="9"
         length="1"
         max_length="700"
         name="status_message"
         type="string"
         word_wrap="true">
-      </text_editor>
-      <button
-	    layout="topleft"
+       </text_editor>
+      </layout_panel>
+      <layout_panel
+       name="status_button_panel"
+       height="96">
+       <button
         follows="left|top"
+        top="5"
+        left="9"
         height="23"
         label="Post"
         name="post_status_btn"
-        top_pad="18"
         width="100">
         <button.commit_callback
           function="SocialSharing.SendStatus" />
-      </button>
-      <button
-	    layout="topleft"
+       </button>
+       <button
         follows="left|top"
         height="23"
         label="Cancel"
@@ -46,5 +61,7 @@
         width="100">
         <button.commit_callback
           function="SocialSharing.Cancel" />
-      </button>
+       </button>
+      </layout_panel>
+     </layout_stack>
     </panel>
\ No newline at end of file
-- 
cgit v1.2.3


From 1dbabed6b5bac8a0fcc1d9a70522eb726e01bae7 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 3 Jul 2013 23:42:02 +0100
Subject: made listeners more robust in llfloatersocial.cpp for ACME-665

---
 indra/newview/llfloatersocial.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 57b6cccd32..67a9f0c742 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -103,6 +103,7 @@ void LLSocialStatusPanel::onSend()
 	}
 	else
 	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening
 		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
@@ -310,6 +311,7 @@ void LLSocialPhotoPanel::onSend()
 	}
 	else
 	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening
 		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
@@ -535,6 +537,7 @@ void LLSocialCheckinPanel::onSend()
 	}
 	else
 	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening
 		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
-- 
cgit v1.2.3


From ad8aeecb8331ca68eef9a12536c80a4658885ccb Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 4 Jul 2013 01:29:54 +0100
Subject: Added auto-connect upon 404 from a POST in LLFacebookConnect, and
 added FB_POSTED state, for ACME-667

---
 indra/newview/llfacebookconnect.cpp |  6 ++++-
 indra/newview/llfacebookconnect.h   |  5 ++--
 indra/newview/llfloatersocial.cpp   | 51 ++++++++++++++++++++++++-------------
 3 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 30fb63084b..07204531de 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -145,7 +145,11 @@ public:
             toast_user_for_success();
 			LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL;
 			
-			LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+			LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTED);
+		}
+		else if (status == 404)
+		{
+			LLFacebookConnect::instance().connectToFacebook();
 		}
 		else
 		{
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index ddff87385e..b37c713ae5 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -50,7 +50,8 @@ public:
 		FB_CONNECTED = 2,
 		FB_CONNECTION_FAILED = 3,
 		FB_POSTING = 4,
-		FB_POST_FAILED = 5
+		FB_POSTED = 5,
+		FB_POST_FAILED = 6
 	};
 	
 	typedef boost::function<void(bool ok)> share_callback_t;
@@ -76,7 +77,7 @@ public:
     const LLSD& getContent() const;
     
     void setConnectionState(EConnectionState connection_state);
-	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING)); }
+	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
     EConnectionState getConnectionState() { return mConnectionState; }
     S32  generation() { return mGeneration; }
     
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 67a9f0c742..eb3ceaf96e 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -96,6 +96,9 @@ void LLSocialStatusPanel::draw()
 
 void LLSocialStatusPanel::onSend()
 {
+	LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening
+	LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1));
+		
 	// Connect to Facebook if necessary and then post
 	if (LLFacebookConnect::instance().isConnected())
 	{
@@ -103,19 +106,21 @@ void LLSocialStatusPanel::onSend()
 	}
 	else
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening
-		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
 }
 
 bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data)
 {
-	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	switch (data.get("enum").asInteger())
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel");
-		
-		sendStatus();
+		case LLFacebookConnect::FB_CONNECTED:
+			sendStatus();
+			break;
+
+		case LLFacebookConnect::FB_POSTED:
+			LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel");
+			break;
 	}
 
 	return false;
@@ -304,6 +309,9 @@ void LLSocialPhotoPanel::onClickNewSnapshot()
 
 void LLSocialPhotoPanel::onSend()
 {
+	LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening
+	LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1));
+	
 	// Connect to Facebook if necessary and then post
 	if (LLFacebookConnect::instance().isConnected())
 	{
@@ -311,19 +319,21 @@ void LLSocialPhotoPanel::onSend()
 	}
 	else
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening
-		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
 }
 
 bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
 {
-	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	switch (data.get("enum").asInteger())
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel");
-		
-		sendPhoto();
+		case LLFacebookConnect::FB_CONNECTED:
+			sendPhoto();
+			break;
+
+		case LLFacebookConnect::FB_POSTED:
+			LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel");
+			break;
 	}
 
 	return false;
@@ -530,6 +540,9 @@ void LLSocialCheckinPanel::draw()
 
 void LLSocialCheckinPanel::onSend()
 {
+	LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening
+	LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1));
+	
 	// Connect to Facebook if necessary and then post
 	if (LLFacebookConnect::instance().isConnected())
 	{
@@ -537,19 +550,21 @@ void LLSocialCheckinPanel::onSend()
 	}
 	else
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening
-		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1));
 		LLFacebookConnect::instance().checkConnectionToFacebook(true);
 	}
 }
 
 bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
 {
-	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
+	switch (data.get("enum").asInteger())
 	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
-		
-		sendCheckin();
+		case LLFacebookConnect::FB_CONNECTED:
+			sendCheckin();
+			break;
+
+		case LLFacebookConnect::FB_POSTED:
+			LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
+			break;
 	}
 
 	return false;
-- 
cgit v1.2.3


From fd4262541946770515ce8a486dd3a69245365def Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 4 Jul 2013 02:01:51 +0100
Subject: Close floater and clear text upon FB_POSTED for ACME-668

---
 indra/newview/llfloatersocial.cpp | 38 ++++++++++++++++++++++++++++++++++++++
 indra/newview/llfloatersocial.h   |  3 +++
 2 files changed, 41 insertions(+)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index eb3ceaf96e..2ecadcfaf6 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -120,6 +120,7 @@ bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data)
 
 		case LLFacebookConnect::FB_POSTED:
 			LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel");
+			clearAndClose();
 			break;
 	}
 
@@ -135,6 +136,17 @@ void LLSocialStatusPanel::sendStatus()
 	}
 }
 
+void LLSocialStatusPanel::clearAndClose()
+{
+	mMessageTextEditor->setValue("");
+
+	LLFloater* floater = getParentByType<LLFloater>();
+	if (floater)
+	{
+		floater->closeFloater();
+	}
+}
+
 ///////////////////////////
 //LLSocialPhotoPanel///////
 ///////////////////////////
@@ -333,6 +345,7 @@ bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
 
 		case LLFacebookConnect::FB_POSTED:
 			LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel");
+			clearAndClose();
 			break;
 	}
 
@@ -365,6 +378,17 @@ void LLSocialPhotoPanel::sendPhoto()
 	updateControls();
 }
 
+void LLSocialPhotoPanel::clearAndClose()
+{
+	mCaptionTextBox->setValue("");
+
+	LLFloater* floater = getParentByType<LLFloater>();
+	if (floater)
+	{
+		floater->closeFloater();
+	}
+}
+
 void LLSocialPhotoPanel::updateControls()
 {
 	LLSnapshotLivePreview* previewp = getPreviewView();
@@ -564,6 +588,7 @@ bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
 
 		case LLFacebookConnect::FB_POSTED:
 			LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
+			clearAndClose();
 			break;
 	}
 
@@ -595,6 +620,17 @@ void LLSocialCheckinPanel::sendCheckin()
 	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
 }
 
+void LLSocialCheckinPanel::clearAndClose()
+{
+	getChild<LLUICtrl>("place_caption")->setValue("");
+
+	LLFloater* floater = getParentByType<LLFloater>();
+	if (floater)
+	{
+		floater->closeFloater();
+	}
+}
+
 ////////////////////////
 //LLFloaterSocial///////
 ////////////////////////
@@ -680,6 +716,8 @@ void LLFloaterSocial::draw()
             mStatusLoadingIndicator->setVisible(true);
             break;
         case LLFacebookConnect::FB_CONNECTED:
+			break;
+        case LLFacebookConnect::FB_POSTED:
             break;
         case LLFacebookConnect::FB_CONNECTION_FAILED:
         case LLFacebookConnect::FB_POST_FAILED:
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index e37facbbce..5e1ee6be0e 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -45,6 +45,7 @@ public:
 	bool onFacebookConnectStateChange(const LLSD& data);
 
 	void sendStatus();
+	void clearAndClose();
 
 private:
 	LLUICtrl* mMessageTextEditor;
@@ -67,6 +68,7 @@ public:
 	bool onFacebookConnectStateChange(const LLSD& data);
 
 	void sendPhoto();
+	void clearAndClose();
 
 	void updateControls();
 	void updateResolution(BOOL do_update);
@@ -101,6 +103,7 @@ public:
 	bool onFacebookConnectStateChange(const LLSD& data);
 
 	void sendCheckin();
+	void clearAndClose();
 
 private:
     std::string mMapUrl;
-- 
cgit v1.2.3


From 85824ebc0931d4ac89e375b35dbccd1295746e31 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 4 Jul 2013 02:13:47 +0100
Subject: Removed share callbacks from LLFacebookConnect

---
 indra/newview/llfacebookconnect.cpp | 19 +++----------------
 indra/newview/llfacebookconnect.h   |  7 -------
 2 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 07204531de..816947827c 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -133,11 +133,6 @@ public:
 		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING);
 	}
 	
-	LLFacebookShareResponder(LLFacebookConnect::share_callback_t cb) : mShareCallback(cb)
-	{
-		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING);
-	}
-    
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		if (isGoodStatus(status))
@@ -156,11 +151,6 @@ public:
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POST_FAILED);
             log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description"));
 		}
-		
-		if (mShareCallback)
-		{
-			mShareCallback(isGoodStatus(status));
-		}
 	}
     
     void completedHeader(U32 status, const std::string& reason, const LLSD& content)
@@ -170,9 +160,6 @@ public:
             LLFacebookConnect::instance().openFacebookWeb(content["location"]);
         }
     }
-    
-private:
-	LLFacebookConnect::share_callback_t mShareCallback;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -346,7 +333,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri
 		body["message"] = message;
 
 	// Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder(mPostCheckinCallback));
+	LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder());
 }
 
 void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption)
@@ -409,7 +396,7 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std:
 	memcpy(data, body.str().data(), size);
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(mSharePhotoCallback), headers);
+	LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers);
 }
 
 void LLFacebookConnect::updateStatus(const std::string& message)
@@ -418,7 +405,7 @@ void LLFacebookConnect::updateStatus(const std::string& message)
 	body["message"] = message;
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder(mUpdateStatusCallback));
+	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder());
 }
 
 void LLFacebookConnect::storeContent(const LLSD& content)
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index b37c713ae5..a06e53b90e 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -54,7 +54,6 @@ public:
 		FB_POST_FAILED = 6
 	};
 	
-	typedef boost::function<void(bool ok)> share_callback_t;
 	typedef boost::function<void()> content_updated_callback_t;
 
 	void connectToFacebook(const std::string& auth_code = "");	// Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use.
@@ -67,9 +66,6 @@ public:
 	void sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption);
 	void updateStatus(const std::string& message);
 	
-	void setPostCheckinCallback(share_callback_t cb) { mPostCheckinCallback = cb; }
-	void setSharePhotoCallback(share_callback_t cb) { mSharePhotoCallback = cb; }
-	void setUpdateStatusCallback(share_callback_t cb) { mUpdateStatusCallback = cb; }
 	void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;}
 
     void clearContent();
@@ -94,9 +90,6 @@ private:
     LLSD mContent;
     S32  mGeneration;
 	
-	share_callback_t mPostCheckinCallback;
-	share_callback_t mSharePhotoCallback;
-	share_callback_t mUpdateStatusCallback;
 	content_updated_callback_t mContentUpdatedCallback;
 
 	static boost::scoped_ptr<LLEventPump> sStateWatcher;
-- 
cgit v1.2.3


From f7a1f7b784fff0579e4d1fecd8265d0f960bd7f4 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Thu, 4 Jul 2013 02:43:09 +0100
Subject: Replaced content change callback with an event in LLFacebookConnect
 for ACME-648 (more or less)

---
 indra/newview/llfacebookconnect.cpp | 15 ++-------------
 indra/newview/llfacebookconnect.h   |  7 +------
 indra/newview/llpanelpeople.cpp     | 10 +++++++---
 indra/newview/llpanelpeople.h       |  2 +-
 4 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 816947827c..30ebedca25 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -41,6 +41,7 @@
 #include "llevents.h"
 
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState"));
+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)
@@ -413,10 +414,7 @@ void LLFacebookConnect::storeContent(const LLSD& content)
     mGeneration++;
     mContent = content;
 
-	if(mContentUpdatedCallback)
-	{
-		mContentUpdatedCallback();
-	}
+	sContentWatcher->post(content);
 }
 
 const LLSD& LLFacebookConnect::getContent() const
@@ -441,12 +439,3 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c
 	
 	mConnectionState = connection_state;
 }
-    
-
-
-
-
-
-
-
-
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index a06e53b90e..7b6eb3644f 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -54,8 +54,6 @@ public:
 		FB_POST_FAILED = 6
 	};
 	
-	typedef boost::function<void()> content_updated_callback_t;
-
 	void connectToFacebook(const std::string& auth_code = "");	// 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().
@@ -66,8 +64,6 @@ public:
 	void sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption);
 	void updateStatus(const std::string& message);
 	
-	void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;}
-
     void clearContent();
 	void storeContent(const LLSD& content);
     const LLSD& getContent() const;
@@ -90,9 +86,8 @@ private:
     LLSD mContent;
     S32  mGeneration;
 	
-	content_updated_callback_t mContentUpdatedCallback;
-
 	static boost::scoped_ptr<LLEventPump> sStateWatcher;
+	static boost::scoped_ptr<LLEventPump> sContentWatcher;
 };
 
 #endif // LL_LLFACEBOOKCONNECT_H
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 8c8cad0743..766335c982 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -781,7 +781,7 @@ void LLPanelPeople::updateFriendList()
 	showFriendsAccordionsIfNeeded();
 }
 
-void LLPanelPeople::updateSuggestedFriendList()
+bool LLPanelPeople::updateSuggestedFriendList()
 {
 	if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
 	{
@@ -814,6 +814,8 @@ void LLPanelPeople::updateSuggestedFriendList()
 		mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
 		showFriendsAccordionsIfNeeded();
 	}
+
+	return false;
 }
 
 void LLPanelPeople::updateNearbyList()
@@ -855,7 +857,8 @@ void LLPanelPeople::updateFacebookList(bool visible)
 {
 	if (visible)
 	{
-		LLFacebookConnect::instance().setContentUpdatedCallback(boost::bind(&LLPanelPeople::updateSuggestedFriendList, this));
+		LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening
+		LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this));
 
 		if (mTryToConnectToFbc)
 		{
@@ -866,6 +869,7 @@ void LLPanelPeople::updateFacebookList(bool visible)
 			}
 			else
 			{
+				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));
 				LLFacebookConnect::instance().checkConnectionToFacebook();
 			}
@@ -878,7 +882,7 @@ void LLPanelPeople::updateFacebookList(bool visible)
 	}
 	else
 	{
-		LLFacebookConnect::instance().setContentUpdatedCallback(NULL);
+		LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople");
 	}
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index c6ee7b8165..b746835dfb 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -76,7 +76,7 @@ private:
 	// methods indirectly called by the updaters
 	void					updateFriendListHelpText();
 	void					updateFriendList();
-	void					updateSuggestedFriendList();
+	bool					updateSuggestedFriendList();
 	void					updateNearbyList();
 	void					updateRecentList();
 	void					updateFacebookList(bool visible);
-- 
cgit v1.2.3


From 6e8b353575f670e50267cb172860a3f8da1dbbd0 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 3 Jul 2013 19:29:42 -0700
Subject: ACME-626 : Simplify the preview drawing code and positioning

---
 indra/newview/llfloatersocial.cpp                  | 53 ++--------------------
 .../skins/default/xui/en/floater_social.xml        |  3 --
 .../skins/default/xui/en/panel_social_photo.xml    | 53 +++++++++-------------
 3 files changed, 27 insertions(+), 82 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index a0dbb7ea95..fce9d1b28f 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -178,76 +178,33 @@ void LLSocialPhotoPanel::draw()
 { 
 	LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
 
-	LLPanel::draw();
-
-	if(previewp && previewp->getThumbnailImage())
+	if (previewp && previewp->getThumbnailImage())
 	{
-		bool working = false; //impl.getStatus() == Impl::STATUS_WORKING;
 		const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
+		const LLRect& snapshot_rect = mSnapshotPanel->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 ; // preview y pos within the preview rect
 
 		// calc preview offset within the floater rect
 		S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
-		S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
+		S32 offset_y = thumbnail_rect.mBottom - (snapshot_rect.mTop - thumbnail_rect.mTop);
 
 		mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType<LLFloater>());
 
 		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 = working ? LLColor4::grey4 : LLColor4::white;
+		LLColor4 color = LLColor4::white;
 		gl_draw_scaled_image(offset_x, offset_y, 
 			thumbnail_w, thumbnail_h,
 			previewp->getThumbnailImage(), color % alpha);
 
 		previewp->drawPreviewRect(offset_x, offset_y) ;
-
-		// Draw some controls on top of the preview thumbnail.
-		static const S32 PADDING = 5;
-		static const S32 REFRESH_LBL_BG_HEIGHT = 32;
-
-		// Reshape and position the posting result message panels at the top of the thumbnail.
-		// Do this regardless of current posting status (finished or not) to avoid flicker
-		// when the result message is displayed for the first time.
-		// if (impl.getStatus() == Impl::STATUS_FINISHED)
-		{
-			LLRect result_lbl_rect = mSucceessLblPanel->getRect();
-			const S32 result_lbl_h = result_lbl_rect.getHeight();
-			result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h);
-			mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
-			mSucceessLblPanel->setRect(result_lbl_rect);
-			mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
-			mFailureLblPanel->setRect(result_lbl_rect);
-		}
-
-		// Position the refresh button in the bottom left corner of the thumbnail.
-		mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING);
-
-		if (mNeedRefresh)
-		{
-			// Place the refresh hint text to the right of the refresh button.
-			const LLRect& refresh_btn_rect = mRefreshBtn->getRect();
-			mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom);
-
-			// Draw the refresh hint background.
-			LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y);
-			gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE);
-		}
-
-		gGL.pushUIMatrix();
-		S32 x_pos;
-		S32 y_pos;
-		mSnapshotPanel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, getParentByType<LLFloater>());
-
-		LLUI::translate((F32) x_pos, (F32) y_pos);
-		mThumbnailPlaceholder->draw();
-		gGL.popUIMatrix();
 	}
+	LLPanel::draw();
 }
 
 LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 3ce6841a3a..40800c87e6 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -36,9 +36,6 @@
       filename="panel_social_photo.xml"
       class="llsocialphotopanel"
       follows="all"
-      background_visible="true"
-      bg_alpha_color="DkGray"
-      bg_opaque_color="DkGray"
       label="PHOTO"
       help_topic="panel_social_photo"
       name="panel_social_photo"/>
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index c15b2f02d4..72e5286fe6 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -1,15 +1,15 @@
     <panel
       height="395"
       width="304"
+      layout="topleft"
       name="panel_social_photo">
       <layout_stack
 	   layout="topleft"
        border_size="0"
        height="395"
-	   width="304"
-       follows="all"
+       follows="top|left|right"
        orientation="vertical"
-       name="stack1"
+       name="stack_photo"
        top="8">
         <layout_panel	
          name="photo_detail_panel"
@@ -57,31 +57,28 @@
              length="1"
              halign="right"
              name="file_size_label"
-             top="12"
+             top="9"
              type="string"
              width="50">
               [SIZE] KB
             </text>
-            <ui_ctrl
+            <panel
                 height="150"
                 width="250"
+                visible="true"
                 name="thumbnail_placeholder"
-                top_pad="5"
+                top="33"
                 follows="left|top"
                 left="9">
               <panel
                background_visible="true"
                bg_alpha_color="0.9 1 0.9 1"
                follows="left|top"
-               font="SansSerifLarge"
-               halign="center"
                height="20"
+               width="250"
+               top="0"
                left="0"
-               length="1"
                name="succeeded_panel"
-               right="-1"
-               top="0"
-               type="string"
                visible="false">
                 <text
                  follows="all"
@@ -103,15 +100,11 @@
                background_visible="true"
                bg_alpha_color="1 0.9 0.9 1"
                follows="left|top"
-               font="SansSerifLarge"
-               halign="center"
                height="20"
-               left_delta="0"
-               length="1"
-               name="failed_panel"
-               right="-1"
+               width="250"
                top="0"
-               type="string"
+               left="0"
+               name="failed_panel"
                visible="false">
                 <text
                  follows="all"
@@ -131,12 +124,12 @@
               </panel>
               <loading_indicator
                follows="left|top"
-               height="48"
+               height="24"
                name="working_indicator"
-               left="101"
-               top="46"
+               left="113"
+               top="59"
                visible="false"
-               width="48" />
+               width="24" />
               <text
                follows="left|top|right"
                font="SansSerifBold"
@@ -149,17 +142,16 @@
                top="98"
                translate="false"
                type="string"
-               visible="false"
-               width="130">
+               visible="false">
                 Working
               </text>
               <button
                follows="left|top"
                height="22"
                image_overlay="Refresh_Off"
-               left="20"
+               left="10"
                name="new_snapshot_btn"
-               bottom="-20"
+               bottom="-10"
                visible="false"
                width="22" />
               <text
@@ -170,16 +162,15 @@
                left_pad="10"
                length="1"
                name="refresh_lbl"
-               right="-5"
                text_color="red"
-               top_delta="0"
+               top_delta="4"
                translate="false"
                type="string"
                visible="false"
                width="130">
-                Refresh to save.
+                Refresh to save
               </text>
-            </ui_ctrl>
+            </panel>
             <text
              length="1"
              follows="top|left|right"
-- 
cgit v1.2.3


From 5c88b679bd2f66fd6fa358ca93047c0aba781e22 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Sun, 7 Jul 2013 22:59:51 -0700
Subject: ACME-626 : More snapshot code cleanup, suppress failure/success
 indicators since we have a bottom message for that, show/hide the progress
 indicator

---
 indra/newview/llfloatersocial.cpp                  | 27 +++++++++--
 indra/newview/llfloatersocial.h                    |  5 ++-
 .../skins/default/xui/en/panel_social_photo.xml    | 52 ----------------------
 3 files changed, 26 insertions(+), 58 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 58a9edc524..6d4262a599 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -156,8 +156,8 @@ mSnapshotPanel(NULL),
 mResolutionComboBox(NULL),
 mRefreshBtn(NULL),
 mRefreshLabel(NULL),
-mSucceessLblPanel(NULL),
-mFailureLblPanel(NULL),
+mWorkingIndicator(NULL),
+mWorkingLabel(NULL),
 mThumbnailPlaceholder(NULL),
 mCaptionTextBox(NULL),
 mLocationCheckbox(NULL),
@@ -184,8 +184,8 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
 	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
-	mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
-	mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
+    mWorkingIndicator = getChild<LLLoadingIndicator>("working_indicator");
+    mWorkingLabel = getChild<LLUICtrl>("working_lbl");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
 	mCaptionTextBox = getChild<LLUICtrl>("caption");
 	mLocationCheckbox = getChild<LLUICtrl>("add_location_cb");
@@ -198,6 +198,7 @@ void LLSocialPhotoPanel::draw()
 { 
 	LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
 
+    // Display the preview if one is available
 	if (previewp && previewp->getThumbnailImage())
 	{
 		const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
@@ -224,6 +225,24 @@ void LLSocialPhotoPanel::draw()
 
 		previewp->drawPreviewRect(offset_x, offset_y) ;
 	}
+
+    // Update the visibility of the working (computing preview) indicators
+	if (previewp && previewp->getSnapshotUpToDate())
+	{
+        if (mWorkingIndicator->getVisible())
+        {
+            mWorkingIndicator->setVisible(false);
+            mWorkingIndicator->stop();
+            mWorkingLabel->setVisible(false);
+        }
+    }
+    else if (!mWorkingIndicator->getVisible())
+    {
+        mWorkingIndicator->setVisible(true);
+        mWorkingIndicator->start();
+        mWorkingLabel->setVisible(true);
+    }
+    
 	LLPanel::draw();
 }
 
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 5e1ee6be0e..a39210108a 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -28,6 +28,7 @@
 #define LL_LLFLOATERSOCIAL_H
 
 #include "llfloater.h"
+#include "llloadingindicator.h"
 #include "lltextbox.h"
 #include "llviewertexture.h"
 
@@ -83,8 +84,8 @@ private:
 	LLUICtrl * mResolutionComboBox;
 	LLUICtrl * mRefreshBtn;
 	LLUICtrl * mRefreshLabel;
-	LLUICtrl * mSucceessLblPanel;
-	LLUICtrl * mFailureLblPanel;
+	LLLoadingIndicator * mWorkingIndicator;
+	LLUICtrl * mWorkingLabel;
 	LLUICtrl * mThumbnailPlaceholder;
 	LLUICtrl * mCaptionTextBox;
 	LLUICtrl * mLocationCheckbox;
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index 72e5286fe6..d14e9ec82f 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -70,58 +70,6 @@
                 top="33"
                 follows="left|top"
                 left="9">
-              <panel
-               background_visible="true"
-               bg_alpha_color="0.9 1 0.9 1"
-               follows="left|top"
-               height="20"
-               width="250"
-               top="0"
-               left="0"
-               name="succeeded_panel"
-               visible="false">
-                <text
-                 follows="all"
-                 font="SansSerif"
-                 halign="center"
-                 height="18"
-                 left="1"
-                 length="1"
-                 name="succeeded_lbl"
-                 right="-1"
-                 text_color="0.2 0.5 0.2 1"
-                 top="4"
-                 translate="false"
-                 type="string">
-                  Succeeded
-                </text>
-              </panel>
-              <panel
-               background_visible="true"
-               bg_alpha_color="1 0.9 0.9 1"
-               follows="left|top"
-               height="20"
-               width="250"
-               top="0"
-               left="0"
-               name="failed_panel"
-               visible="false">
-                <text
-                 follows="all"
-                 font="SansSerif"
-                 halign="center"
-                 height="18"
-                 left="1"
-                 length="1"
-                 name="failed_lbl"
-                 right="-1"
-                 text_color="0.5 0.2 0.2 1"
-                 top="4"
-                 translate="false"
-                 type="string">
-                  Failed
-                </text>
-              </panel>
               <loading_indicator
                follows="left|top"
                height="24"
-- 
cgit v1.2.3


From b9a94613875d05dfd8e2971059e343720294d6d6 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Mon, 8 Jul 2013 19:00:19 +0100
Subject: adjusted layout of social status panel

---
 indra/newview/skins/default/xui/en/panel_social_status.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
index f817a515e7..c9bdf3b645 100644
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -13,7 +13,7 @@
       top="8">
       <layout_panel
        name="status_detail_panel"
-       height="255">
+       height="40">
        <text
         length="1"
         follows="top|left|right"
@@ -64,4 +64,4 @@
        </button>
       </layout_panel>
      </layout_stack>
-    </panel>
\ No newline at end of file
+    </panel>
-- 
cgit v1.2.3


From a1cc147829be2c341721ea75f713ac66279ad40c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 8 Jul 2013 13:41:59 -0700
Subject: ACME-626 : More snapshot panel cleanup, autorefresh when changing
 resolution, simplify working messaging, add tooltip to the refresh button

---
 indra/newview/llfloatersocial.cpp                  | 37 +++-------------------
 indra/newview/llfloatersocial.h                    |  6 ----
 .../skins/default/xui/en/panel_social_photo.xml    | 29 ++---------------
 3 files changed, 7 insertions(+), 65 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 6d4262a599..9986a9c230 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -155,8 +155,6 @@ LLSocialPhotoPanel::LLSocialPhotoPanel() :
 mSnapshotPanel(NULL),
 mResolutionComboBox(NULL),
 mRefreshBtn(NULL),
-mRefreshLabel(NULL),
-mWorkingIndicator(NULL),
 mWorkingLabel(NULL),
 mThumbnailPlaceholder(NULL),
 mCaptionTextBox(NULL),
@@ -183,8 +181,6 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE));
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
-	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
-    mWorkingIndicator = getChild<LLLoadingIndicator>("working_indicator");
     mWorkingLabel = getChild<LLUICtrl>("working_lbl");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
 	mCaptionTextBox = getChild<LLUICtrl>("caption");
@@ -226,23 +222,10 @@ void LLSocialPhotoPanel::draw()
 		previewp->drawPreviewRect(offset_x, offset_y) ;
 	}
 
-    // Update the visibility of the working (computing preview) indicators
-	if (previewp && previewp->getSnapshotUpToDate())
-	{
-        if (mWorkingIndicator->getVisible())
-        {
-            mWorkingIndicator->setVisible(false);
-            mWorkingIndicator->stop();
-            mWorkingLabel->setVisible(false);
-        }
-    }
-    else if (!mWorkingIndicator->getVisible())
-    {
-        mWorkingIndicator->setVisible(true);
-        mWorkingIndicator->start();
-        mWorkingLabel->setVisible(true);
-    }
+    // Update the visibility of the working (computing preview) label
+    mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate()));
     
+    // Draw the rest of the panel on top of it
 	LLPanel::draw();
 }
 
@@ -439,7 +422,7 @@ void LLSocialPhotoPanel::updateResolution(BOOL do_update)
 			{
 				lldebugs << "Will update controls" << llendl;
 				updateControls();
-				setNeedRefresh(true);
+                LLSocialPhotoPanel::onClickNewSnapshot();
 			}
 		}
 		
@@ -467,12 +450,6 @@ void LLSocialPhotoPanel::checkAspectRatio(S32 index)
 	}
 }
 
-void LLSocialPhotoPanel::setNeedRefresh(bool need)
-{
-	mRefreshLabel->setVisible(need);
-	mNeedRefresh = need;
-}
-
 LLUICtrl* LLSocialPhotoPanel::getRefreshBtn()
 {
 	return mRefreshBtn;
@@ -644,9 +621,6 @@ void LLFloaterSocial::preUpdate()
 	{
 		//Will set file size text to 'unknown'
 		instance->mSocialPhotoPanel->updateControls();
-
-		//Hides the refresh text
-		instance->mSocialPhotoPanel->setNeedRefresh(false);
 	}
 }
 
@@ -659,9 +633,6 @@ void LLFloaterSocial::postUpdate()
 		//Will set the file size text
 		instance->mSocialPhotoPanel->updateControls();
 
-		//Hides the refresh text
-		instance->mSocialPhotoPanel->setNeedRefresh(false);
-
 		// The refresh button is initially hidden. We show it after the first update,
 		// i.e. after snapshot is taken
 		LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn();
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index a39210108a..cc47fb61e1 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -28,7 +28,6 @@
 #define LL_LLFLOATERSOCIAL_H
 
 #include "llfloater.h"
-#include "llloadingindicator.h"
 #include "lltextbox.h"
 #include "llviewertexture.h"
 
@@ -74,7 +73,6 @@ public:
 	void updateControls();
 	void updateResolution(BOOL do_update);
 	void checkAspectRatio(S32 index);
-	void setNeedRefresh(bool need);
 	LLUICtrl* getRefreshBtn();
 
 private:
@@ -83,15 +81,11 @@ private:
 	LLUICtrl * mSnapshotPanel;
 	LLUICtrl * mResolutionComboBox;
 	LLUICtrl * mRefreshBtn;
-	LLUICtrl * mRefreshLabel;
-	LLLoadingIndicator * mWorkingIndicator;
 	LLUICtrl * mWorkingLabel;
 	LLUICtrl * mThumbnailPlaceholder;
 	LLUICtrl * mCaptionTextBox;
 	LLUICtrl * mLocationCheckbox;
 	LLUICtrl * mPostButton;
-
-	bool mNeedRefresh;
 };
 
 class LLSocialCheckinPanel : public LLPanel
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index d14e9ec82f..162884f01d 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -70,14 +70,6 @@
                 top="33"
                 follows="left|top"
                 left="9">
-              <loading_indicator
-               follows="left|top"
-               height="24"
-               name="working_indicator"
-               left="113"
-               top="59"
-               visible="false"
-               width="24" />
               <text
                follows="left|top|right"
                font="SansSerifBold"
@@ -91,33 +83,18 @@
                translate="false"
                type="string"
                visible="false">
-                Working
+                Refreshing...
               </text>
               <button
                follows="left|top"
                height="22"
                image_overlay="Refresh_Off"
-               left="10"
+               left="20"
                name="new_snapshot_btn"
+               tool_tip="Click to refresh"
                bottom="-10"
                visible="false"
                width="22" />
-              <text
-               follows="left|top"
-               font="SansSerifBold"
-               halign="left"
-               height="18"
-               left_pad="10"
-               length="1"
-               name="refresh_lbl"
-               text_color="red"
-               top_delta="4"
-               translate="false"
-               type="string"
-               visible="false"
-               width="130">
-                Refresh to save
-              </text>
             </panel>
             <text
              length="1"
-- 
cgit v1.2.3


From aa19308473c5733138eb378863e0944659d56689 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Mon, 8 Jul 2013 22:46:00 +0100
Subject: got rid of gray background on social floater

---
 indra/newview/skins/default/xui/en/floater_social.xml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 40800c87e6..cd5609b0f8 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -20,7 +20,7 @@
    tab_height="30"
    tab_position="top"
    top="7"
-   height="395"
+   height="430"
    halign="center">
     <panel
      filename="panel_social_status.xml"
@@ -36,6 +36,9 @@
       filename="panel_social_photo.xml"
       class="llsocialphotopanel"
       follows="all"
+      background_visible="true"
+      bg_alpha_color="DkGray"
+      bg_opaque_color="DkGray"
       label="PHOTO"
       help_topic="panel_social_photo"
       name="panel_social_photo"/>
@@ -53,7 +56,8 @@
   <panel
    name="connection_status_panel"
    follows="left|top"
-   height="26">
+   height="26"
+   top_pad="-30">
    <text
      name="connection_error_text"
      type="string"
-- 
cgit v1.2.3


From 0be0b0e8b01338564b1502b8bb2b40e5a9454b0f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 8 Jul 2013 16:01:20 -0700
Subject: ACME-651 : Implement all missing status messages, tweak colors and
 positioning

---
 indra/newview/llfloatersocial.cpp                  | 24 ++++++++++++--
 indra/newview/llfloatersocial.h                    |  4 ++-
 .../skins/default/xui/en/floater_social.xml        | 37 ++++++++++++++++++++--
 3 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 9986a9c230..1d47213a3a 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -591,7 +591,9 @@ void LLSocialCheckinPanel::clearAndClose()
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
     mSocialPhotoPanel(NULL),
     mStatusErrorText(NULL),
+    mStatusPostingErrorText(NULL),
     mStatusLoadingText(NULL),
+    mStatusPostingText(NULL),
     mStatusLoadingIndicator(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
@@ -608,7 +610,9 @@ BOOL LLFloaterSocial::postBuild()
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
     // Connection status widgets
     mStatusErrorText = getChild<LLTextBox>("connection_error_text");
+    mStatusPostingErrorText = getChild<LLTextBox>("connection_error_posting_text");
     mStatusLoadingText = getChild<LLTextBox>("connection_loading_text");
+    mStatusPostingText = getChild<LLTextBox>("connection_posting_text");
     mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator");
 	return LLFloater::postBuild();
 }
@@ -647,29 +651,43 @@ void LLFloaterSocial::postUpdate()
 
 void LLFloaterSocial::draw()
 {
-    if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
+    if (mStatusErrorText && mStatusPostingErrorText && mStatusLoadingText && mStatusPostingText && mStatusLoadingIndicator)
     {
         mStatusErrorText->setVisible(false);
+        mStatusPostingErrorText->setVisible(false);
         mStatusLoadingText->setVisible(false);
+        mStatusPostingText->setVisible(false);
         mStatusLoadingIndicator->setVisible(false);
         LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
         switch (connection_state)
         {
         case LLFacebookConnect::FB_NOT_CONNECTED:
+            // No status displayed when first opening the panel and no connection done
             break;
         case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
-        case LLFacebookConnect::FB_POSTING:
+            // Connection loading indicator
             mStatusLoadingText->setVisible(true);
             mStatusLoadingIndicator->setVisible(true);
             break;
+        case LLFacebookConnect::FB_POSTING:
+            // Posting indicator
+            mStatusPostingText->setVisible(true);
+            mStatusLoadingIndicator->setVisible(true);
+            break;
         case LLFacebookConnect::FB_CONNECTED:
+            // When successfully connected, no message is displayed
 			break;
         case LLFacebookConnect::FB_POSTED:
+            // No success message to show since we actually close the floater after successful posting completion
             break;
         case LLFacebookConnect::FB_CONNECTION_FAILED:
-        case LLFacebookConnect::FB_POST_FAILED:
+            // Error connecting to the service
             mStatusErrorText->setVisible(true);
             break;
+        case LLFacebookConnect::FB_POST_FAILED:
+            // Error posting to the service
+            mStatusPostingErrorText->setVisible(true);
+            break;
         }
     }
 	LLFloater::draw();
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index cc47fb61e1..76f7d080cc 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -125,8 +125,10 @@ public:
 private:
 	LLSocialPhotoPanel* mSocialPhotoPanel;
     LLTextBox* mStatusErrorText;
+    LLTextBox* mStatusPostingErrorText;
     LLTextBox* mStatusLoadingText;
-    LLUICtrl* mStatusLoadingIndicator;
+    LLTextBox* mStatusPostingText;
+    LLUICtrl*  mStatusLoadingIndicator;
 };
 
 #endif // LL_LLFLOATERSOCIAL_H
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 40800c87e6..52840c5435 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -65,9 +65,24 @@
      wrap="true"
      halign="left"
      valign="center"
-     text_color="Yellow"
+     text_color="DrYellow"
      font="SansSerif">
-     Problem Connecting to Facebook 
+     Problem connecting to Facebook
+   </text>
+   <text
+     name="connection_error_posting_text"
+     type="string"
+     follows="left|top"
+     top="3"
+     left="12"
+     width="250"
+     height="20"
+     wrap="true"
+     halign="left"
+     valign="center"
+     text_color="DrYellow"
+     font="SansSerif">
+     Problem posting to Facebook
    </text>
    <loading_indicator
      follows="left|top"
@@ -88,8 +103,24 @@
      wrap="true"
      halign="left"
      valign="center"
+     text_color="EmphasisColor"
+     font="SansSerif">
+     Connecting to Facebook...
+   </text>
+   <text
+     name="connection_posting_text"
+     type="string"
+     follows="left|top"
+     top="3"
+     left="38"
+     width="250"
+     height="20"
+     wrap="true"
+     halign="left"
+     valign="center"
+     text_color="EmphasisColor"
      font="SansSerif">
-      Connecting to Facebook...
+     Posting...
    </text>
   </panel>
 </floater>
-- 
cgit v1.2.3


From 13d165290d62a6bd2d9a1b09c952458e64bbb710 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 9 Jul 2013 00:28:39 +0100
Subject: moved buttons to bottom of social floater above status text

---
 indra/newview/skins/default/xui/en/panel_social_photo.xml  | 4 ++--
 indra/newview/skins/default/xui/en/panel_social_place.xml  | 4 ++--
 indra/newview/skins/default/xui/en/panel_social_status.xml | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index d14e9ec82f..069e86c5f8 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -154,7 +154,7 @@
           height="96">
           <button
            follows="left|top"
-           top="15"
+           top="32"
            left="9"
            height="23"
            label="Post"
@@ -176,4 +176,4 @@
           </button>          
         </layout_panel>        
       </layout_stack>
-    </panel>
\ No newline at end of file
+    </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
index 03068dddc6..2c186fc52e 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -84,7 +84,7 @@
             height="96">
             <button
               follows="left|top"
-              top="5"
+              top="40"
               left="9"
               height="23"
               label="Post"
@@ -106,4 +106,4 @@
             </button>
         </layout_panel>
      </layout_stack>
-    </panel>
\ No newline at end of file
+    </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
index c9bdf3b645..c5059b679b 100644
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -42,7 +42,7 @@
        height="96">
        <button
         follows="left|top"
-        top="5"
+        top="213"
         left="9"
         height="23"
         label="Post"
-- 
cgit v1.2.3


From e6ac587f372559c4c84f8b1e4bc5ab94d9a665c3 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 8 Jul 2013 17:12:31 -0700
Subject: ACME-651 : Use localizable strings and simplify the xml for status
 and error fields

---
 indra/newview/llfloatersocial.cpp                  | 33 +++++++++++----------
 indra/newview/llfloatersocial.h                    |  2 --
 .../skins/default/xui/en/floater_social.xml        | 34 ++--------------------
 indra/newview/skins/default/xui/en/strings.xml     |  6 ++++
 4 files changed, 26 insertions(+), 49 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 1d47213a3a..b90cc004d3 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -40,6 +40,7 @@
 #include "llsdserialize.h"
 #include "llloadingindicator.h"
 #include "llslurl.h"
+#include "lltrans.h"
 #include "llsnapshotlivepreview.h"
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
@@ -591,9 +592,7 @@ void LLSocialCheckinPanel::clearAndClose()
 LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
     mSocialPhotoPanel(NULL),
     mStatusErrorText(NULL),
-    mStatusPostingErrorText(NULL),
     mStatusLoadingText(NULL),
-    mStatusPostingText(NULL),
     mStatusLoadingIndicator(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
@@ -610,9 +609,7 @@ BOOL LLFloaterSocial::postBuild()
 	mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
     // Connection status widgets
     mStatusErrorText = getChild<LLTextBox>("connection_error_text");
-    mStatusPostingErrorText = getChild<LLTextBox>("connection_error_posting_text");
     mStatusLoadingText = getChild<LLTextBox>("connection_loading_text");
-    mStatusPostingText = getChild<LLTextBox>("connection_posting_text");
     mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator");
 	return LLFloater::postBuild();
 }
@@ -651,42 +648,48 @@ void LLFloaterSocial::postUpdate()
 
 void LLFloaterSocial::draw()
 {
-    if (mStatusErrorText && mStatusPostingErrorText && mStatusLoadingText && mStatusPostingText && mStatusLoadingIndicator)
+    if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
     {
         mStatusErrorText->setVisible(false);
-        mStatusPostingErrorText->setVisible(false);
         mStatusLoadingText->setVisible(false);
-        mStatusPostingText->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
-            mStatusPostingText->setVisible(true);
+            mStatusLoadingText->setVisible(true);
+            status_text = LLTrans::getString("SocialFacebookPosting");
+            mStatusLoadingText->setValue(status_text);
             mStatusLoadingIndicator->setVisible(true);
-            break;
-        case LLFacebookConnect::FB_CONNECTED:
-            // When successfully connected, no message is displayed
 			break;
-        case LLFacebookConnect::FB_POSTED:
-            // No success message to show since we actually close the floater after successful posting completion
-            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
-            mStatusPostingErrorText->setVisible(true);
+            mStatusErrorText->setVisible(true);
+            status_text = LLTrans::getString("SocialFacebookErrorPosting");
+            mStatusErrorText->setValue(status_text);
             break;
         }
     }
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 76f7d080cc..0fc5ea520a 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -125,9 +125,7 @@ public:
 private:
 	LLSocialPhotoPanel* mSocialPhotoPanel;
     LLTextBox* mStatusErrorText;
-    LLTextBox* mStatusPostingErrorText;
     LLTextBox* mStatusLoadingText;
-    LLTextBox* mStatusPostingText;
     LLUICtrl*  mStatusLoadingIndicator;
 };
 
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 52840c5435..781c48729c 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -67,22 +67,7 @@
      valign="center"
      text_color="DrYellow"
      font="SansSerif">
-     Problem connecting to Facebook
-   </text>
-   <text
-     name="connection_error_posting_text"
-     type="string"
-     follows="left|top"
-     top="3"
-     left="12"
-     width="250"
-     height="20"
-     wrap="true"
-     halign="left"
-     valign="center"
-     text_color="DrYellow"
-     font="SansSerif">
-     Problem posting to Facebook
+     Error
    </text>
    <loading_indicator
      follows="left|top"
@@ -105,22 +90,7 @@
      valign="center"
      text_color="EmphasisColor"
      font="SansSerif">
-     Connecting to Facebook...
-   </text>
-   <text
-     name="connection_posting_text"
-     type="string"
-     follows="left|top"
-     top="3"
-     left="38"
-     width="250"
-     height="20"
-     wrap="true"
-     halign="left"
-     valign="center"
-     text_color="EmphasisColor"
-     font="SansSerif">
-     Posting...
+     Loading...
    </text>
   </panel>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 0f3f4619f6..5067922b88 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -148,6 +148,12 @@ 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>
 
+	<!-- Facebook Connect and, eventually, other Social Network -->
+	<string name="SocialFacebookConnecting">Connecting to Facebook...</string>
+	<string name="SocialFacebookPosting">Posting...</string>
+	<string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string>
+	<string name="SocialFacebookErrorPosting">Problem posting to Facebook</string>
+    
 	<!-- Tooltip -->
 	<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->
 	<string name="TooltipNoName">(no name)</string> <!-- No name on an object -->
-- 
cgit v1.2.3


From d869e706b8e664ff74e9ee9da4a43490d464a8b7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 8 Jul 2013 17:42:44 -0700
Subject: Revert some of Cho's changes in xml as it breaks the preview in the
 Photo panel

---
 indra/newview/skins/default/xui/en/floater_social.xml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 0a7014c876..2d6f8a9a73 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -20,7 +20,7 @@
    tab_height="30"
    tab_position="top"
    top="7"
-   height="430"
+   height="395"
    halign="center">
     <panel
      filename="panel_social_status.xml"
@@ -36,9 +36,6 @@
       filename="panel_social_photo.xml"
       class="llsocialphotopanel"
       follows="all"
-      background_visible="true"
-      bg_alpha_color="DkGray"
-      bg_opaque_color="DkGray"
       label="PHOTO"
       help_topic="panel_social_photo"
       name="panel_social_photo"/>
-- 
cgit v1.2.3


From be97e5188f1ce97f4409fe1bf425ebe970ca936f Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 10 Jul 2013 00:45:15 +0100
Subject: another revert

---
 indra/newview/skins/default/xui/en/floater_social.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 2d6f8a9a73..781c48729c 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -53,8 +53,7 @@
   <panel
    name="connection_status_panel"
    follows="left|top"
-   height="26"
-   top_pad="-30">
+   height="26">
    <text
      name="connection_error_text"
      type="string"
-- 
cgit v1.2.3


From 073a7f5096d271f51885601d01bb1494daa6ff4a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 9 Jul 2013 16:59:10 -0700
Subject: Layout tweaks of the social floater

---
 indra/newview/llfloatersocial.cpp                  |  4 +--
 .../skins/default/xui/en/floater_social.xml        | 19 +++++++------
 .../skins/default/xui/en/panel_social_photo.xml    | 31 +++++++++-------------
 .../skins/default/xui/en/panel_social_place.xml    | 12 ++++-----
 .../skins/default/xui/en/panel_social_status.xml   | 10 +++----
 5 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index b90cc004d3..d8eb7c5e59 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -199,7 +199,6 @@ void LLSocialPhotoPanel::draw()
 	if (previewp && previewp->getThumbnailImage())
 	{
 		const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
-		const LLRect& snapshot_rect = mSnapshotPanel->getRect();
 		const S32 thumbnail_w = previewp->getThumbnailWidth();
 		const S32 thumbnail_h = previewp->getThumbnailHeight();
 
@@ -208,7 +207,8 @@ void LLSocialPhotoPanel::draw()
 
 		// calc preview offset within the floater rect
 		S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
-		S32 offset_y = thumbnail_rect.mBottom - (snapshot_rect.mTop - thumbnail_rect.mTop);
+        // Hack : "15" is to compensate for "top=8" of "stack_photo" and "top=7" of "tabs"
+		S32 offset_y = thumbnail_rect.mBottom - 15;
 
 		mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType<LLFloater>());
 
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 2d6f8a9a73..fe89e8ed5b 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -11,7 +11,7 @@
   single_instance="true"
   reuse_instance="true"
   title="FACEBOOK"
-  height="437"
+  height="450"
   width="304">
   <tab_container
    name="tabs"
@@ -19,16 +19,16 @@
    tab_min_width="70"
    tab_height="30"
    tab_position="top"
+   background_visible="true"
+   bg_alpha_color="DkGray"
+   bg_opaque_color="DkGray"
    top="7"
-   height="395"
+   height="430"
    halign="center">
     <panel
      filename="panel_social_status.xml"
      class="llsocialstatuspanel"
      follows="all"
-     background_visible="true"
-     bg_alpha_color="DkGray"
-     bg_opaque_color="DkGray"
      label="STATUS"
      help_topic="panel_social_status"
      name="panel_social_status"/>
@@ -43,9 +43,6 @@
       filename="panel_social_place.xml"
       class="llsocialcheckinpanel"
       follows="all"
-      background_visible="true"
-      bg_alpha_color="DkGray"
-      bg_opaque_color="DkGray"
       label="PLACE"
       help_topic="panel_social_place"
       name="panel_social_place"/>
@@ -53,8 +50,10 @@
   <panel
    name="connection_status_panel"
    follows="left|top"
-   height="26"
-   top_pad="-30">
+   background_visible="true"
+   bg_alpha_color="DkGray"
+   bg_opaque_color="DkGray"
+   height="24">
    <text
      name="connection_error_text"
      type="string"
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index ddf2e5e613..4083fde61f 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -1,28 +1,20 @@
     <panel
-      height="395"
+      height="393"
       width="304"
       layout="topleft"
       name="panel_social_photo">
       <layout_stack
 	   layout="topleft"
        border_size="0"
-       height="395"
+       height="385"
        follows="top|left|right"
        orientation="vertical"
        name="stack_photo"
        top="8">
         <layout_panel	
-         name="photo_detail_panel"
-         height="295">
-          <panel
-            top="0"
-            follows="all"
-            height="295"
-            width="286"
-            left="7"
-            label="snapshot_panel"
-            help_topic="snapshot_panel"
-            name="snapshot_panel">
+         name="snapshot_panel"
+         top="0"
+         height="360">
             <combo_box
              control_name="SocialPhotoResolution"
              follows="left|top"
@@ -103,13 +95,13 @@
              height="16"
              left="9"
              name="caption_label"
-             top_pad="12"
+             top_pad="5"
              type="string">
               Comment (optional):
             </text>
             <text_editor
              follows="left|top"
-             height="47"
+             height="87"
              width="250"
              left="9"
              length="1"
@@ -123,15 +115,16 @@
              initial_value="true"
              label="Include location in posting"
              name="add_location_cb"
-             top_pad="19"/>            
-            </panel>
+              left="6"
+              height="16"
+             top_pad="5"/>
         </layout_panel>
         <layout_panel
           name="photo_button_panel"
-          height="96">
+          height="25">
           <button
            follows="left|top"
-           top="32"
+           top="0"
            left="9"
            height="23"
            label="Post"
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
index 2c186fc52e..856f94d88b 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -1,19 +1,19 @@
     <panel
-      height="395"
+      height="393"
       width="304"
 	  layout="topleft"
       name="panel_social_place">
       <layout_stack
 	    layout="topleft"
         border_size="0"
-        height="395"
+        height="385"
         follows="all"
         orientation="vertical"
         name="stack_place"
         top="8">
         <layout_panel
           name="place_detail_panel"
-          height="122">
+          height="127">
           <text
             length="1"
             follows="top|left|right"
@@ -39,7 +39,7 @@
           </layout_panel>
           <layout_panel
             name="place_map_panel"
-            height="133">
+            height="233">
               <loading_indicator
               follows="left|top"
               height="24"
@@ -81,10 +81,10 @@
           </layout_panel>
           <layout_panel
             name="place_button_panel"
-            height="96">
+            height="25">
             <button
               follows="left|top"
-              top="40"
+              top="0"
               left="9"
               height="23"
               label="Post"
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
index c5059b679b..b6f3f00cd4 100644
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -1,19 +1,19 @@
     <panel
-	 height="395"
+	 height="393"
 	 width="304"
 	 layout="topleft"
      name="panel_social_status">
      <layout_stack
       layout="topleft"
       border_size="0"
-      height="395"
+      height="385"
       follows="all"
       orientation="vertical"
       name="stack_status"
       top="8">
       <layout_panel
        name="status_detail_panel"
-       height="40">
+       height="360">
        <text
         length="1"
         follows="top|left|right"
@@ -39,10 +39,10 @@
       </layout_panel>
       <layout_panel
        name="status_button_panel"
-       height="96">
+       height="25">
        <button
         follows="left|top"
-        top="213"
+        top="0"
         left="9"
         height="23"
         label="Post"
-- 
cgit v1.2.3


From 655606220351e4ee98adbd2a7768388234f6350c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 9 Jul 2013 20:59:05 -0700
Subject: Fix background color in floater social

---
 .../skins/default/xui/en/floater_social.xml        | 166 +++++++++++----------
 1 file changed, 89 insertions(+), 77 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index fe89e8ed5b..c24e9a2194 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -11,86 +11,98 @@
   single_instance="true"
   reuse_instance="true"
   title="FACEBOOK"
-  height="450"
+  height="465"
   width="304">
-  <tab_container
-   name="tabs"
-   tab_group="1"
-   tab_min_width="70"
-   tab_height="30"
-   tab_position="top"
-   background_visible="true"
-   bg_alpha_color="DkGray"
-   bg_opaque_color="DkGray"
-   top="7"
-   height="430"
-   halign="center">
-    <panel
-     filename="panel_social_status.xml"
-     class="llsocialstatuspanel"
-     follows="all"
-     label="STATUS"
-     help_topic="panel_social_status"
-     name="panel_social_status"/>
-    <panel
-      filename="panel_social_photo.xml"
-      class="llsocialphotopanel"
-      follows="all"
-      label="PHOTO"
-      help_topic="panel_social_photo"
-      name="panel_social_photo"/>
-    <panel
-      filename="panel_social_place.xml"
-      class="llsocialcheckinpanel"
-      follows="all"
-      label="PLACE"
-      help_topic="panel_social_place"
-      name="panel_social_place"/>
-  </tab_container>
   <panel
-   name="connection_status_panel"
-   follows="left|top"
+   height="465"
+   width="304"
+   visible="true"
+   name="background"
    background_visible="true"
-   bg_alpha_color="DkGray"
    bg_opaque_color="DkGray"
-   height="24">
-   <text
-     name="connection_error_text"
-     type="string"
-     follows="left|top"
-     top="3"
-     left="12"
-     width="250"
-     height="20"
-     wrap="true"
-     halign="left"
-     valign="center"
-     text_color="DrYellow"
-     font="SansSerif">
-     Error
-   </text>
-   <loading_indicator
-     follows="left|top"
-     height="24"
-     width="24"
-     name="connection_loading_indicator"
-     top="0"
-     left="9"
-     visible="true"/>
-   <text
-     name="connection_loading_text"
-     type="string"
-     follows="left|top"
-     top="3"
-     left_pad="5"
-     width="250"
-     height="20"
-     wrap="true"
-     halign="left"
-     valign="center"
-     text_color="EmphasisColor"
-     font="SansSerif">
-     Loading...
-   </text>
+   bg_alpha_color="DkGray_66"
+   follows="all"
+   top="0"
+   left="0">
+   <tab_container
+     name="tabs"
+     tab_group="1"
+     tab_min_width="70"
+     tab_height="30"
+     tab_position="top"
+     background_visible="true"
+     bg_opaque_color="DkGray"
+     bg_alpha_color="DkGray_66"
+     top="7"
+     height="430"
+     halign="center">
+     <panel
+       filename="panel_social_status.xml"
+       class="llsocialstatuspanel"
+       follows="all"
+       label="STATUS"
+       help_topic="panel_social_status"
+       name="panel_social_status"/>
+     <panel
+       filename="panel_social_photo.xml"
+       class="llsocialphotopanel"
+       follows="all"
+       label="PHOTO"
+       help_topic="panel_social_photo"
+       name="panel_social_photo"/>
+     <panel
+       filename="panel_social_place.xml"
+       class="llsocialcheckinpanel"
+       follows="all"
+       label="PLACE"
+       help_topic="panel_social_place"
+       name="panel_social_place"/>
+    </tab_container>
+    <panel
+     name="connection_status_panel"
+     follows="left|bottom|right"
+     background_visible="true"
+     bg_opaque_color="DkGray"
+     bg_alpha_color="DkGray_66"
+     height="24">
+     <text
+      name="connection_error_text"
+      type="string"
+      follows="left|bottom|right"
+      top="3"
+      left="12"
+      width="250"
+      height="20"
+      wrap="true"
+      halign="left"
+      valign="center"
+      text_color="DrYellow"
+      font="SansSerif">
+      Error
+     </text>
+     <loading_indicator
+      follows="left|bottom|right"
+      height="24"
+      width="24"
+      name="connection_loading_indicator"
+      top="0"
+      left="9"
+      visible="true"/>
+     <text
+      name="connection_loading_text"
+      type="string"
+      follows="left|bottom|right"
+      top="3"
+      left_pad="5"
+      width="250"
+      height="20"
+      wrap="true"
+      halign="left"
+      valign="center"
+      text_color="EmphasisColor"
+      font="SansSerif">
+      Loading...
+    </text>
   </panel>
+ </panel>
 </floater>
-- 
cgit v1.2.3


From 722dc13dcc481900b3110fe54f840b2292ea3976 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 9 Jul 2013 21:17:27 -0700
Subject: Fix the sizing options of the photo panel

---
 indra/newview/skins/default/xui/en/panel_social_photo.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index 4083fde61f..b4d2e4246e 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -7,13 +7,12 @@
 	   layout="topleft"
        border_size="0"
        height="385"
-       follows="top|left|right"
+       follows="all"
        orientation="vertical"
        name="stack_photo"
        top="8">
         <layout_panel	
          name="snapshot_panel"
-         top="0"
          height="360">
             <combo_box
              control_name="SocialPhotoResolution"
-- 
cgit v1.2.3


From b22b47fde552d2b1951858b7a4707876744cf396 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 10 Jul 2013 19:26:42 -0700
Subject: ACME-671 : Disable social panel UX while transaction (Post or
 Connection) is ongoing

---
 indra/newview/llfacebookconnect.h                  |  1 +
 indra/newview/llfloatersocial.cpp                  | 45 ++++++++++++++++------
 indra/newview/llfloatersocial.h                    |  6 ++-
 .../skins/default/xui/en/panel_social_photo.xml    |  6 +--
 .../skins/default/xui/en/panel_social_place.xml    |  2 +-
 .../skins/default/xui/en/panel_social_status.xml   |  2 +-
 6 files changed, 44 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 7b6eb3644f..0f828cf43e 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -70,6 +70,7 @@ public:
     
     void setConnectionState(EConnectionState connection_state);
 	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
+	bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING)); }
     EConnectionState getConnectionState() { return mConnectionState; }
     S32  generation() { return mGeneration; }
     
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d8eb7c5e59..4c384efae1 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -71,7 +71,8 @@ std::string get_map_url()
 
 LLSocialStatusPanel::LLSocialStatusPanel() :
 	mMessageTextEditor(NULL),
-	mPostStatusButton(NULL)
+	mPostButton(NULL),
+    mCancelButton(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this));
 }
@@ -79,18 +80,22 @@ LLSocialStatusPanel::LLSocialStatusPanel() :
 BOOL LLSocialStatusPanel::postBuild()
 {
 	mMessageTextEditor = getChild<LLUICtrl>("status_message");
-	mPostStatusButton = getChild<LLUICtrl>("post_status_btn");
+	mPostButton = getChild<LLUICtrl>("post_status_btn");
+	mCancelButton = getChild<LLUICtrl>("cancel_status_btn");
 
 	return LLPanel::postBuild();
 }
 
 void LLSocialStatusPanel::draw()
 {
-	if (mMessageTextEditor && mPostStatusButton)
+    if (mMessageTextEditor && mPostButton && mCancelButton)
 	{
-		std::string message = mMessageTextEditor->getValue().asString();
-		mPostStatusButton->setEnabled(!message.empty());
-	}
+        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();
 }
@@ -184,9 +189,10 @@ BOOL LLSocialPhotoPanel::postBuild()
 	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
     mWorkingLabel = getChild<LLUICtrl>("working_lbl");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
-	mCaptionTextBox = getChild<LLUICtrl>("caption");
+	mCaptionTextBox = getChild<LLUICtrl>("photo_caption");
 	mLocationCheckbox = getChild<LLUICtrl>("add_location_cb");
-	mPostButton = getChild<LLUICtrl>("post_btn");
+	mPostButton = getChild<LLUICtrl>("post_photo_btn");
+	mCancelButton = getChild<LLUICtrl>("cancel_photo_btn");
 
 	return LLPanel::postBuild();
 }
@@ -195,6 +201,14 @@ void LLSocialPhotoPanel::draw()
 { 
 	LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
 
+    bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
+    mPostButton->setEnabled(no_ongoing_connection);
+    mCancelButton->setEnabled(no_ongoing_connection);
+    mCaptionTextBox->setEnabled(no_ongoing_connection);
+    mResolutionComboBox->setEnabled(no_ongoing_connection);
+    mRefreshBtn->setEnabled(no_ongoing_connection);
+    mLocationCheckbox->setEnabled(no_ongoing_connection);
+    
     // Display the preview if one is available
 	if (previewp && previewp->getThumbnailImage())
 	{
@@ -471,6 +485,8 @@ BOOL LLSocialCheckinPanel::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");
     mMapCheckBox = getChild<LLCheckBoxCtrl>("add_place_view_cb");
@@ -481,6 +497,11 @@ BOOL LLSocialCheckinPanel::postBuild()
 
 void LLSocialCheckinPanel::draw()
 {
+    bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
+    mPostButton->setEnabled(no_ongoing_connection);
+    mCancelButton->setEnabled(no_ongoing_connection);
+    mMessageTextEditor->setEnabled(no_ongoing_connection);
+
     std::string map_url = get_map_url();
     // Did we change location?
     if (map_url != mMapUrl)
@@ -509,7 +530,7 @@ void LLSocialCheckinPanel::draw()
         // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value
         mMapLoadingIndicator->setVisible(false);
         mMapPlaceholder->setVisible(true);
-        mMapCheckBox->setEnabled(true);
+        mMapCheckBox->setEnabled(no_ongoing_connection);
         mMapCheckBox->set(mMapCheckBoxValue);
     }
 
@@ -564,11 +585,11 @@ void LLSocialCheckinPanel::sendCheckin()
 	LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
     
 	// Optionally add the region map view
-	bool add_map_view = getChild<LLUICtrl>("add_place_view_cb")->getValue().asBoolean();
+	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 = getChild<LLUICtrl>("place_caption")->getValue().asString();
+	std::string caption = mMessageTextEditor->getValue().asString();
 
 	// Post to Facebook
 	LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
@@ -576,7 +597,7 @@ void LLSocialCheckinPanel::sendCheckin()
 
 void LLSocialCheckinPanel::clearAndClose()
 {
-	getChild<LLUICtrl>("place_caption")->setValue("");
+	mMessageTextEditor->setValue("");
 
 	LLFloater* floater = getParentByType<LLFloater>();
 	if (floater)
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 0fc5ea520a..f1deeb423d 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -49,7 +49,8 @@ public:
 
 private:
 	LLUICtrl* mMessageTextEditor;
-	LLUICtrl* mPostStatusButton;
+	LLUICtrl* mPostButton;
+	LLUICtrl* mCancelButton;
 };
 
 class LLSocialPhotoPanel : public LLPanel
@@ -86,6 +87,7 @@ private:
 	LLUICtrl * mCaptionTextBox;
 	LLUICtrl * mLocationCheckbox;
 	LLUICtrl * mPostButton;
+	LLUICtrl* mCancelButton;
 };
 
 class LLSocialCheckinPanel : public LLPanel
@@ -104,6 +106,8 @@ private:
     std::string mMapUrl;
     LLPointer<LLViewerFetchedTexture> mMapTexture;
 	LLUICtrl* mPostButton;
+	LLUICtrl* mCancelButton;
+	LLUICtrl* mMessageTextEditor;
     LLUICtrl* mMapLoadingIndicator;
     LLIconCtrl* mMapPlaceholder;
     LLCheckBoxCtrl* mMapCheckBox;
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index b4d2e4246e..ad901db748 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -105,7 +105,7 @@
              left="9"
              length="1"
              max_length="700"
-             name="caption"
+             name="photo_caption"
              type="string"
              word_wrap="true">
             </text_editor>
@@ -127,7 +127,7 @@
            left="9"
            height="23"
            label="Post"
-           name="post_btn"
+           name="post_photo_btn"
            width="100">
             <button.commit_callback
              function="SocialSharing.SendPhoto" />
@@ -136,7 +136,7 @@
                follows="left|top"
                height="23"
                label="Cancel"
-               name="cancel_btn"
+               name="cancel_photo_btn"
                left_pad="15"
                top_delta="0"
                width="100">
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
index 856f94d88b..c0fc9ada75 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -97,7 +97,7 @@
               follows="left|top"
               height="23"
               label="Cancel"
-              name="cancel_btn"
+              name="cancel_place_btn"
               left_pad="15"
               top_delta="0"
               width="100">
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
index b6f3f00cd4..975f8cd29c 100644
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -55,7 +55,7 @@
         follows="left|top"
         height="23"
         label="Cancel"
-        name="cancel_btn"
+        name="cancel_status_btn"
         left_pad="15"
         top_delta="0"
         width="100">
-- 
cgit v1.2.3


From 36db132f236d4a3606b42a2a6af1b31c47892706 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 12 Jul 2013 01:29:57 +0100
Subject: added state parameter to PUT /connection route for ACME-692

---
 indra/newview/llfacebookconnect.cpp | 6 ++++--
 indra/newview/llfacebookconnect.h   | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 30ebedca25..0d11658d07 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -75,7 +75,7 @@ public:
 			{
 				if (query_map.has("code"))
 				{
-                    LLFacebookConnect::instance().connectToFacebook(query_map["code"]);
+                    LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
 				}
 				return true;
 			}
@@ -286,11 +286,13 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 	return url;
 }
 
-void LLFacebookConnect::connectToFacebook(const std::string& auth_code)
+void LLFacebookConnect::connectToFacebook(const std::string& auth_code, const std::string& auth_state)
 {
 	LLSD body;
 	if (!auth_code.empty())
 		body["code"] = auth_code;
+	if (!auth_state.empty())
+		body["state"] = auth_state;
     
 	LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder());
 }
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 0f828cf43e..77b1896c6e 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -54,9 +54,9 @@ public:
 		FB_POST_FAILED = 6
 	};
 	
-	void connectToFacebook(const std::string& auth_code = "");	// 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 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 loadFacebookFriends();
 	void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
-- 
cgit v1.2.3


From 0530eac42c8cbb4f41131e8d7796006b47ba1fa5 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 12 Jul 2013 17:57:31 -0700
Subject: ACME-701 : Align all social panels UX, recenter the preview in the
 photo panel

---
 indra/newview/llfloatersocial.cpp                  | 17 +++---
 .../skins/default/xui/en/floater_social.xml        | 14 ++---
 .../skins/default/xui/en/panel_social_photo.xml    | 66 ++++++++++++----------
 .../skins/default/xui/en/panel_social_place.xml    | 34 +++++++----
 .../skins/default/xui/en/panel_social_status.xml   | 14 ++---
 5 files changed, 82 insertions(+), 63 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4c384efae1..c8c203fc25 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -168,6 +168,7 @@ mLocationCheckbox(NULL),
 mPostButton(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this));
+	mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
 }
 
 LLSocialPhotoPanel::~LLSocialPhotoPanel()
@@ -186,7 +187,6 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
 	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE));
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
-	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
     mWorkingLabel = getChild<LLUICtrl>("working_lbl");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
 	mCaptionTextBox = getChild<LLUICtrl>("photo_caption");
@@ -217,15 +217,18 @@ void LLSocialPhotoPanel::draw()
 		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_x = (thumbnail_rect.getWidth()  - thumbnail_w) / 2 ;
+		const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ;
 
 		// calc preview offset within the floater rect
-		S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
-        // Hack : "15" is to compensate for "top=8" of "stack_photo" and "top=7" of "tabs"
-		S32 offset_y = thumbnail_rect.mBottom - 15;
-
+        // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater.
+        // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity.
+        // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time.
+		S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1;
+		S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39;
+        
 		mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType<LLFloater>());
-
+        
 		gGL.matrixMode(LLRender::MM_MODELVIEW);
 		// Apply floater transparency to the texture unless the floater is focused.
 		F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index c24e9a2194..65f738de1f 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -11,10 +11,10 @@
   single_instance="true"
   reuse_instance="true"
   title="FACEBOOK"
-  height="465"
+  height="482"
   width="304">
   <panel
-   height="465"
+   height="482"
    width="304"
    visible="true"
    name="background"
@@ -34,7 +34,7 @@
      bg_opaque_color="DkGray"
      bg_alpha_color="DkGray_66"
      top="7"
-     height="430"
+     height="437"
      halign="center">
      <panel
        filename="panel_social_status.xml"
@@ -69,8 +69,8 @@
       name="connection_error_text"
       type="string"
       follows="left|bottom|right"
-      top="3"
-      left="12"
+      top="5"
+      left="9"
       width="250"
       height="20"
       wrap="true"
@@ -85,14 +85,14 @@
       height="24"
       width="24"
       name="connection_loading_indicator"
-      top="0"
+      top="2"
       left="9"
       visible="true"/>
      <text
       name="connection_loading_text"
       type="string"
       follows="left|bottom|right"
-      top="3"
+      top="5"
       left_pad="5"
       width="250"
       height="20"
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml
index ad901db748..a55613b52a 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -1,19 +1,19 @@
     <panel
-      height="393"
+      height="400"
       width="304"
       layout="topleft"
       name="panel_social_photo">
       <layout_stack
 	   layout="topleft"
        border_size="0"
-       height="385"
+       height="392"
        follows="all"
        orientation="vertical"
        name="stack_photo"
        top="8">
         <layout_panel	
          name="snapshot_panel"
-         height="360">
+         height="367">
             <combo_box
              control_name="SocialPhotoResolution"
              follows="left|top"
@@ -61,32 +61,36 @@
                 top="33"
                 follows="left|top"
                 left="9">
-              <text
-               follows="left|top|right"
-               font="SansSerifBold"
-               height="14"
-               left="5"
-               length="1"
-               halign="center"
-               name="working_lbl"
-               right="-5"
-               top="98"
-               translate="false"
-               type="string"
-               visible="false">
-                Refreshing...
-              </text>
-              <button
-               follows="left|top"
-               height="22"
-               image_overlay="Refresh_Off"
-               left="20"
-               name="new_snapshot_btn"
-               tool_tip="Click to refresh"
-               bottom="-10"
-               visible="false"
-               width="22" />
             </panel>
+            <button
+             follows="left|top"
+             height="23"
+             label="Refresh"
+             left="9"
+             top_pad="5"
+             name="new_snapshot_btn"
+             tool_tip="Click to refresh"
+             visible="true"
+             width="100" >
+             <button.commit_callback
+               function="SocialSharing.RefreshPhoto" />
+            </button>
+            <text
+                follows="left|top"
+                font="SansSerif"
+                text_color="EmphasisColor"
+                height="14"
+                top_pad="-19"
+                left_pad="-20"
+                length="1"
+                halign="center"
+                name="working_lbl"
+                translate="false"
+                type="string"
+                visible="true"
+                width="150">
+                Refreshing...
+            </text>
             <text
              length="1"
              follows="top|left|right"
@@ -94,7 +98,7 @@
              height="16"
              left="9"
              name="caption_label"
-             top_pad="5"
+             top_pad="20"
              type="string">
               Comment (optional):
             </text>
@@ -114,9 +118,9 @@
              initial_value="true"
              label="Include location in posting"
              name="add_location_cb"
-              left="6"
+              left="9"
               height="16"
-             top_pad="5"/>
+             top_pad="8"/>
         </layout_panel>
         <layout_panel
           name="photo_button_panel"
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
index c0fc9ada75..b53a41487a 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -1,19 +1,19 @@
     <panel
-      height="393"
+      height="400"
       width="304"
 	  layout="topleft"
       name="panel_social_place">
       <layout_stack
 	    layout="topleft"
         border_size="0"
-        height="385"
+        height="392"
         follows="all"
         orientation="vertical"
         name="stack_place"
         top="8">
         <layout_panel
           name="place_detail_panel"
-          height="127">
+          height="181">
           <text
             length="1"
             follows="top|left|right"
@@ -21,14 +21,14 @@
             height="16"
             left="9"
             name="place_caption_label"
-            top="1"
+            top="13"
             type="string">
             Say something about where you are:
           </text>
           <text_editor
-            follows="top|left|right"
-            height="80"
-            right="-9"
+            follows="top|left"
+            height="150"
+            width="250"
             left="9"
             length="1"
             max_length="700"
@@ -39,13 +39,25 @@
           </layout_panel>
           <layout_panel
             name="place_map_panel"
-            height="233">
+            height="186">
+              <panel
+                  follows="left|top"
+                  height="128"
+                  width="128"
+                  background_visible="true"
+                  bg_opaque_color="Black"
+                  bg_alpha_color="Black"
+                  top="20"
+                  left="9"
+                  visible="true"
+                  name="map_border">
+              </panel>
               <loading_indicator
               follows="left|top"
               height="24"
               width="24"
               name="map_loading_indicator"
-              top="57"
+              top="77"
               left="61"
               visible="true"/>
               <icon
@@ -54,9 +66,9 @@
                 width="128"
                 image_name="Map_Placeholder_Icon"
                 layout="topleft"
-                top="5"
+                top="20"
                 left="9"
-                visible="false"
+                visible="true"
                 name="map_placeholder">
               </icon>
             <check_box
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
index 975f8cd29c..54cfa3f524 100644
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_status.xml
@@ -1,19 +1,19 @@
     <panel
-	 height="393"
+	 height="400"
 	 width="304"
 	 layout="topleft"
      name="panel_social_status">
      <layout_stack
       layout="topleft"
       border_size="0"
-      height="385"
+      height="392"
       follows="all"
       orientation="vertical"
       name="stack_status"
       top="8">
       <layout_panel
        name="status_detail_panel"
-       height="360">
+       height="367">
        <text
         length="1"
         follows="top|left|right"
@@ -21,14 +21,14 @@
         height="16"
         left="9"
         name="status_caption_label"
-        top="1"
+        top="13"
         type="string">
         What's on your mind?
        </text>
        <text_editor
-        follows="left|top|right"
-        height="80"
-        right="-9"
+        follows="left|top"
+        height="150"
+        width="250"
         left="9"
         length="1"
         max_length="700"
-- 
cgit v1.2.3


From cc18896faf3944a4725fe4c705db5e8c0370f8c2 Mon Sep 17 00:00:00 2001
From: Cinders <cinder.roxley@phoenixviewer.com>
Date: Mon, 15 Jul 2013 14:24:29 -0600
Subject: STORM-1951: Only toast when we should, honor show_toast notification
 param

---
 indra/newview/llnotificationscripthandler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index 08c98e4f28..56ed1044e9 100755
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -87,7 +87,7 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
 	{
 		LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
 	}
-	else
+	else if (notification->canShowToast())
 	{
 		LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification);
 
-- 
cgit v1.2.3


From e12b6caaa0596eae2fad43636663dd4e14a1949c Mon Sep 17 00:00:00 2001
From: Cinders <cinder.roxley@phoenixviewer.com>
Date: Mon, 15 Jul 2013 14:24:59 -0600
Subject: Remove trivial duplicate ; at the end of a line

---
 indra/newview/llviewermessage.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ace16396db..a71ccce89b 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6895,7 +6895,7 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response)
 				std::string target_name;
 				gCacheName->getFullName(target_id, target_name);  // for im log filenames
 				LLSD args;
-				args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
+				args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();
 	
 				LLSD payload;
 				
-- 
cgit v1.2.3


From 61e5164a41faf5d56919377ea00a6166b772a5a1 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 15 Jul 2013 16:06:34 -0700
Subject: ACME-680 Create the Account tab

---
 indra/newview/skins/default/xui/en/floater_social.xml       |  6 ++++++
 indra/newview/skins/default/xui/en/panel_social_account.xml | 10 ++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/panel_social_account.xml

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 65f738de1f..7f52a8c0da 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -57,6 +57,12 @@
        label="PLACE"
        help_topic="panel_social_place"
        name="panel_social_place"/>
+     <panel
+       filename="panel_social_account.xml"
+       follows="all"
+       label="ACCOUNT"
+       help_topic="panel_social_account"
+       name="panel_social_account"/>     
     </tab_container>
     <panel
      name="connection_status_panel"
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
new file mode 100644
index 0000000000..d1f188fbc8
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -0,0 +1,10 @@
+<panel
+	 height="400"
+	 width="304"
+	 layout="topleft"
+   name="panel_social_account">
+
+  
+
+
+</panel>
\ No newline at end of file
-- 
cgit v1.2.3


From 9988e4739f2af029732c66d0bc5f03e6f43c5685 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 15 Jul 2013 17:16:09 -0700
Subject: ACME-725 Add the connected text, 'Connect...' button, 'User another
 account...' button and 'Disconnect' button

---
 .../skins/default/xui/en/panel_social_account.xml  | 61 +++++++++++++++++++++-
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index d1f188fbc8..639e601f9d 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -4,7 +4,64 @@
 	 layout="topleft"
    name="panel_social_account">
 
-  
+  <text
+   layout="topleft"
+   length="1"
+   follows="top|left"
+   font="SansSerif"
+   height="16"
+   left="9"
+   name="account_caption_label"
+   top="21"
+   type="string">
+    You are connected to Facebook as:
+  </text>
+  <text
+   layout="topleft"
+   top_pad="2"
+   length="1"
+   follows="top|left"
+   font="SansSerif"
+   height="16"
+   left="9"
+   name="account_name_label"
+   type="string">
+    [secondlife:/// Philippe Bossut]
+  </text>
+  <button
+   layout="topleft"
+   follows="left|top"
+   top_pad="9"
+   left="9"
+   visible="false"
+   height="0"
+   label="Connect..."
+   name="connect_btn"
+   width="210">
 
+  </button>
 
-</panel>
\ No newline at end of file
+  <button
+   layout="topleft"
+   follows="left|top"
+   top_pad="9"
+   left="9"
+   height="23"
+   label="Use another account..."
+   name="use_another_account_btn"
+   width="210">
+    
+  </button>
+
+  <button
+   layout="topleft"
+   follows="left|top"
+   top_pad="11"
+   left="9"
+   height="23"
+   label="Disconnect"
+   name="disconnect_btn"
+   width="210">
+
+  </button>
+</panel>
-- 
cgit v1.2.3


From fdea8c66de408a2054bbe86b1967cea11409c313 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 16 Jul 2013 22:15:14 +0100
Subject: switched FB auth to in-viewer browser for ACME-733

---
 indra/newview/llfacebookconnect.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 0d11658d07..cf77dd365b 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -40,6 +40,9 @@
 #include "lltrans.h"
 #include "llevents.h"
 
+#include "llfloaterwebcontent.h"
+#include "llfloaterreg.h"
+
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState"));
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent"));
 
@@ -274,7 +277,12 @@ LLFacebookConnect::LLFacebookConnect()
 
 void LLFacebookConnect::openFacebookWeb(std::string url)
 {
-	LLUrlAction::openURLExternal(url);
+	// Open the URL in an internal browser window without navigation UI
+	LLFloaterWebContent::Params p;
+	p.url(url).show_chrome(false);
+	LLFloaterReg::showInstance("web_content", p);
+
+	//LLUrlAction::openURLExternal(url);
 }
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
-- 
cgit v1.2.3


From 3d6a98d845c871377a52fc924ce06329db34a776 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 17 Jul 2013 02:59:40 +0100
Subject: created floater_fbc_web for ACME-734 and ACME-735

---
 indra/newview/llfacebookconnect.cpp                    | 12 ++++++++++--
 indra/newview/llviewerfloaterreg.cpp                   |  2 +-
 indra/newview/skins/default/xui/en/floater_fbc_web.xml |  9 +++++++++
 3 files changed, 20 insertions(+), 3 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/floater_fbc_web.xml

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index cf77dd365b..ac92fc6ed5 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -52,7 +52,7 @@ void log_facebook_connect_error(const std::string& request, U32 status, const st
     // 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;
+		LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL;
     }
 }
 
@@ -76,10 +76,18 @@ public:
 		{
 			if (tokens[0].asString() == "connect")
 			{
+				// connect to facebook
 				if (query_map.has("code"))
 				{
                     LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
 				}
+
+				// this command probably came from the fbc_web browser, so close it
+				LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web");
+				if (fbc_web)
+				{
+					fbc_web->closeFloater();
+				}
 				return true;
 			}
 		}
@@ -280,7 +288,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 	// Open the URL in an internal browser window without navigation UI
 	LLFloaterWebContent::Params p;
 	p.url(url).show_chrome(false);
-	LLFloaterReg::showInstance("web_content", p);
+	LLFloaterReg::showInstance("fbc_web", p);
 
 	//LLUrlAction::openURLExternal(url);
 }
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 69bda2c11c..4ce049df03 100755
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -313,7 +313,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
 	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);
 	
 	LLFloaterUIPreviewUtil::registerFloater();
 	LLFloaterReg::add("upload_anim_bvh", "floater_animation_bvh_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBvhPreview>, "upload");
diff --git a/indra/newview/skins/default/xui/en/floater_fbc_web.xml b/indra/newview/skins/default/xui/en/floater_fbc_web.xml
new file mode 100644
index 0000000000..0d35e22a19
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_fbc_web.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater name="floater_fbc_web"
+         help_topic="fbc_web"
+         width="780"
+         height="775"
+         save_rect="true"
+         single_instance="true"
+         reuse_instance="false"
+         filename="floater_web_content.xml"/>
-- 
cgit v1.2.3


From 095c53fa060b3d336b408e8b87f30518c8db36cd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 17 Jul 2013 17:50:54 -0700
Subject: ACME-731 Create the llsocialaccountpanel class to handle
 input/feedback.

---
 indra/newview/llfloatersocial.cpp                  | 77 ++++++++++++++++++++++
 indra/newview/llfloatersocial.h                    | 23 +++++++
 .../skins/default/xui/en/floater_social.xml        |  1 +
 .../skins/default/xui/en/panel_social_account.xml  | 20 +++---
 4 files changed, 113 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index c8c203fc25..66624f6355 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -48,6 +48,7 @@
 static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel");
 static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
 static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
+static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsocialaccountpanel");
 
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg";
@@ -609,6 +610,82 @@ void LLSocialCheckinPanel::clearAndClose()
 	}
 }
 
+///////////////////////////
+//LLSocialAccountPanel//////
+///////////////////////////
+
+LLSocialAccountPanel::LLSocialAccountPanel() : 
+mAccountCaptionLabel(NULL),
+mAccountNameLabel(NULL),
+mPanelButtons(NULL),
+mConnectButton(NULL),
+mUseAnotherAccountButton(NULL),
+mDisconnectButton(NULL)
+{
+	mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this));
+	mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this));
+	mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this));
+}
+
+BOOL LLSocialAccountPanel::postBuild()
+{
+	mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
+	mAccountNameLabel = getChild<LLTextBox>("account_name_label");
+	mPanelButtons = getChild<LLUICtrl>("panel_buttons");
+	mConnectButton = getChild<LLUICtrl>("connect_btn");
+	mUseAnotherAccountButton = getChild<LLUICtrl>("use_another_account_btn");
+	mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
+
+	hideConnectButton();
+
+	return LLPanel::postBuild();
+}
+
+void LLSocialAccountPanel::showConnectButton()
+{
+	if(!mConnectButton->getVisible())
+	{
+		mConnectButton->setVisible(TRUE);
+		LLRect mLayoutStackRect = mPanelButtons->getRect();
+		F32 deltaTopPadding =  mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop;
+		mLayoutStackRect.translate(0, -(mConnectButton->getRect().getHeight() + deltaTopPadding));
+		mPanelButtons->setRect(mLayoutStackRect);
+
+		mUseAnotherAccountButton->setVisible(FALSE);
+		mDisconnectButton->setVisible(FALSE);
+	}
+}
+
+void LLSocialAccountPanel::hideConnectButton()
+{
+	if(mConnectButton->getVisible())
+	{
+		mConnectButton->setVisible(FALSE);
+		LLRect mLayoutStackRect = mPanelButtons->getRect();
+		F32 deltaTopPadding =  mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop;
+		mLayoutStackRect.translate(0, mConnectButton->getRect().getHeight() + deltaTopPadding);
+		mPanelButtons->setRect(mLayoutStackRect);
+
+		mUseAnotherAccountButton->setVisible(TRUE);
+		mDisconnectButton->setVisible(TRUE);
+	}
+}
+
+void LLSocialAccountPanel::onConnect()
+{
+	hideConnectButton();
+}
+
+void LLSocialAccountPanel::onUseAnotherAccount()
+{
+
+}
+
+void LLSocialAccountPanel::onDisconnect()
+{
+	showConnectButton();
+}
+
 ////////////////////////
 //LLFloaterSocial///////
 ////////////////////////
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index f1deeb423d..cdd8a71b79 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -115,6 +115,29 @@ private:
     bool mMapCheckBoxValue;
 };
 
+class LLSocialAccountPanel : public LLPanel
+{
+public:
+	LLSocialAccountPanel();
+	BOOL postBuild();
+
+private:
+	void onConnect();
+	void onUseAnotherAccount();
+	void onDisconnect();
+
+	void showConnectButton();
+	void hideConnectButton();
+
+	LLTextBox * mAccountCaptionLabel;
+	LLTextBox * mAccountNameLabel;
+	LLUICtrl * mPanelButtons;
+	LLUICtrl * mConnectButton;
+	LLUICtrl * mUseAnotherAccountButton;
+	LLUICtrl * mDisconnectButton;
+};
+
+
 class LLFloaterSocial : public LLFloater
 {
 public:
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 7f52a8c0da..eb209eb314 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -59,6 +59,7 @@
        name="panel_social_place"/>
      <panel
        filename="panel_social_account.xml"
+       class="llsocialaccountpanel"
        follows="all"
        label="ACCOUNT"
        help_topic="panel_social_account"
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 639e601f9d..838a9ba064 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -28,40 +28,44 @@
    type="string">
     [secondlife:/// Philippe Bossut]
   </text>
+
+  <panel
+    layout="topleft"
+    name="panel_buttons"
+    height="345"
+    left="9">
   <button
    layout="topleft"
    follows="left|top"
    top_pad="9"
-   left="9"
-   visible="false"
-   height="0"
+   visible="true"
+   height="23"
    label="Connect..."
    name="connect_btn"
    width="210">
-
+    <commit_callback function="SocialSharing.Connect"/>
   </button>
 
   <button
    layout="topleft"
    follows="left|top"
    top_pad="9"
-   left="9"
    height="23"
    label="Use another account..."
    name="use_another_account_btn"
    width="210">
-    
+    <commit_callback function="SocialSharing.UseAnotherAccount"/>
   </button>
 
   <button
    layout="topleft"
    follows="left|top"
    top_pad="11"
-   left="9"
    height="23"
    label="Disconnect"
    name="disconnect_btn"
    width="210">
-
+    <commit_callback function="SocialSharing.Disconnect"/>
   </button>
+  </panel>
 </panel>
-- 
cgit v1.2.3


From b2e2282e988ab8c7d989d8554a41fda8b8c6e691 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 18 Jul 2013 16:13:14 -0700
Subject: ACME-727 Display 'Not connected to Facebook' when the user does not
 have a FB token

---
 indra/newview/llfloatersocial.cpp                  | 60 ++++++++++++++++++++--
 indra/newview/llfloatersocial.h                    |  2 +
 .../skins/default/xui/en/panel_social_account.xml  | 15 ++++--
 3 files changed, 70 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 66624f6355..d64e4273f4 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -625,6 +625,8 @@ mDisconnectButton(NULL)
 	mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this));
 	mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this));
 	mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this));
+
+	setVisibleCallback(boost::bind(&LLSocialAccountPanel::onVisibilityChange, this, _2));
 }
 
 BOOL LLSocialAccountPanel::postBuild()
@@ -636,9 +638,61 @@ BOOL LLSocialAccountPanel::postBuild()
 	mUseAnotherAccountButton = getChild<LLUICtrl>("use_another_account_btn");
 	mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
 
+	return LLPanel::postBuild();
+}
+
+void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
+{
+	bool visible = new_visibility.asBoolean();
+
+	if(visible)
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
+		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1));
+
+		if(LLFacebookConnect::instance().isConnected())
+		{
 	hideConnectButton();
+			mAccountCaptionLabel->setText(getString("facebook_connected"));
+			mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
 
-	return LLPanel::postBuild();
+		}
+		else
+		{
+			mAccountCaptionLabel->setText(getString("facebook_disconnected"));
+			mAccountNameLabel->setText(std::string(""));
+			LLFacebookConnect::instance().checkConnectionToFacebook();
+		}
+	}
+	else
+	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
+	}
+}
+
+bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data)
+{
+
+	switch (data.get("enum").asInteger())
+	{
+		case LLFacebookConnect::FB_CONNECTED:
+		case LLFacebookConnect::FB_POSTING:
+		case LLFacebookConnect::FB_POSTED:
+		case LLFacebookConnect::FB_POST_FAILED:
+			mAccountCaptionLabel->setText(getString("facebook_connected"));
+			mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
+			hideConnectButton();
+			break;
+		case LLFacebookConnect::FB_NOT_CONNECTED:
+		case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
+		case LLFacebookConnect::FB_CONNECTION_FAILED:
+			mAccountCaptionLabel->setText(getString("facebook_disconnected"));
+			mAccountNameLabel->setText(std::string(""));
+			showConnectButton();
+			break;
+	}
+
+	return false;
 }
 
 void LLSocialAccountPanel::showConnectButton()
@@ -673,7 +727,7 @@ void LLSocialAccountPanel::hideConnectButton()
 
 void LLSocialAccountPanel::onConnect()
 {
-	hideConnectButton();
+	LLFacebookConnect::instance().checkConnectionToFacebook(true);
 }
 
 void LLSocialAccountPanel::onUseAnotherAccount()
@@ -683,7 +737,7 @@ void LLSocialAccountPanel::onUseAnotherAccount()
 
 void LLSocialAccountPanel::onDisconnect()
 {
-	showConnectButton();
+	LLFacebookConnect::instance().disconnectFromFacebook();
 }
 
 ////////////////////////
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index cdd8a71b79..48245e34ea 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -122,6 +122,8 @@ public:
 	BOOL postBuild();
 
 private:
+	void onVisibilityChange(const LLSD& new_visibility);
+	bool onFacebookConnectStateChange(const LLSD& data);
 	void onConnect();
 	void onUseAnotherAccount();
 	void onDisconnect();
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 838a9ba064..470e0848d2 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -3,7 +3,12 @@
 	 width="304"
 	 layout="topleft"
    name="panel_social_account">
-
+  <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"
@@ -14,7 +19,7 @@
    name="account_caption_label"
    top="21"
    type="string">
-    You are connected to Facebook as:
+    Not connected to Facebook.
   </text>
   <text
    layout="topleft"
@@ -53,7 +58,8 @@
    height="23"
    label="Use another account..."
    name="use_another_account_btn"
-   width="210">
+   width="210"
+   visible="false">
     <commit_callback function="SocialSharing.UseAnotherAccount"/>
   </button>
 
@@ -64,7 +70,8 @@
    height="23"
    label="Disconnect"
    name="disconnect_btn"
-   width="210">
+   width="210"
+   visible="false">
     <commit_callback function="SocialSharing.Disconnect"/>
   </button>
   </panel>
-- 
cgit v1.2.3


From 03563fcaa17c0af776c49baaa59421921603cddd Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 18 Jul 2013 16:23:11 -0700
Subject: ACME-728: When the 'Disconnect' button is clicked the fbc-service
 disconnect route should be called

---
 indra/newview/llfloatersocial.cpp | 30 ++++++++++++++++++------------
 indra/newview/llfloatersocial.h   |  2 ++
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d64e4273f4..e61d86c474 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -652,15 +652,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 
 		if(LLFacebookConnect::instance().isConnected())
 		{
-	hideConnectButton();
-			mAccountCaptionLabel->setText(getString("facebook_connected"));
-			mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
-
+			showConnectedLayout();
 		}
 		else
 		{
-			mAccountCaptionLabel->setText(getString("facebook_disconnected"));
-			mAccountNameLabel->setText(std::string(""));
+			showDisconnectedLayout();
 			LLFacebookConnect::instance().checkConnectionToFacebook();
 		}
 	}
@@ -679,16 +675,12 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data)
 		case LLFacebookConnect::FB_POSTING:
 		case LLFacebookConnect::FB_POSTED:
 		case LLFacebookConnect::FB_POST_FAILED:
-			mAccountCaptionLabel->setText(getString("facebook_connected"));
-			mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
-			hideConnectButton();
+			showConnectedLayout();
 			break;
 		case LLFacebookConnect::FB_NOT_CONNECTED:
 		case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
 		case LLFacebookConnect::FB_CONNECTION_FAILED:
-			mAccountCaptionLabel->setText(getString("facebook_disconnected"));
-			mAccountNameLabel->setText(std::string(""));
-			showConnectButton();
+			showDisconnectedLayout();
 			break;
 	}
 
@@ -725,6 +717,20 @@ void LLSocialAccountPanel::hideConnectButton()
 	}
 }
 
+void LLSocialAccountPanel::showDisconnectedLayout()
+{
+	mAccountCaptionLabel->setText(getString("facebook_disconnected"));
+	mAccountNameLabel->setText(std::string(""));
+	showConnectButton();
+}
+
+void LLSocialAccountPanel::showConnectedLayout()
+{
+	mAccountCaptionLabel->setText(getString("facebook_connected"));
+	mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
+	hideConnectButton();
+}
+
 void LLSocialAccountPanel::onConnect()
 {
 	LLFacebookConnect::instance().checkConnectionToFacebook(true);
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 48245e34ea..e49445a39f 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -130,6 +130,8 @@ private:
 
 	void showConnectButton();
 	void hideConnectButton();
+	void showDisconnectedLayout();
+	void showConnectedLayout();
 
 	LLTextBox * mAccountCaptionLabel;
 	LLTextBox * mAccountNameLabel;
-- 
cgit v1.2.3


From 16709a9bef3ebf24c60eac29f7c5cb743e855da1 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 18 Jul 2013 21:05:41 -0700
Subject: ACME-734 : WIP : Implemented changes for https URL in the address bar
 and added options to web floater to hide history and disable buttons

---
 indra/newview/llfacebookconnect.cpp                |  6 ++-
 indra/newview/llfloaterwebcontent.cpp              | 43 +++++++++++++++++-----
 indra/newview/llfloaterwebcontent.h                |  5 +++
 .../skins/default/xui/en/floater_web_content.xml   | 20 +++++++++-
 4 files changed, 61 insertions(+), 13 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index ac92fc6ed5..eb9b93161c 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -287,7 +287,11 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 {
 	// Open the URL in an internal browser window without navigation UI
 	LLFloaterWebContent::Params p;
-	p.url(url).show_chrome(false);
+    p.url(url).show_chrome(true);
+    p.url(url).allow_address_entry(false);
+    p.url(url).allow_back_forward_navigation(false);
+    p.url(url).save_url_history(false);
+    p.url(url).trusted_content(true);
 	LLFloaterReg::showInstance("fbc_web", p);
 
 	//LLUrlAction::openURLExternal(url);
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 3fe2518de6..92dbbb402d 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -46,7 +46,9 @@ LLFloaterWebContent::_Params::_Params()
 	id("id"),
 	window_class("window_class", "web_content"),
 	show_chrome("show_chrome", true),
-	allow_address_entry("allow_address_entry", true),
+    allow_address_entry("allow_address_entry", true),
+    allow_back_forward_navigation("allow_back_forward_navigation", true),
+    save_url_history("save_url_history", true),
 	preferred_media_size("preferred_media_size"),
 	trusted_content("trusted_content", false),
 	show_page_title("show_page_title", true)
@@ -58,6 +60,7 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mWebBrowser(NULL),
 	mAddressCombo(NULL),
 	mSecureLockIcon(NULL),
+    mSecurePrefix(NULL),
 	mStatusBarText(NULL),
 	mStatusBarProgress(NULL),
 	mBtnBack(NULL),
@@ -65,7 +68,9 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mBtnReload(NULL),
 	mBtnStop(NULL),
 	mUUID(params.id()),
-	mShowPageTitle(params.show_page_title)
+	mShowPageTitle(params.show_page_title),
+    mAllowNavigation(true),
+    mSaveURLHistory(true)
 {
 	mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
 	mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
@@ -97,7 +102,8 @@ BOOL LLFloaterWebContent::postBuild()
 
 	// cache image for secure browsing
 	mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag");
-
+	mSecurePrefix   = getChild< LLTextBox >( "secured_prefix" );
+    
 	// initialize the URL history using the system URL History manager
 	initializeURLHistory();
 
@@ -243,6 +249,8 @@ void LLFloaterWebContent::open_media(const Params& p)
 	getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome);
 	getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome);
 	bool address_entry_enabled = p.allow_address_entry && !p.trusted_content;
+    mAllowNavigation = p.allow_back_forward_navigation;
+    mSaveURLHistory = p.save_url_history;
 	getChildView("address")->setEnabled(address_entry_enabled);
 	getChildView("popexternal")->setEnabled(address_entry_enabled);
 
@@ -295,8 +303,8 @@ void LLFloaterWebContent::onClose(bool app_quitting)
 void LLFloaterWebContent::draw()
 {
 	// this is asynchronous so we need to keep checking
-	mBtnBack->setEnabled( mWebBrowser->canNavigateBack() );
-	mBtnForward->setEnabled( mWebBrowser->canNavigateForward() );
+	mBtnBack->setEnabled( mWebBrowser->canNavigateBack() && mAllowNavigation);
+	mBtnForward->setEnabled( mWebBrowser->canNavigateForward() && mAllowNavigation);
 
 	LLFloater::draw();
 }
@@ -344,16 +352,28 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		mStatusBarText->setText( end_str );
 
 		// decide if secure browsing icon should be displayed
-		std::string prefix =  std::string("https://");
+		std::string prefix = std::string("https://");
 		std::string test_prefix = mCurrentURL.substr(0, prefix.length());
 		LLStringUtil::toLower(test_prefix);
-		if(test_prefix == prefix)
+		if (test_prefix == prefix)
 		{
 			mSecureLockIcon->setVisible(true);
+            mSecurePrefix->setVisible(true);
+            // Hack : we suppress the "https" prefix and move the text a bit
+            // to make space for the lock icon and the green "https" text.
+            // However, so not to confuse the list management, we're not adding
+            // that hacked url to the history. The full url is already in there.
+            std::string url = mCurrentURL;
+            url.replace(0,5,"");
+            url = "               " + url;
+            mAddressCombo->remove( url );
+            mAddressCombo->add( url );
+            mAddressCombo->selectByValue( url );
 		}
 		else
 		{
 			mSecureLockIcon->setVisible(false);
+            mSecurePrefix->setVisible(false);
 		}
 	}
 	else if(event == MEDIA_EVENT_CLOSE_REQUEST)
@@ -399,9 +419,12 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
 {
 	mCurrentURL = url;
 
-	// serialize url history into the system URL History manager
-	LLURLHistory::removeURL("browser", mCurrentURL);
-	LLURLHistory::addURL("browser", mCurrentURL);
+    LLURLHistory::removeURL("browser", mCurrentURL);
+    if (mSaveURLHistory)
+    {
+        // serialize url history into the system URL History manager
+        LLURLHistory::addURL("browser", mCurrentURL);
+    }
 
 	mAddressCombo->remove( mCurrentURL );
 	mAddressCombo->add( mCurrentURL );
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index cfc87e9015..b416328e93 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -54,6 +54,8 @@ public:
 								id;
 		Optional<bool>			show_chrome,
 								allow_address_entry,
+                                allow_back_forward_navigation,
+                                save_url_history,
 								trusted_content,
 								show_page_title;
 		Optional<LLRect>		preferred_media_size;
@@ -97,6 +99,7 @@ protected:
 	LLMediaCtrl*	mWebBrowser;
 	LLComboBox*		mAddressCombo;
 	LLIconCtrl*		mSecureLockIcon;
+    LLTextBox*		mSecurePrefix;
 	LLTextBox*		mStatusBarText;
 	LLProgressBar*	mStatusBarProgress;
 
@@ -108,6 +111,8 @@ protected:
 	std::string		mCurrentURL;
 	std::string		mUUID;
 	bool			mShowPageTitle;
+    bool            mAllowNavigation;
+    bool            mSaveURLHistory;
 };
 
 #endif  // LL_LLFLOATERWEBCONTENT_H
diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml
index cea10adca8..a1563dc9ae 100755
--- a/indra/newview/skins/default/xui/en/floater_web_content.xml
+++ b/indra/newview/skins/default/xui/en/floater_web_content.xml
@@ -125,14 +125,30 @@
       <icon
         name="media_secure_lock_flag"
         height="16"
-        follows="top|right"
+        follows="top|left"
         image_name="Lock2"
         layout="topleft"
-        left_delta="620"
+        left_delta="2"
         top_delta="2"
         visible="false" 
         tool_tip="Secured Browsing"
         width="16" />
+      <text
+         type="string"
+         length="1"
+         follows="left|top"
+         font="SansSerif"
+         font.size="Small"
+         height="16"
+         layout="topleft"
+         left_delta="18"
+         name="secured_prefix"
+         top_delta="3"
+         text_color="EmphasisColor"
+         visible="false"
+         width="100">
+        https
+      </text>
       <button
         image_overlay="ExternalBrowser_Off"
 		    image_disabled="PushButton_Disabled"
-- 
cgit v1.2.3


From c3c61018cd2d6547c4976c04edc4d3212cf3fb31 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 19 Jul 2013 16:36:55 -0700
Subject: ACME-732 Create the viewer side info route responder

---
 indra/newview/llfacebookconnect.cpp                | 50 ++++++++++++++++++++++
 indra/newview/llfacebookconnect.h                  |  5 +++
 indra/newview/llfloatersocial.cpp                  | 24 ++++++++++-
 indra/newview/llfloatersocial.h                    |  1 +
 .../skins/default/xui/en/panel_social_account.xml  |  6 +--
 5 files changed, 81 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index ac92fc6ed5..51abbdf82f 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -44,6 +44,7 @@
 #include "llfloaterreg.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
@@ -244,6 +245,36 @@ private:
 	bool mAutoConnect;
 };
 
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookInfoResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookInfoResponder);
+public:
+
+	virtual void completed(U32 status, const std::string& reason, const LLSD& info)
+	{
+		if (isGoodStatus(status))
+		{
+			llinfos << "Facebook: Info received" << llendl;
+			LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. info: " << info << LL_ENDL;
+			LLFacebookConnect::instance().storeInfo(info);
+		}
+		else
+		{
+			log_facebook_connect_error("Info", status, reason, info.get("error_code"), info.get("error_description"));
+		}
+	}
+
+	void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (status == 302)
+		{
+			LLFacebookConnect::instance().openFacebookWeb(content["location"]);
+		}
+	}
+};
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 class LLFacebookFriendsResponder : public LLHTTPClient::Responder
@@ -329,6 +360,14 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
     }
 }
 
+void LLFacebookConnect::loadFacebookInfo()
+{
+	const bool follow_redirects = false;
+	const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+	LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(),
+		LLSD(), timeout, follow_redirects);
+}
+
 void LLFacebookConnect::loadFacebookFriends()
 {
 	const bool follow_redirects = false;
@@ -427,6 +466,17 @@ void LLFacebookConnect::updateStatus(const std::string& message)
 	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder());
 }
 
+void LLFacebookConnect::storeInfo(const LLSD& info)
+{
+	mInfo = info;
+	sInfoWatcher->post(info);
+}
+
+const LLSD& LLFacebookConnect::getInfo() const
+{
+	return mInfo;
+}
+
 void LLFacebookConnect::storeContent(const LLSD& content)
 {
     mGeneration++;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 77b1896c6e..1dbc35c27f 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -58,12 +58,15 @@ public:
 	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 clearContent();
 	void storeContent(const LLSD& content);
     const LLSD& getContent() const;
@@ -84,10 +87,12 @@ private:
  	std::string getFacebookConnectURL(const std::string& route = "");
    
     EConnectionState mConnectionState;
+	LLSD mInfo;
     LLSD mContent;
     S32  mGeneration;
 	
 	static boost::scoped_ptr<LLEventPump> sStateWatcher;
+	static boost::scoped_ptr<LLEventPump> sInfoWatcher;
 	static boost::scoped_ptr<LLEventPump> sContentWatcher;
 };
 
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index e61d86c474..d734518cbb 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -650,6 +650,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
 		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1));
 
+		LLFacebookConnect::instance().loadFacebookInfo();
+
+		LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel");
+		LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this));
+
 		if(LLFacebookConnect::instance().isConnected())
 		{
 			showConnectedLayout();
@@ -663,6 +668,7 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 	else
 	{
 		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
+		LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel");
 	}
 }
 
@@ -687,6 +693,21 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data)
 	return false;
 }
 
+bool LLSocialAccountPanel::onFacebookConnectInfoChange()
+{
+	LLSD info = LLFacebookConnect::instance().getInfo();
+	std::string clickable_name;
+
+	if(info.has("link") && info.has("name"))
+	{
+		clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
+	}
+
+	mAccountNameLabel->setText(clickable_name);
+
+	return false;
+}
+
 void LLSocialAccountPanel::showConnectButton()
 {
 	if(!mConnectButton->getVisible())
@@ -726,8 +747,9 @@ void LLSocialAccountPanel::showDisconnectedLayout()
 
 void LLSocialAccountPanel::showConnectedLayout()
 {
+	LLFacebookConnect::instance().loadFacebookInfo();
+
 	mAccountCaptionLabel->setText(getString("facebook_connected"));
-	mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
 	hideConnectButton();
 }
 
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index e49445a39f..f947207fbe 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -124,6 +124,7 @@ public:
 private:
 	void onVisibilityChange(const LLSD& new_visibility);
 	bool onFacebookConnectStateChange(const LLSD& data);
+	bool onFacebookConnectInfoChange();
 	void onConnect();
 	void onUseAnotherAccount();
 	void onDisconnect();
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 470e0848d2..8706aac5ce 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -30,10 +30,8 @@
    height="16"
    left="9"
    name="account_name_label"
-   type="string">
-    [secondlife:/// Philippe Bossut]
-  </text>
-
+   parse_urls="true"
+   type="string"/>
   <panel
     layout="topleft"
     name="panel_buttons"
-- 
cgit v1.2.3


From 652ec2feeeb39c5c7ec9553563e3fdc29c66780d Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 19 Jul 2013 17:47:58 -0700
Subject: ACME-734 : Suppress the green https experiment, prevent logging urls
 when skipping history, allow temporary url for display purposes

---
 indra/newview/llfloaterwebcontent.cpp              | 48 +++++++++++++---------
 indra/newview/llfloaterwebcontent.h                |  2 +-
 indra/newview/llmediactrl.cpp                      |  1 +
 indra/newview/llviewermedia.cpp                    | 23 +++++++++--
 indra/newview/llviewermedia.h                      |  2 +
 .../skins/default/xui/en/floater_web_content.xml   | 16 --------
 6 files changed, 53 insertions(+), 39 deletions(-)

diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 92dbbb402d..eb1717d384 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -60,7 +60,6 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mWebBrowser(NULL),
 	mAddressCombo(NULL),
 	mSecureLockIcon(NULL),
-    mSecurePrefix(NULL),
 	mStatusBarText(NULL),
 	mStatusBarProgress(NULL),
 	mBtnBack(NULL),
@@ -70,7 +69,8 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mUUID(params.id()),
 	mShowPageTitle(params.show_page_title),
     mAllowNavigation(true),
-    mSaveURLHistory(true)
+    mSaveURLHistory(true),
+    mDisplayURL("")
 {
 	mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
 	mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
@@ -102,7 +102,6 @@ BOOL LLFloaterWebContent::postBuild()
 
 	// cache image for secure browsing
 	mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag");
-	mSecurePrefix   = getChild< LLTextBox >( "secured_prefix" );
     
 	// initialize the URL history using the system URL History manager
 	initializeURLHistory();
@@ -242,8 +241,10 @@ void LLFloaterWebContent::open_media(const Params& p)
 	LLViewerMedia::proxyWindowOpened(p.target(), p.id());
 	mWebBrowser->setHomePageUrl(p.url, "text/html");
 	mWebBrowser->setTarget(p.target);
+    LLViewerMedia::setLogURL(p.save_url_history);   // Turn logging on/off as requested (flag default is true)
 	mWebBrowser->navigateTo(p.url, "text/html");
 	
+    mSecureLockIcon->setVisible(false);
 	set_current_url(p.url);
 
 	getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome);
@@ -319,6 +320,7 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		if ( url.length() )
 			mStatusBarText->setText( url );
 
+        mSecureLockIcon->setVisible(false);
 		set_current_url( url );
 	}
 	else if(event == MEDIA_EVENT_NAVIGATE_BEGIN)
@@ -358,23 +360,22 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		if (test_prefix == prefix)
 		{
 			mSecureLockIcon->setVisible(true);
-            mSecurePrefix->setVisible(true);
-            // Hack : we suppress the "https" prefix and move the text a bit
-            // to make space for the lock icon and the green "https" text.
-            // However, so not to confuse the list management, we're not adding
-            // that hacked url to the history. The full url is already in there.
-            std::string url = mCurrentURL;
-            url.replace(0,5,"");
-            url = "               " + url;
-            mAddressCombo->remove( url );
-            mAddressCombo->add( url );
-            mAddressCombo->selectByValue( url );
-		}
-		else
-		{
-			mSecureLockIcon->setVisible(false);
-            mSecurePrefix->setVisible(false);
+            if (!mDisplayURL.empty())
+            {
+                // Clear temporary entry if any
+                mAddressCombo->remove( mDisplayURL );
+                mDisplayURL = "";
+            }
+            // Hack : we move the text a bit to make space for the lock icon.
+            // That entry in the list will be deleted on the next add.
+            mDisplayURL = "      " + mCurrentURL;
+            mAddressCombo->add( mDisplayURL );
+            mAddressCombo->selectByValue( mDisplayURL );
 		}
+        else
+        {
+            mSecureLockIcon->setVisible(false);
+        }
 	}
 	else if(event == MEDIA_EVENT_CLOSE_REQUEST)
 	{
@@ -418,6 +419,7 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 void LLFloaterWebContent::set_current_url(const std::string& url)
 {
 	mCurrentURL = url;
+    LLStringUtil::trim(mCurrentURL);
 
     LLURLHistory::removeURL("browser", mCurrentURL);
     if (mSaveURLHistory)
@@ -426,6 +428,12 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
         LLURLHistory::addURL("browser", mCurrentURL);
     }
 
+    if (!mDisplayURL.empty())
+    {
+        // Clear temporary entry if any
+        mAddressCombo->remove( mDisplayURL );
+        mDisplayURL = "";
+    }
 	mAddressCombo->remove( mCurrentURL );
 	mAddressCombo->add( mCurrentURL );
 	mAddressCombo->selectByValue( mCurrentURL );
@@ -472,6 +480,7 @@ void LLFloaterWebContent::onEnterAddress()
 	// make sure there is at least something there.
 	// (perhaps this test should be for minimum length of a URL)
 	std::string url = mAddressCombo->getValue().asString();
+    LLStringUtil::trim(url);
 	if ( url.length() > 0 )
 	{
 		mWebBrowser->navigateTo( url, "text/html");
@@ -483,6 +492,7 @@ void LLFloaterWebContent::onPopExternal()
 	// make sure there is at least something there.
 	// (perhaps this test should be for minimum length of a URL)
 	std::string url = mAddressCombo->getValue().asString();
+    LLStringUtil::trim(url);
 	if ( url.length() > 0 )
 	{
 		LLWeb::loadURLExternal( url );
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index b416328e93..4d77537f5f 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -99,7 +99,6 @@ protected:
 	LLMediaCtrl*	mWebBrowser;
 	LLComboBox*		mAddressCombo;
 	LLIconCtrl*		mSecureLockIcon;
-    LLTextBox*		mSecurePrefix;
 	LLTextBox*		mStatusBarText;
 	LLProgressBar*	mStatusBarProgress;
 
@@ -109,6 +108,7 @@ protected:
 	LLView*			mBtnStop;
 
 	std::string		mCurrentURL;
+	std::string		mDisplayURL;
 	std::string		mUUID;
 	bool			mShowPageTitle;
     bool            mAllowNavigation;
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 2075aeed63..c06068b252 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -604,6 +604,7 @@ void LLMediaCtrl::setHomePageUrl( const std::string& urlIn, const std::string& m
 
 void LLMediaCtrl::setTarget(const std::string& target)
 {
+    LLViewerMedia::setLogURL(true);     // Always log, unless this is turned off at navigation time
 	mTarget = target;
 	if (mMediaSource)
 	{
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 2df028de69..8a88a36dda 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -361,6 +361,7 @@ static bool sAnyMediaShowing = false;
 static boost::signals2::connection sTeleportFinishConnection;
 static std::string sUpdatedCookies;
 static const char *PLUGIN_COOKIE_FILE_NAME = "plugin_cookies.txt";
+static bool sLogURL = true;
 
 //////////////////////////////////////////////////////////////////////////////////////////
 static void add_media_impl(LLViewerMediaImpl* media)
@@ -1622,6 +1623,13 @@ void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id)
 	sForceUpdate = true;
 }
 
+//////////////////////////////////////////////////////////////////////////////////////////
+// static
+void LLViewerMedia::setLogURL(bool do_log)
+{
+	sLogURL = do_log;
+}
+
 //////////////////////////////////////////////////////////////////////////////////////////
 // LLViewerMediaImpl
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -2000,7 +2008,10 @@ void LLViewerMediaImpl::loadURI()
 										"<>#%"
 										";/?:@&=",
 										false);
-		llinfos << "Asking media source to load URI: " << uri << llendl;
+        if (sLogURL)
+        {
+            llinfos << "Asking media source to load URI: " << uri << llendl;
+        }
 		
 		mMediaSource->loadURI( uri );
 		
@@ -2567,7 +2578,10 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
 	if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED)
 	{
 		// Helpful to have media urls in log file. Shouldn't be spammy.
-		llinfos << "NOT LOADING media id= " << mTextureId << " url=" << url << " mime_type=" << mime_type << llendl;
+        if (sLogURL)
+        {
+            llinfos << "NOT LOADING media id= " << mTextureId << " url=" << url << " mime_type=" << mime_type << llendl;
+        }
 
 		// This impl should not be loaded at this time.
 		LL_DEBUGS("PluginPriority") << this << "Not loading (PRIORITY_UNLOADED)" << LL_ENDL;
@@ -2582,7 +2596,10 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
 void LLViewerMediaImpl::navigateInternal()
 {
 	// Helpful to have media urls in log file. Shouldn't be spammy.
-	llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl;
+    if (sLogURL)
+    {
+        llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl;
+    }
 
 	if(mNavigateSuspended)
 	{
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index fff5b3fc08..75cd77e979 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -160,6 +160,8 @@ public:
 
 	static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id);
 
+    static void setLogURL(bool do_log);
+
 	static LLSD getHeaders();
 	
 private:
diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml
index a1563dc9ae..a80440e844 100755
--- a/indra/newview/skins/default/xui/en/floater_web_content.xml
+++ b/indra/newview/skins/default/xui/en/floater_web_content.xml
@@ -133,22 +133,6 @@
         visible="false" 
         tool_tip="Secured Browsing"
         width="16" />
-      <text
-         type="string"
-         length="1"
-         follows="left|top"
-         font="SansSerif"
-         font.size="Small"
-         height="16"
-         layout="topleft"
-         left_delta="18"
-         name="secured_prefix"
-         top_delta="3"
-         text_color="EmphasisColor"
-         visible="false"
-         width="100">
-        https
-      </text>
       <button
         image_overlay="ExternalBrowser_Off"
 		    image_disabled="PushButton_Disabled"
-- 
cgit v1.2.3


From 9b5104b3b5f608dbc9f06596885bdab9878f4065 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 19 Jul 2013 19:32:53 -0700
Subject: ACME-734 : Fix : Continue to log but just skip the query parts

---
 indra/newview/llfloaterwebcontent.cpp |  1 -
 indra/newview/llviewermedia.cpp       | 23 +++++++++--------------
 indra/newview/llviewermedia.h         |  2 --
 3 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index eb1717d384..7a65b8d28f 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -241,7 +241,6 @@ void LLFloaterWebContent::open_media(const Params& p)
 	LLViewerMedia::proxyWindowOpened(p.target(), p.id());
 	mWebBrowser->setHomePageUrl(p.url, "text/html");
 	mWebBrowser->setTarget(p.target);
-    LLViewerMedia::setLogURL(p.save_url_history);   // Turn logging on/off as requested (flag default is true)
 	mWebBrowser->navigateTo(p.url, "text/html");
 	
     mSecureLockIcon->setVisible(false);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 8a88a36dda..6453e2348f 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -361,7 +361,6 @@ static bool sAnyMediaShowing = false;
 static boost::signals2::connection sTeleportFinishConnection;
 static std::string sUpdatedCookies;
 static const char *PLUGIN_COOKIE_FILE_NAME = "plugin_cookies.txt";
-static bool sLogURL = true;
 
 //////////////////////////////////////////////////////////////////////////////////////////
 static void add_media_impl(LLViewerMediaImpl* media)
@@ -1623,13 +1622,6 @@ void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id)
 	sForceUpdate = true;
 }
 
-//////////////////////////////////////////////////////////////////////////////////////////
-// static
-void LLViewerMedia::setLogURL(bool do_log)
-{
-	sLogURL = do_log;
-}
-
 //////////////////////////////////////////////////////////////////////////////////////////
 // LLViewerMediaImpl
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -2008,9 +2000,10 @@ void LLViewerMediaImpl::loadURI()
 										"<>#%"
 										";/?:@&=",
 										false);
-        if (sLogURL)
         {
-            llinfos << "Asking media source to load URI: " << uri << llendl;
+            // Do not log the query parts
+            LLURI u(uri);
+            llinfos << "Asking media source to load URI: " << u.scheme() << "://" << u.authority() << u.path() << llendl;
         }
 		
 		mMediaSource->loadURI( uri );
@@ -2578,9 +2571,10 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
 	if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED)
 	{
 		// Helpful to have media urls in log file. Shouldn't be spammy.
-        if (sLogURL)
         {
-            llinfos << "NOT LOADING media id= " << mTextureId << " url=" << url << " mime_type=" << mime_type << llendl;
+            // Do not log the query parts
+            LLURI u(url);
+            llinfos << "NOT LOADING media id= " << mTextureId << " url=" << u.scheme() << "://" << u.authority() << u.path() << " mime_type=" << mime_type << llendl;
         }
 
 		// This impl should not be loaded at this time.
@@ -2596,9 +2590,10 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
 void LLViewerMediaImpl::navigateInternal()
 {
 	// Helpful to have media urls in log file. Shouldn't be spammy.
-    if (sLogURL)
     {
-        llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl;
+        // Do not log the query parts
+        LLURI u(mMediaURL);
+        llinfos << "media id= " << mTextureId << " url=" << u.scheme() << "://" << u.authority() << u.path() << " mime_type=" << mMimeType << llendl;
     }
 
 	if(mNavigateSuspended)
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 75cd77e979..fff5b3fc08 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -160,8 +160,6 @@ public:
 
 	static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id);
 
-    static void setLogURL(bool do_log);
-
 	static LLSD getHeaders();
 	
 private:
-- 
cgit v1.2.3


From 39a2f52b026ee20daf9f55bb40273e573cecfa30 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 19 Jul 2013 19:33:48 -0700
Subject: ACME-734 : Fix forgotten useless call

---
 indra/newview/llmediactrl.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index c06068b252..2075aeed63 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -604,7 +604,6 @@ void LLMediaCtrl::setHomePageUrl( const std::string& urlIn, const std::string& m
 
 void LLMediaCtrl::setTarget(const std::string& target)
 {
-    LLViewerMedia::setLogURL(true);     // Always log, unless this is turned off at navigation time
 	mTarget = target;
 	if (mMediaSource)
 	{
-- 
cgit v1.2.3


From eadb42eb9d202c38ca2761be07ee4376863550ce Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 19 Jul 2013 22:35:45 -0700
Subject: ACME-734 : Fix : Feed browsing history but without the query part

---
 indra/newview/llfacebookconnect.cpp   |  1 -
 indra/newview/llfloaterwebcontent.cpp | 10 ++--------
 indra/newview/llfloaterwebcontent.h   |  2 --
 indra/newview/llurlhistory.cpp        | 23 +++++++++++++++--------
 4 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index f0b735c5ca..7c1e7b3b16 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -321,7 +321,6 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
     p.url(url).show_chrome(true);
     p.url(url).allow_address_entry(false);
     p.url(url).allow_back_forward_navigation(false);
-    p.url(url).save_url_history(false);
     p.url(url).trusted_content(true);
 	LLFloaterReg::showInstance("fbc_web", p);
 
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 7a65b8d28f..5e8bb7ad57 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -48,7 +48,6 @@ LLFloaterWebContent::_Params::_Params()
 	show_chrome("show_chrome", true),
     allow_address_entry("allow_address_entry", true),
     allow_back_forward_navigation("allow_back_forward_navigation", true),
-    save_url_history("save_url_history", true),
 	preferred_media_size("preferred_media_size"),
 	trusted_content("trusted_content", false),
 	show_page_title("show_page_title", true)
@@ -69,7 +68,6 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mUUID(params.id()),
 	mShowPageTitle(params.show_page_title),
     mAllowNavigation(true),
-    mSaveURLHistory(true),
     mDisplayURL("")
 {
 	mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
@@ -250,7 +248,6 @@ void LLFloaterWebContent::open_media(const Params& p)
 	getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome);
 	bool address_entry_enabled = p.allow_address_entry && !p.trusted_content;
     mAllowNavigation = p.allow_back_forward_navigation;
-    mSaveURLHistory = p.save_url_history;
 	getChildView("address")->setEnabled(address_entry_enabled);
 	getChildView("popexternal")->setEnabled(address_entry_enabled);
 
@@ -421,11 +418,8 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
     LLStringUtil::trim(mCurrentURL);
 
     LLURLHistory::removeURL("browser", mCurrentURL);
-    if (mSaveURLHistory)
-    {
-        // serialize url history into the system URL History manager
-        LLURLHistory::addURL("browser", mCurrentURL);
-    }
+    // serialize url history into the system URL History manager
+    LLURLHistory::addURL("browser", mCurrentURL);
 
     if (!mDisplayURL.empty())
     {
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index 4d77537f5f..9d6d28bce0 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -55,7 +55,6 @@ public:
 		Optional<bool>			show_chrome,
 								allow_address_entry,
                                 allow_back_forward_navigation,
-                                save_url_history,
 								trusted_content,
 								show_page_title;
 		Optional<LLRect>		preferred_media_size;
@@ -112,7 +111,6 @@ protected:
 	std::string		mUUID;
 	bool			mShowPageTitle;
     bool            mAllowNavigation;
-    bool            mSaveURLHistory;
 };
 
 #endif  // LL_LLFLOATERWEBCONTENT_H
diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp
index dd17068be5..a80b9da13c 100755
--- a/indra/newview/llurlhistory.cpp
+++ b/indra/newview/llurlhistory.cpp
@@ -103,22 +103,29 @@ LLSD LLURLHistory::getURLHistory(const std::string& collection)
 // static
 void LLURLHistory::addURL(const std::string& collection, const std::string& url)
 {
-	if(! url.empty())
+	if(!url.empty())
 	{
-		sHistorySD[collection].insert(0, url);
+        LLURI u(url);
+        std::string simplified_url = u.scheme() + "://" + u.authority() + u.path();
+		sHistorySD[collection].insert(0, simplified_url);
 		LLURLHistory::limitSize(collection);
 	}
 }
 // static
 void LLURLHistory::removeURL(const std::string& collection, const std::string& url)
 {
-	for(int index = 0; index < sHistorySD[collection].size(); index++)
+	if(!url.empty())
 	{
-		if(sHistorySD[collection].get(index).asString() == url)
-		{
-			sHistorySD[collection].erase(index);
-		}
-	}
+        LLURI u(url);
+        std::string simplified_url = u.scheme() + "://" + u.authority() + u.path();
+        for(int index = 0; index < sHistorySD[collection].size(); index++)
+        {
+            if(sHistorySD[collection].get(index).asString() == simplified_url)
+            {
+                sHistorySD[collection].erase(index);
+            }
+        }
+    }
 }
 
 // static
-- 
cgit v1.2.3


From f44d24fafba7e8b9e8b5318602088a69d8da741c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Sun, 21 Jul 2013 13:02:55 -0700
Subject: ACME-734 : Fix : Factorize and clean up web browsing address, log and
 history code

---
 indra/newview/llfloaterwebcontent.cpp | 36 ++++++++++++++++-------------------
 indra/newview/llfloaterwebcontent.h   |  4 ++--
 2 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 5e8bb7ad57..129e1f0e2a 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -68,6 +68,7 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mUUID(params.id()),
 	mShowPageTitle(params.show_page_title),
     mAllowNavigation(true),
+    mCurrentURL(""),
     mDisplayURL("")
 {
 	mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
@@ -356,17 +357,8 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		if (test_prefix == prefix)
 		{
 			mSecureLockIcon->setVisible(true);
-            if (!mDisplayURL.empty())
-            {
-                // Clear temporary entry if any
-                mAddressCombo->remove( mDisplayURL );
-                mDisplayURL = "";
-            }
             // Hack : we move the text a bit to make space for the lock icon.
-            // That entry in the list will be deleted on the next add.
-            mDisplayURL = "      " + mCurrentURL;
-            mAddressCombo->add( mDisplayURL );
-            mAddressCombo->selectByValue( mDisplayURL );
+            set_current_url("      " + mCurrentURL);
 		}
         else
         {
@@ -414,22 +406,26 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 
 void LLFloaterWebContent::set_current_url(const std::string& url)
 {
+    if (!mCurrentURL.empty())
+    {
+        // Clean up the current browsing list to show true URL
+        mAddressCombo->remove(mDisplayURL);
+        mAddressCombo->add(mCurrentURL);
+    }
+
+    // Update current URLs
+	mDisplayURL = url;
 	mCurrentURL = url;
     LLStringUtil::trim(mCurrentURL);
 
+    // Serialize url history into the system URL History manager
     LLURLHistory::removeURL("browser", mCurrentURL);
-    // serialize url history into the system URL History manager
     LLURLHistory::addURL("browser", mCurrentURL);
 
-    if (!mDisplayURL.empty())
-    {
-        // Clear temporary entry if any
-        mAddressCombo->remove( mDisplayURL );
-        mDisplayURL = "";
-    }
-	mAddressCombo->remove( mCurrentURL );
-	mAddressCombo->add( mCurrentURL );
-	mAddressCombo->selectByValue( mCurrentURL );
+    // Clean up browsing list (prevent dupes) and add/select new URL to it
+	mAddressCombo->remove(mCurrentURL);
+	mAddressCombo->add(mDisplayURL);
+	mAddressCombo->selectByValue(mDisplayURL);
 }
 
 void LLFloaterWebContent::onClickForward()
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index 9d6d28bce0..5976474e0e 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -106,8 +106,8 @@ protected:
 	LLView*			mBtnReload;
 	LLView*			mBtnStop;
 
-	std::string		mCurrentURL;
-	std::string		mDisplayURL;
+	std::string		mCurrentURL;    // Current URL
+	std::string		mDisplayURL;    // URL being displayed in the address bar (can differ by trailing / leading space)
 	std::string		mUUID;
 	bool			mShowPageTitle;
     bool            mAllowNavigation;
-- 
cgit v1.2.3


From 827553f314d411c489bd99048181be5f5ff16d89 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 22 Jul 2013 15:49:26 -0700
Subject: ACME-726: Display 'You are connected to Facebook as' text and the
 user's account name

---
 indra/newview/llfloatersocial.cpp                           | 10 ----------
 indra/newview/skins/default/xui/en/panel_social_account.xml |  2 +-
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d734518cbb..e93a560f8f 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -713,11 +713,6 @@ void LLSocialAccountPanel::showConnectButton()
 	if(!mConnectButton->getVisible())
 	{
 		mConnectButton->setVisible(TRUE);
-		LLRect mLayoutStackRect = mPanelButtons->getRect();
-		F32 deltaTopPadding =  mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop;
-		mLayoutStackRect.translate(0, -(mConnectButton->getRect().getHeight() + deltaTopPadding));
-		mPanelButtons->setRect(mLayoutStackRect);
-
 		mUseAnotherAccountButton->setVisible(FALSE);
 		mDisconnectButton->setVisible(FALSE);
 	}
@@ -728,11 +723,6 @@ void LLSocialAccountPanel::hideConnectButton()
 	if(mConnectButton->getVisible())
 	{
 		mConnectButton->setVisible(FALSE);
-		LLRect mLayoutStackRect = mPanelButtons->getRect();
-		F32 deltaTopPadding =  mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop;
-		mLayoutStackRect.translate(0, mConnectButton->getRect().getHeight() + deltaTopPadding);
-		mPanelButtons->setRect(mLayoutStackRect);
-
 		mUseAnotherAccountButton->setVisible(TRUE);
 		mDisconnectButton->setVisible(TRUE);
 	}
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 8706aac5ce..7bd3bb191e 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -52,7 +52,7 @@
   <button
    layout="topleft"
    follows="left|top"
-   top_pad="9"
+   top_delta="0"
    height="23"
    label="Use another account..."
    name="use_another_account_btn"
-- 
cgit v1.2.3


From 58d107130b41d9e1380079db6f29578a56ee99fb Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 22 Jul 2013 17:25:21 -0700
Subject: ACME-741: Fixed: Do not try to get FB account info when the user is
 not connected to FB (otherwise, it autoconnects...)

---
 indra/newview/llfloatersocial.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d734518cbb..acfb0960be 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -650,8 +650,6 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
 		LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1));
 
-		LLFacebookConnect::instance().loadFacebookInfo();
-
 		LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel");
 		LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this));
 
-- 
cgit v1.2.3


From 9c97f4f5ef46369714b8e7beb2cb990f06b0f096 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 22 Jul 2013 18:47:05 -0700
Subject: ACME-734 : Fix: Do not log empty URLs, refocus on page if the focus
 was there

---
 indra/newview/llfloaterwebcontent.cpp | 37 ++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 129e1f0e2a..62eb9dba8e 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -358,7 +358,9 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		{
 			mSecureLockIcon->setVisible(true);
             // Hack : we move the text a bit to make space for the lock icon.
+            BOOL browser_has_focus = mWebBrowser->hasFocus();
             set_current_url("      " + mCurrentURL);
+            mWebBrowser->setFocus(browser_has_focus);
 		}
         else
         {
@@ -406,26 +408,29 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 
 void LLFloaterWebContent::set_current_url(const std::string& url)
 {
-    if (!mCurrentURL.empty())
+    if (!url.empty())
     {
-        // Clean up the current browsing list to show true URL
-        mAddressCombo->remove(mDisplayURL);
-        mAddressCombo->add(mCurrentURL);
-    }
+        if (!mCurrentURL.empty())
+        {
+            // Clean up the current browsing list to show true URL
+            mAddressCombo->remove(mDisplayURL);
+            mAddressCombo->add(mCurrentURL);
+        }
 
-    // Update current URLs
-	mDisplayURL = url;
-	mCurrentURL = url;
-    LLStringUtil::trim(mCurrentURL);
+        // Update current URLs
+        mDisplayURL = url;
+        mCurrentURL = url;
+        LLStringUtil::trim(mCurrentURL);
 
-    // Serialize url history into the system URL History manager
-    LLURLHistory::removeURL("browser", mCurrentURL);
-    LLURLHistory::addURL("browser", mCurrentURL);
+        // Serialize url history into the system URL History manager
+        LLURLHistory::removeURL("browser", mCurrentURL);
+        LLURLHistory::addURL("browser", mCurrentURL);
 
-    // Clean up browsing list (prevent dupes) and add/select new URL to it
-	mAddressCombo->remove(mCurrentURL);
-	mAddressCombo->add(mDisplayURL);
-	mAddressCombo->selectByValue(mDisplayURL);
+        // Clean up browsing list (prevent dupes) and add/select new URL to it
+        mAddressCombo->remove(mCurrentURL);
+        mAddressCombo->add(mDisplayURL);
+        mAddressCombo->selectByValue(mDisplayURL);
+    }
 }
 
 void LLFloaterWebContent::onClickForward()
-- 
cgit v1.2.3


From 882b2508db4519b328016802ab72093df7911e68 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 22 Jul 2013 18:49:22 -0700
Subject: ACME-729 Implement the 'Use another account...' button

---
 indra/newview/llfacebookconnect.cpp | 34 ++++++++++++++++++++++++++++++++++
 indra/newview/llfacebookconnect.h   |  1 +
 indra/newview/llfloatersocial.cpp   |  2 +-
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 7c1e7b3b16..0d6806d252 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -245,6 +245,35 @@ private:
 	bool mAutoConnect;
 };
 
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFacebookDisconnectThenConnectResponder : public LLHTTPClient::Responder
+{
+	LOG_CLASS(LLFacebookDisconnectThenConnectResponder);
+public:
+
+	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+	{
+		if (isGoodStatus(status))
+		{
+			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
+
+			// Clear all facebook stuff
+			LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+			LLFacebookConnect::instance().clearContent();
+
+			LLViewerMedia::clearAllCookies();
+
+			//Now attempt to reconnect
+			LLFacebookConnect::instance().checkConnectionToFacebook(true);
+		}
+		else
+		{
+			log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
+		}
+	}
+};
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 class LLFacebookInfoResponder : public LLHTTPClient::Responder
@@ -363,6 +392,11 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
     }
 }
 
+void LLFacebookConnect::disconnectThenConnectToFacebook()
+{
+	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectThenConnectResponder());
+}
+
 void LLFacebookConnect::loadFacebookInfo()
 {
 	const bool follow_redirects = false;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 1dbc35c27f..b59c7090f6 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -57,6 +57,7 @@ public:
 	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 disconnectThenConnectToFacebook();																// Disconnects and then connects (for switching FB accounts)
     
 	void loadFacebookInfo();
     void loadFacebookFriends();
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index e93a560f8f..f0bd1bb71a 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -750,7 +750,7 @@ void LLSocialAccountPanel::onConnect()
 
 void LLSocialAccountPanel::onUseAnotherAccount()
 {
-
+	LLFacebookConnect::instance().disconnectThenConnectToFacebook();
 }
 
 void LLSocialAccountPanel::onDisconnect()
-- 
cgit v1.2.3


From 0d663f8d2cd5b55300b10b29733fbc8f43fceda1 Mon Sep 17 00:00:00 2001
From: Cinder Roxley <cinder.roxley@phoenixviewer.com>
Date: Tue, 23 Jul 2013 15:31:00 +0000
Subject: STORM-1958: Only draw the user's netmap dot once

---
 indra/newview/llnetmap.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index dea90b9042..08b5eaedbb 100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -343,8 +343,11 @@ void LLNetMap::draw()
 		// Draw avatars
 		for (U32 i = 0; i < avatar_ids.size(); i++)
 		{
-			pos_map = globalPosToView(positions[i]);
 			LLUUID uuid = avatar_ids[i];
+			// Skip self, we'll draw it later
+			if (uuid == gAgent.getID()) continue;
+
+			pos_map = globalPosToView(positions[i]);
 
 			bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
 
-- 
cgit v1.2.3


From 66522bb6bdff50f5f6838c1410e2cc4ab45a0a62 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Jul 2013 13:31:41 -0700
Subject: ACME-677 Make the 'Connect...', 'Disconnect' and 'Use another
 account...' buttons disabled upon clicking

---
 indra/newview/llfacebookconnect.cpp            | 12 +++++++++++-
 indra/newview/llfacebookconnect.h              |  5 +++--
 indra/newview/llfloatersocial.cpp              | 23 +++++++++++++++++++++++
 indra/newview/llfloatersocial.h                |  1 +
 indra/newview/skins/default/xui/en/strings.xml |  1 +
 5 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 0d6806d252..cccfb6f2b8 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -181,7 +181,12 @@ class LLFacebookDisconnectResponder : public LLHTTPClient::Responder
 {
 	LOG_CLASS(LLFacebookDisconnectResponder);
 public:
-    
+ 
+	LLFacebookDisconnectResponder()
+	{
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
+	}
+
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		if (isGoodStatus(status))
@@ -252,6 +257,11 @@ class LLFacebookDisconnectThenConnectResponder : public LLHTTPClient::Responder
 	LOG_CLASS(LLFacebookDisconnectThenConnectResponder);
 public:
 
+	LLFacebookDisconnectThenConnectResponder()
+	{
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
+	}
+
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
 		if (isGoodStatus(status))
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index b59c7090f6..f74b9f7d41 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -51,7 +51,8 @@ public:
 		FB_CONNECTION_FAILED = 3,
 		FB_POSTING = 4,
 		FB_POSTED = 5,
-		FB_POST_FAILED = 6
+		FB_POST_FAILED = 6,
+		FB_DISCONNECTING = 7
 	};
 	
 	void connectToFacebook(const std::string& auth_code = "", const std::string& auth_state = "");	// Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use.
@@ -73,7 +74,7 @@ public:
     const LLSD& getContent() const;
     
     void setConnectionState(EConnectionState connection_state);
-	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
+	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_DISCONNECTING) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
 	bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING)); }
     EConnectionState getConnectionState() { return mConnectionState; }
     S32  generation() { return mGeneration; }
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 2eb112d328..3c8d4d6fb9 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -641,6 +641,22 @@ BOOL LLSocialAccountPanel::postBuild()
 	return LLPanel::postBuild();
 }
 
+void LLSocialAccountPanel::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);
+	mUseAnotherAccountButton->setEnabled(!disconnecting);
+
+	//Disable the 'connect' button when a connection is in progress
+	bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
+	mConnectButton->setEnabled(!connecting);
+
+	LLPanel::draw();
+}
+
 void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 {
 	bool visible = new_visibility.asBoolean();
@@ -862,6 +878,13 @@ void LLFloaterSocial::draw()
             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;
         }
     }
 	LLFloater::draw();
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index f947207fbe..13c29e7028 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -120,6 +120,7 @@ class LLSocialAccountPanel : public LLPanel
 public:
 	LLSocialAccountPanel();
 	BOOL postBuild();
+	void draw();
 
 private:
 	void onVisibilityChange(const LLSD& new_visibility);
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 5067922b88..02b64ef7e3 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -153,6 +153,7 @@ Please try logging in again in a minute.</string>
 	<string name="SocialFacebookPosting">Posting...</string>
 	<string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string>
 	<string name="SocialFacebookErrorPosting">Problem posting to Facebook</string>
+	<string name="SocialFacebookDisconnecting">Disconnecting from Facebook...</string>
     
 	<!-- Tooltip -->
 	<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->
-- 
cgit v1.2.3


From 6df15cb0908dab240e85b5db1433726ee09ad9bf Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 23 Jul 2013 15:31:36 -0700
Subject: ACME-734 : Fix issues with the lock icon when editing the address
 bar. Generalize the secure browsing UI.

---
 indra/newview/llfloaterwebcontent.cpp | 42 ++++++++++++++++-------------------
 indra/newview/llfloaterwebcontent.h   |  1 +
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 62eb9dba8e..e81055f7b1 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -69,7 +69,8 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
 	mShowPageTitle(params.show_page_title),
     mAllowNavigation(true),
     mCurrentURL(""),
-    mDisplayURL("")
+    mDisplayURL(""),
+    mSecureURL(false)
 {
 	mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
 	mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
@@ -242,7 +243,6 @@ void LLFloaterWebContent::open_media(const Params& p)
 	mWebBrowser->setTarget(p.target);
 	mWebBrowser->navigateTo(p.url, "text/html");
 	
-    mSecureLockIcon->setVisible(false);
 	set_current_url(p.url);
 
 	getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome);
@@ -304,6 +304,9 @@ void LLFloaterWebContent::draw()
 	mBtnBack->setEnabled( mWebBrowser->canNavigateBack() && mAllowNavigation);
 	mBtnForward->setEnabled( mWebBrowser->canNavigateForward() && mAllowNavigation);
 
+    // Show/hide the lock icon
+    mSecureLockIcon->setVisible(mSecureURL && !mAddressCombo->hasFocus());
+
 	LLFloater::draw();
 }
 
@@ -317,7 +320,6 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		if ( url.length() )
 			mStatusBarText->setText( url );
 
-        mSecureLockIcon->setVisible(false);
 		set_current_url( url );
 	}
 	else if(event == MEDIA_EVENT_NAVIGATE_BEGIN)
@@ -349,23 +351,6 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 		// we populate the status bar with URLs as they change so clear it now we're done
 		const std::string end_str = "";
 		mStatusBarText->setText( end_str );
-
-		// decide if secure browsing icon should be displayed
-		std::string prefix = std::string("https://");
-		std::string test_prefix = mCurrentURL.substr(0, prefix.length());
-		LLStringUtil::toLower(test_prefix);
-		if (test_prefix == prefix)
-		{
-			mSecureLockIcon->setVisible(true);
-            // Hack : we move the text a bit to make space for the lock icon.
-            BOOL browser_has_focus = mWebBrowser->hasFocus();
-            set_current_url("      " + mCurrentURL);
-            mWebBrowser->setFocus(browser_has_focus);
-		}
-        else
-        {
-            mSecureLockIcon->setVisible(false);
-        }
 	}
 	else if(event == MEDIA_EVENT_CLOSE_REQUEST)
 	{
@@ -417,8 +402,7 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
             mAddressCombo->add(mCurrentURL);
         }
 
-        // Update current URLs
-        mDisplayURL = url;
+        // Update current URL
         mCurrentURL = url;
         LLStringUtil::trim(mCurrentURL);
 
@@ -426,10 +410,22 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
         LLURLHistory::removeURL("browser", mCurrentURL);
         LLURLHistory::addURL("browser", mCurrentURL);
 
-        // Clean up browsing list (prevent dupes) and add/select new URL to it
+		// Check if this is a secure URL
+		static const std::string secure_prefix = std::string("https://");
+		std::string prefix = mCurrentURL.substr(0, secure_prefix.length());
+		LLStringUtil::toLower(prefix);
+        mSecureURL = (prefix == secure_prefix);
+        
+        // Hack : we move the text a bit to make space for the lock icon in the secure URL case
+		mDisplayURL = (mSecureURL ? "      " + mCurrentURL : mCurrentURL);
+
+        // Clean up browsing list (prevent dupes) and add/select the new URL to it
         mAddressCombo->remove(mCurrentURL);
         mAddressCombo->add(mDisplayURL);
         mAddressCombo->selectByValue(mDisplayURL);
+
+        // Set the focus back to the web page. When setting the url, there's no point to leave the focus anywhere else.
+		mWebBrowser->setFocus(TRUE);
     }
 }
 
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index 5976474e0e..f7e0db8d9e 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -111,6 +111,7 @@ protected:
 	std::string		mUUID;
 	bool			mShowPageTitle;
     bool            mAllowNavigation;
+    bool            mSecureURL;     // true when the current url is prefixed "https://"
 };
 
 #endif  // LL_LLFLOATERWEBCONTENT_H
-- 
cgit v1.2.3


From 66d41f02ba0e55a2cb34752c8f77b71b9a0c0503 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 23 Jul 2013 16:30:24 -0700
Subject: changing facebook floater title to match spec. The title was
 'FACEBOOK' and is now 'POST TO FACEOOK'

---
 indra/newview/skins/default/xui/en/floater_social.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index eb209eb314..3eff2c2ae1 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -10,7 +10,7 @@
   save_rect="true"
   single_instance="true"
   reuse_instance="true"
-  title="FACEBOOK"
+  title="POST TO FACEBOOK"
   height="482"
   width="304">
   <panel
-- 
cgit v1.2.3


From 05c2e087153a9816de2c6218c2509cbdb935ccf0 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 23 Jul 2013 17:12:53 -0700
Subject: ACME-734 : MoaP : Move the secure lock icon to the left on Media on
 Prim address bar

---
 indra/newview/llpanelprimmediacontrols.cpp         | 18 ++++++++-------
 indra/newview/llpanelprimmediacontrols.h           |  1 +
 .../default/xui/en/panel_prim_media_controls.xml   | 26 ++++++++++------------
 3 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 76d38f067d..9504f22a1d 100755
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -94,7 +94,8 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :
 	mZoomObjectFace(0),
 	mVolumeSliderVisible(0),
 	mWindowShade(NULL),
-	mHideImmediately(false)
+	mHideImmediately(false),
+    mSecureURL(false)
 {
 	mCommitCallbackRegistrar.add("MediaCtrl.Close",		boost::bind(&LLPanelPrimMediaControls::onClickClose, this));
 	mCommitCallbackRegistrar.add("MediaCtrl.Back",		boost::bind(&LLPanelPrimMediaControls::onClickBack, this));
@@ -345,7 +346,7 @@ void LLPanelPrimMediaControls::updateShape()
 		// Disable zoom if HUD
 		mZoomCtrl->setEnabled(!is_hud);
 		mUnzoomCtrl->setEnabled(!is_hud);
-		mSecureLockIcon->setVisible(false);
+        mSecureURL = false;
 		mCurrentURL = media_impl->getCurrentMediaURL();
 		
 		mBackCtrl->setEnabled((media_impl != NULL) && media_impl->canNavigateBack() && can_navigate);
@@ -382,7 +383,7 @@ void LLPanelPrimMediaControls::updateShape()
 			mVolumeSliderCtrl->setVisible(has_focus && shouldVolumeSliderBeVisible());
 			
 			mWhitelistIcon->setVisible(false);
-			mSecureLockIcon->setVisible(false);
+            mSecureURL = false;
 			if (mMediaPanelScroll)
 			{
 				mMediaPanelScroll->setVisible(false);
@@ -416,7 +417,7 @@ void LLPanelPrimMediaControls::updateShape()
 				mMediaPlaySliderCtrl->setEnabled(true);
 			}
 			
-			// video vloume
+			// video volume
 			if(volume <= 0.0)
 			{
 				mMuteBtn->setToggleState(true);
@@ -492,10 +493,8 @@ void LLPanelPrimMediaControls::updateShape()
 			std::string prefix =  std::string("https://");
 			std::string test_prefix = mCurrentURL.substr(0, prefix.length());
 			LLStringUtil::toLower(test_prefix);
-			if(test_prefix == prefix)
-			{
-				mSecureLockIcon->setVisible(has_focus);
-			}
+            mSecureURL = has_focus && (test_prefix == prefix);
+            mCurrentURL = (mSecureURL ? "      " + mCurrentURL : mCurrentURL);
 			
 			if(mCurrentURL!=mPreviousURL)
 			{
@@ -746,6 +745,9 @@ void LLPanelPrimMediaControls::draw()
 			clearFaceOnFade();
 		}
 	}
+
+    // Show/hide the lock icon for secure browsing
+    mSecureLockIcon->setVisible(mSecureURL && !mMediaAddress->hasFocus());
 	
 	// Build rect for icon area in coord system of this panel
 	// Assumes layout_stack is a direct child of this panel
diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h
index eeb433e306..6d2eb3430e 100755
--- a/indra/newview/llpanelprimmediacontrols.h
+++ b/indra/newview/llpanelprimmediacontrols.h
@@ -191,6 +191,7 @@ private:
 	bool mUpdateSlider;
 	bool mClearFaceOnFade;
 	bool mHideImmediately;
+    bool mSecureURL;
 
 	LLMatrix4 mLastCameraMat;
 	EZoomLevel mCurrentZoom;
diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
index 198ccd6e2f..8f90521bb2 100755
--- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
@@ -315,7 +315,18 @@
 		<line_editor.commit_callback
 			function="MediaCtrl.CommitURL"/>
 	  </line_editor>
-	  <layout_stack
+        <icon
+        name="media_secure_lock_flag"
+        height="16"
+        follows="top|left"
+        image_name="Lock2"
+        layout="topleft"
+        left_delta="2"
+        top_delta="2"
+        visible="false"
+        tool_tip="Secured Browsing"
+        width="16" />
+        <layout_stack
 		  name="media_address_url_icons"
 		  animate="false"
 		  follows="top|right"
@@ -340,19 +351,6 @@
 			  tool_tip="White List enabled"
 			  width="16" />
 		</layout_panel>
-		<layout_panel
-			layout="topleft"
-			width="16"
-			mouse_opaque="false"
-			auto_resize="false">
-		  <icon
-			  name="media_secure_lock_flag"
-			  height="16"
-			  image_name="Lock2"
-			  layout="topleft"
-			  tool_tip="Secured Browsing"
-			  width="16" />
-		</layout_panel>
 	  </layout_stack>
 	</layout_panel>
 	<layout_panel
-- 
cgit v1.2.3


From 4faad350c7dd7fa2e2606231d8293c357823348a Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 24 Jul 2013 12:34:32 -0400
Subject: Improve envelope notification behavior when there is no toast to
 display

---
 indra/newview/llchiclet.cpp                        | 23 ++++++++++++++--------
 indra/newview/llsyswellwindow.cpp                  |  5 +++++
 indra/newview/llsyswellwindow.h                    |  1 +
 .../newview/skins/default/xui/en/notifications.xml |  3 ---
 4 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 88884042d4..131aea9da3 100755
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -220,18 +220,25 @@ void LLNotificationChiclet::setCounter(S32 counter)
 
 bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notification )
 {
-	if (notification->getName() == "ScriptDialog")
+	bool displayNotification;
+	if (   (notification->getName() == "ScriptDialog") // special case for scripts
+		// if there is no toast window for the notification, filter it
+		|| (!LLNotificationWellWindow::getInstance()->findItemByID(notification->getID()))
+		)
 	{
-		return false;
+		displayNotification = false;
 	}
-
-	if( !(notification->canLogToIM() && notification->hasFormElements())
-		&& (!notification->getPayload().has("give_inventory_notification")
-			|| notification->getPayload()["give_inventory_notification"]))
+	else if( !(notification->canLogToIM() && notification->hasFormElements())
+			&& (!notification->getPayload().has("give_inventory_notification")
+				|| notification->getPayload()["give_inventory_notification"]))
 	{
-		return true;
+		displayNotification = true;
 	}
-	return false;
+	else
+	{
+		displayNotification = false;
+	}
+	return displayNotification;
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index e92bd766ca..4846c54189 100755
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -118,6 +118,11 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id)
 	}
 }
 
+ LLPanel * LLSysWellWindow::findItemByID(const LLUUID& id)
+{
+       return mMessageList->getItemByValue(id);
+}
+
 //---------------------------------------------------------------------------------
 //---------------------------------------------------------------------------------
 void LLSysWellWindow::initChannel() 
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index cc5c057d8b..71b41476f5 100755
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -55,6 +55,7 @@ public:
 
 	// Operating with items
 	void removeItemByID(const LLUUID& id);
+	LLPanel * findItemByID(const LLUUID& id);
 
 	// Operating with outfit
 	virtual void setVisible(BOOL visible);
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 15fbb130a4..0f2ee73950 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6756,7 +6756,6 @@ Offer a teleport?
    icon="notify.tga"
    name="FriendshipOffered"
    log_to_im="true"   
-   show_toast="false"   
    type="notify">
     <tag>friendship</tag>
 	You have offered friendship to [TO_NAME]
@@ -6806,7 +6805,6 @@ Offer a teleport?
    icon="notify.tga"
    name="FriendshipAcceptedByMe"
    log_to_im="true"   
-   show_toast="false"
    type="notify">
     <tag>friendship</tag>
 Friendship offer accepted.
@@ -6816,7 +6814,6 @@ Friendship offer accepted.
    icon="notify.tga"
    name="FriendshipDeclinedByMe"
    log_to_im="true"   
-   show_toast="false"   
    type="notify">
     <tag>friendship</tag>
 Friendship offer declined.
-- 
cgit v1.2.3


From f81e2ce680ee2bd7c4704dbbeadee20c8d7eafd5 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 24 Jul 2013 14:28:30 -0400
Subject: credit Cinder with STORM-1951

---
 doc/contributions.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 886b3c213d..9ec85ef05c 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -301,6 +301,7 @@ Ciaran Laval
 Cinder Roxley
     BUG-2326
     STORM-1703
+    STORM-1951
 Clara Young
 Coaldust Numbers
     VWR-1095
-- 
cgit v1.2.3


From 91c8740c3533bcf870a191fad30fef1fafbe88c7 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 24 Jul 2013 17:17:19 -0700
Subject: ACME-602 Remove logging code that reveals use of suggested friends

---
 indra/newview/llfacebookconnect.cpp | 1 -
 indra/newview/llpanelpeople.cpp     | 2 --
 2 files changed, 3 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index cccfb6f2b8..486195a483 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -325,7 +325,6 @@ public:
 	{
 		if (isGoodStatus(status))
 		{
-			llinfos << "Facebook: Friends list received" << llendl;
 			LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL;
 			LLFacebookConnect::instance().storeContent(content);
 		}
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 766335c982..f1ee76f733 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -785,8 +785,6 @@ bool LLPanelPeople::updateSuggestedFriendList()
 {
 	if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
 	{
-		llinfos << "Facebook: Updating Suggested Friends List" << llendl;
-
 		mFacebookListGeneration = LLFacebookConnect::instance().generation();
 
 		const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
-- 
cgit v1.2.3


From ee0b66f080de53f70599c824d5ff231d6a9c739f Mon Sep 17 00:00:00 2001
From: "Jeff (Gioffredo Linden)" <gioffredo@lindenlab.com>
Date: Thu, 25 Jul 2013 16:07:16 -0400
Subject: VITA test framework - record events support

---
 indra/llui/CMakeLists.txt                          |   2 +
 indra/llui/llbutton.cpp                            |   4 +
 indra/llui/llfloater.cpp                           |  25 +-
 indra/llui/llfloater.h                             |   1 +
 indra/llui/lltabcontainer.cpp                      |  56 +++--
 indra/llui/lluictrl.cpp                            |  20 +-
 indra/llui/llview.cpp                              |  61 ++++-
 indra/llui/llviewereventrecorder.cpp               | 270 +++++++++++++++++++++
 indra/llui/llviewereventrecorder.h                 |  78 ++++++
 indra/llwindow/llwindowmacosx.cpp                  |   2 +
 indra/newview/app_settings/cmd_line.xml            |   8 +
 indra/newview/app_settings/settings.xml            |  21 ++
 indra/newview/llappviewer.cpp                      |   9 +
 indra/newview/llviewerkeyboard.cpp                 |   5 +-
 indra/newview/llviewermenu.cpp                     |  41 ++++
 indra/newview/llviewerwindow.cpp                   | 102 ++++----
 indra/newview/llwindowlistener.cpp                 |   9 +-
 indra/newview/skins/default/xui/en/menu_viewer.xml |  28 +++
 18 files changed, 660 insertions(+), 82 deletions(-)
 create mode 100644 indra/llui/llviewereventrecorder.cpp
 create mode 100644 indra/llui/llviewereventrecorder.h

diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index 34a08603fa..aa6684e7a8 100755
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -128,6 +128,7 @@ set(llui_SOURCE_FILES
     llviewmodel.cpp
     llview.cpp
     llviewquery.cpp
+    llviewereventrecorder.cpp
     llwindowshade.cpp
     llxuiparser.cpp
     )
@@ -240,6 +241,7 @@ set(llui_HEADER_FILES
     llviewinject.h
     llviewmodel.h
     llview.h
+    llviewereventrecorder.h
     llviewquery.h
     llwindowshade.h
     llxuiparser.h
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index a8149a9a1d..4ccb019106 100755
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -49,6 +49,7 @@
 #include "lluictrlfactory.h"
 #include "llhelp.h"
 #include "lldockablefloater.h"
+#include "llviewereventrecorder.h"
 
 static LLDefaultChildRegistry::Register<LLButton> r("button");
 
@@ -443,6 +444,8 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
 		 */
 		LLUICtrl::handleMouseDown(x, y, mask);
 
+		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname());
+
 		if(mMouseDownSignal) (*mMouseDownSignal)(this, LLSD());
 
 		mMouseDownTimer.start();
@@ -473,6 +476,7 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
 		 * by calling LLUICtrl::mMouseUpSignal(x, y, mask);
 		 */
 		LLUICtrl::handleMouseUp(x, y, mask);
+		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); 
 
 		// Regardless of where mouseup occurs, handle callback
 		if(mMouseUpSignal) (*mMouseUpSignal)(this, LLSD());
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 09e27a264a..913de49d63 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -29,7 +29,7 @@
 // mini-map floater, etc.
 
 #include "linden_common.h"
-
+#include "llviewereventrecorder.h"
 #include "llfloater.h"
 
 #include "llfocusmgr.h"
@@ -653,7 +653,10 @@ void LLFloater::handleVisibilityChange ( BOOL new_visibility )
 
 void LLFloater::openFloater(const LLSD& key)
 {
-	llinfos << "Opening floater " << getName() << llendl;
+    llinfos << "Opening floater " << getName() << " full path: " << getPathname() << llendl;
+
+	LLViewerEventRecorder::instance().logVisibilityChange( getPathname(), getName(), true,"floater"); // Last param is event subtype or empty string
+
 	mKey = key; // in case we need to open ourselves again
 
 	if (getSoundFlags() != SILENT 
@@ -707,6 +710,7 @@ void LLFloater::openFloater(const LLSD& key)
 void LLFloater::closeFloater(bool app_quitting)
 {
 	llinfos << "Closing floater " << getName() << llendl;
+	LLViewerEventRecorder::instance().logVisibilityChange( getPathname(), getName(), false,"floater"); // Last param is event subtype or empty string
 	if (app_quitting)
 	{
 		LLFloater::sQuitting = true;
@@ -1552,6 +1556,17 @@ BOOL LLFloater::handleScrollWheel(S32 x, S32 y, S32 clicks)
 	return TRUE;//always
 }
 
+// virtual
+BOOL LLFloater::handleMouseUp(S32 x, S32 y, MASK mask)
+{
+	lldebugs << "LLFloater::handleMouseUp calling LLPanel (really LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl;
+	BOOL handled = LLPanel::handleMouseUp(x,y,mask); // Not implemented in LLPanel so this actually calls LLView
+	if (handled) {
+		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname());
+	}
+	return handled;
+}
+
 // virtual
 BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask)
 {
@@ -1572,7 +1587,11 @@ BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask)
 	else
 	{
 		bringToFront( x, y );
-		return LLPanel::handleMouseDown( x, y, mask );
+		BOOL handled = LLPanel::handleMouseDown( x, y, mask ); 
+		if (handled) {
+			LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); 
+		}
+		return handled;
 	}
 }
 
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 4dba1e645f..09fe2219c0 100755
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -285,6 +285,7 @@ public:
 	S32				getHeaderHeight() const { return mHeaderHeight; }
 
 	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);
+	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask);
 	virtual BOOL	handleMiddleMouseDown(S32 x, S32 y, MASK mask);
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index fd98155704..76ba53ec32 100755
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -27,7 +27,7 @@
 #include "linden_common.h"
 
 #include "lltabcontainer.h"
-
+#include "llviewereventrecorder.h"
 #include "llfocusmgr.h"
 #include "lllocalcliprect.h"
 #include "llrect.h"
@@ -578,6 +578,11 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask )
 			tab_button->setFocus(TRUE);
 		}
 	}
+	if (handled) {
+		// Note: May need to also capture local coords right here ?
+		LLViewerEventRecorder::instance().update_xui(getPathname( ));
+	}
+
 	return handled;
 }
 
@@ -629,30 +634,33 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask )
 	BOOL handled = FALSE;
 	BOOL has_scroll_arrows = (getMaxScrollPos() > 0)  && !getTabsHidden();
 
+	S32 local_x = x - getRect().mLeft;
+	S32 local_y = y - getRect().mBottom;
+
 	if (has_scroll_arrows)
 	{
 		if (mJumpPrevArrowBtn && mJumpPrevArrowBtn->getRect().pointInRect(x, y))
 		{
-			S32 local_x = x - mJumpPrevArrowBtn->getRect().mLeft;
-			S32 local_y = y - mJumpPrevArrowBtn->getRect().mBottom;
+			local_x = x - mJumpPrevArrowBtn->getRect().mLeft;
+			local_y = y - mJumpPrevArrowBtn->getRect().mBottom;
 			handled = mJumpPrevArrowBtn->handleMouseUp(local_x, local_y, mask);
 		}
 		else if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x,	y))
 		{
-			S32	local_x	= x	- mJumpNextArrowBtn->getRect().mLeft;
-			S32	local_y	= y	- mJumpNextArrowBtn->getRect().mBottom;
+			local_x	= x	- mJumpNextArrowBtn->getRect().mLeft;
+			local_y	= y	- mJumpNextArrowBtn->getRect().mBottom;
 			handled = mJumpNextArrowBtn->handleMouseUp(local_x,	local_y, mask);
 		}
 		else if (mPrevArrowBtn && mPrevArrowBtn->getRect().pointInRect(x, y))
 		{
-			S32 local_x = x - mPrevArrowBtn->getRect().mLeft;
-			S32 local_y = y - mPrevArrowBtn->getRect().mBottom;
+			local_x = x - mPrevArrowBtn->getRect().mLeft;
+			local_y = y - mPrevArrowBtn->getRect().mBottom;
 			handled = mPrevArrowBtn->handleMouseUp(local_x, local_y, mask);
 		}
 		else if (mNextArrowBtn && mNextArrowBtn->getRect().pointInRect(x, y))
 		{
-			S32 local_x = x - mNextArrowBtn->getRect().mLeft;
-			S32 local_y = y - mNextArrowBtn->getRect().mBottom;
+			local_x = x - mNextArrowBtn->getRect().mLeft;
+			local_y = y - mNextArrowBtn->getRect().mBottom;
 			handled = mNextArrowBtn->handleMouseUp(local_x, local_y, mask);
 		}
 	}
@@ -676,6 +684,10 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask )
 		}
 		gFocusMgr.setMouseCapture(NULL);
 	}
+	if (handled) {
+		// Note: may need to capture local coords here
+		LLViewerEventRecorder::instance().update_xui(getPathname( ));
+	}
 	return handled;
 }
 
@@ -1059,21 +1071,21 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
 		
 		if (mIsVertical)
 		{
-			p.name(std::string("vert tab button"));
-			p.image_unselected(mMiddleTabParams.tab_left_image_unselected);
-			p.image_selected(mMiddleTabParams.tab_left_image_selected);
-			p.follows.flags = p.follows.flags() | FOLLOWS_TOP;
+		  p.name("vtab_"+std::string(child->getName()));
+		  p.image_unselected(mMiddleTabParams.tab_left_image_unselected);
+		  p.image_selected(mMiddleTabParams.tab_left_image_selected);
+		  p.follows.flags = p.follows.flags() | FOLLOWS_TOP;
 		}
 		else
-		{
-			p.name(std::string(child->getName()) + " tab");
-			p.visible(false);
-			p.image_unselected(tab_img);
-			p.image_selected(tab_selected_img);
-			p.follows.flags = p.follows.flags() | (getTabPosition() == TOP ? FOLLOWS_TOP : FOLLOWS_BOTTOM);
-			// Try to squeeze in a bit more text
-			p.pad_left( mLabelPadLeft );
-			p.pad_right(2);
+		  { 
+		    p.name("htab_"+std::string(child->getName()));
+		    p.visible(false);
+		    p.image_unselected(tab_img);
+		    p.image_selected(tab_selected_img);
+		    p.follows.flags = p.follows.flags() | (getTabPosition() == TOP ? FOLLOWS_TOP : FOLLOWS_BOTTOM);
+		    // Try to squeeze in a bit more text
+		    p.pad_left( mLabelPadLeft );
+		    p.pad_right(2);
 		}
 		
 		// *TODO : It seems wrong not to use p in both cases considering the way p is initialized
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index b9c843e931..1722bf27bd 100755
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -29,7 +29,7 @@
 
 #define LLUICTRL_CPP
 #include "lluictrl.h"
-
+#include "llviewereventrecorder.h"
 #include "llfocusmgr.h"
 #include "llpanel.h"
 #include "lluictrlfactory.h"
@@ -308,22 +308,40 @@ void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
 //virtual 
 BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
 {
+
+	lldebugs << "LLUICtrl::handleMouseDown calling	LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl;
+  
 	BOOL handled  = LLView::handleMouseDown(x,y,mask);
+	
 	if (mMouseDownSignal)
 	{
 		(*mMouseDownSignal)(this,x,y,mask);
 	}
+	lldebugs << "LLUICtrl::handleMousedown - handled is returning as: " << handled << "	  " << llendl;
+	
+	if (handled) {
+		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-56,-56,getPathname());
+	}
 	return handled;
 }
 
 //virtual
 BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
 {
+
+	lldebugs << "LLUICtrl::handleMouseUp calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl;
+
 	BOOL handled  = LLView::handleMouseUp(x,y,mask);
+	if (handled) {
+		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-56,-56,getPathname()); 
+	}
 	if (mMouseUpSignal)
 	{
 		(*mMouseUpSignal)(this,x,y,mask);
 	}
+
+	lldebugs << "LLUICtrl::handleMouseUp - handled for xui " << getPathname() << "  -  is returning as: " << handled << "   " << llendl;
+
 	return handled;
 }
 
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 3613a40e2c..9a42fc637b 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -48,7 +48,9 @@
 #include "lluictrlfactory.h"
 #include "lltooltip.h"
 #include "llsdutil.h"
-
+#include "llsdserialize.h"
+#include "llviewereventrecorder.h"
+#include "llkeyboard.h"
 // for ui edit hack
 #include "llbutton.h"
 #include "lllineeditor.h"
@@ -642,13 +644,27 @@ void LLView::setVisible(BOOL visible)
 // virtual
 void LLView::handleVisibilityChange ( BOOL new_visibility )
 {
+	BOOL old_visibility;
 	BOOST_FOREACH(LLView* viewp, mChildList)
 	{
 		// only views that are themselves visible will have their overall visibility affected by their ancestors
-		if (viewp->getVisible())
+		old_visibility=viewp->getVisible();
+
+		if (old_visibility!=new_visibility)
+		{
+			LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget");
+		}
+
+		if (old_visibility)
 		{
 			viewp->handleVisibilityChange ( new_visibility );
 		}
+
+		// Consider changing returns to confirm success and know which widget grabbed it
+		// For now assume success and log at highest xui possible 
+		// NOTE we log actual state - which may differ if it somehow failed to set visibility
+		lldebugs << "LLView::handleVisibilityChange	 - now: " << getVisible()  << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl;
+		
 	}
 }
 
@@ -697,6 +713,7 @@ bool LLView::visibleEnabledAndContains(S32 local_x, S32 local_y)
 		&& getEnabled();
 }
 
+// This is NOT event recording related
 void LLView::logMouseEvent()
 {
 	if (sDebugMouseHandling)
@@ -743,8 +760,15 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA
 		if ((viewp->*method)( local_x, local_y, extra )
 			|| (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y )))
 		{
-			viewp->logMouseEvent();
-			return viewp;
+		lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x  "<< local_x << " " << x	<< "local/global y " << local_y << " " << y << llendl;
+		lldebugs << "LLView::childrenHandleMouseEvent  getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl;
+
+		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); 
+
+		// This is NOT event recording related
+		viewp->logMouseEvent();
+
+		return viewp;
 		}
 	}
 	return NULL;
@@ -766,6 +790,7 @@ LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask)
 		if (viewp->handleToolTip(local_x, local_y, mask) 
 			|| viewp->blockMouseEvent(local_x, local_y))
 		{
+			// This is NOT event recording related
 			viewp->logMouseEvent();
 			return viewp;
 		}
@@ -824,6 +849,7 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
 		if (viewp->handleHover(local_x, local_y, mask)
 			|| viewp->blockMouseEvent(local_x, local_y))
 		{
+			// This is NOT event recording related
 			viewp->logMouseEvent();
 			return viewp;
 		}
@@ -907,10 +933,11 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
 
 		if (!handled)
 		{
+			// For event logging we don't care which widget handles it
+			// So we capture the key at the end of this function once we know if it was handled
 			handled = handleKeyHere( key, mask );
-			if (handled && LLView::sDebugKeys)
-			{
-				llinfos << "Key handled by " << getName() << llendl;
+			if (handled) {
+				llwarns << "Key handled by " << getName() << llendl;
 			}
 		}
 	}
@@ -958,12 +985,17 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
 		handled = mParentView->handleUnicodeChar(uni_char, FALSE);
 	}
 
+	if (handled) {
+		LLViewerEventRecorder::instance().logKeyUnicodeEvent(uni_char);
+	}
+	
 	return handled;
 }
 
 
 BOOL LLView::handleUnicodeCharHere(llwchar uni_char )
 {
+	llwarns << "LLView::handleUnicodeCharHere - about to return false - key is not being handled - a class somewhere should implement this method" << llendl;
 	return FALSE;
 }
 
@@ -987,12 +1019,21 @@ BOOL LLView::hasMouseCapture()
 
 BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask)
 {
-	return childrenHandleMouseUp( x, y, mask ) != NULL;
+
+
+	LLView* r = childrenHandleMouseUp( x, y, mask );
+
+	return (r!=NULL);
+
 }
 
 BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask)
 {
-	return childrenHandleMouseDown( x, y, mask ) != NULL;
+
+	LLView* r= childrenHandleMouseDown(x, y, mask );
+
+	return (r!=NULL);
+
 }
 
 BOOL LLView::handleDoubleClick(S32 x, S32 y, MASK mask)
@@ -1065,7 +1106,7 @@ LLView* LLView::childrenHandleDoubleClick(S32 x, S32 y, MASK mask)
 
 LLView* LLView::childrenHandleMouseUp(S32 x, S32 y, MASK mask)
 {
-	return childrenHandleMouseEvent(&LLView::handleMouseUp, x, y, mask);
+	return	childrenHandleMouseEvent(&LLView::handleMouseUp, x, y, mask);
 }
 
 LLView* LLView::childrenHandleRightMouseUp(S32 x, S32 y, MASK mask)
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
new file mode 100644
index 0000000000..36df1f6ac1
--- /dev/null
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -0,0 +1,270 @@
+#include "llviewereventrecorder.h"
+#include "llui.h"
+#include "llleap.h"
+
+LLViewerEventRecorder::LLViewerEventRecorder() {
+
+  clear(UNDEFINED);
+
+  // Remove any previous event log file
+  std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old");
+  LLFile::remove(old_log_ui_events_to_llsd_file);
+  
+
+  mLogFilename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.llsd");
+  LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file);
+
+}
+
+
+bool LLViewerEventRecorder::displayViewerEventRecorderMenuItems() {
+  return LLUI::sSettingGroups["config"]->getBOOL("ShowEventRecorderMenuItems");
+}
+
+
+void LLViewerEventRecorder::setEventLoggingOn() {
+  if (! mLog.is_open()) {
+    mLog.open(mLogFilename, llofstream::out);
+  }
+  logEvents=true; 
+  lldebugs << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << llendl;
+}
+
+void LLViewerEventRecorder::setEventLoggingOff() {
+  logEvents=false;
+  mLog.flush();
+  mLog.close();
+  lldebugs << "LLViewerEventRecorder::setEventLoggingOff event logging turned off" << llendl;
+}
+
+
+ LLViewerEventRecorder::~LLViewerEventRecorder() {
+  if (mLog.is_open()) {
+      mLog.close();
+    }
+}
+
+void LLViewerEventRecorder::clear_xui() {
+  xui.clear();
+}
+
+void LLViewerEventRecorder::clear(S32 r) {
+
+  xui.clear();
+
+  local_x=r;
+  local_y=r;
+
+  global_x=r;
+  global_y=r;
+    
+
+}
+
+void LLViewerEventRecorder::setMouseLocalCoords(S32 x, S32 y) {
+  local_x=x;
+  local_y=y;
+}
+
+void LLViewerEventRecorder::setMouseGlobalCoords(S32 x, S32 y) {
+  global_x=x;
+  global_y=y;
+}
+
+void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 global_x, S32 global_y, std::string mName) {
+
+  LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), xui);
+  if (! target_view) {
+    lldebugs << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << llendl;
+    return;
+  }
+  lldebugs << "LLViewerEventRecorder::updateMouseEventInfo b4 updatemouseeventinfo - local_x|global x   "<< this->local_x << " " << this->global_x  << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << llendl;
+
+
+  if (this->local_x < 1 && this->local_y<1 && local_x && local_y) {
+    this->local_x=local_x;
+    this->local_y=local_y;
+  }
+  this->global_x=global_x;
+  this->global_y=global_y;
+
+  // ONLY record deepest xui path for hierarchy searches - or first/only xui for floaters/panels reached via mouse captor - and llmousehandler
+  if (mName!="" &&  mName!="/" && xui=="") { 
+    //	xui=std::string("/")+mName+xui; 
+    //xui=mName+xui; 
+    xui = mName; // TODO review confirm we never call with partial path - also cAN REMOVE CHECK FOR "" - ON OTHER HAND IT'S PRETTY HARMLESS
+  }
+
+  lldebugs << "LLViewerEventRecorder::updateMouseEventInfo after updatemouseeventinfo - local_x|global x   "<< this->local_x << " " << this->global_x  << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << llendl;
+}
+
+void LLViewerEventRecorder::logVisibilityChange(std::string xui, std::string name, BOOL visibility, std::string event_subtype) {
+
+  LLSD  event=LLSD::emptyMap();
+
+  event.insert("event",LLSD(std::string("visibility")));
+
+  if (visibility) {
+    event.insert("visibility",LLSD(true));
+  } else {
+    event.insert("visibility",LLSD(false));
+  }
+
+  if (event_subtype!="") {
+    event.insert("event_subtype", LLSD(event_subtype));
+  }
+
+  if(name!="") {
+    event.insert("name",LLSD(name));
+  }
+
+  if (xui!="") {
+    event.insert("path",LLSD(xui));
+  }
+
+  event.insert("timestamp",LLSD(LLDate::now().asString())); 
+  recordEvent(event);
+}
+
+
+std::string LLViewerEventRecorder::get_xui() {
+  return xui;
+}
+void LLViewerEventRecorder::update_xui(std::string xui) {
+  if (xui!="" && this->xui=="" ) {
+    lldebugs << "LLViewerEventRecorder::update_xui to " << xui << llendl;
+    this->xui=xui;
+  } else {
+    lldebugs << "LLViewerEventRecorder::update_xui called with empty string" << llendl;
+  }
+}
+
+void LLViewerEventRecorder::logKeyEvent(KEY key, MASK mask) {
+
+  // NOTE: Event recording only logs keydown events - the viewer itself hides keyup events at a fairly low level in the code and does not appear to care about them anywhere
+
+  LLSD event = LLSD::emptyMap();
+
+  event.insert("event",LLSD("type"));
+
+  // keysym ...or
+  // keycode...or
+  // char
+  event.insert("keysym",LLSD(LLKeyboard::stringFromKey(key)));
+
+  // path (optional) - for now we are not recording path for key events during record - should not be needed for full record and playback of recorded steps
+  // as a vita script - it does become useful if you edit the resulting vita script and wish to remove some steps leading to a key event - that sort of edit might
+  // break the test script and it would be useful to have more context to make these sorts of edits safer
+ 
+  // TODO  replace this with a call which extracts to an array of names of masks (just like vita expects during playback)
+  // This is looking more and more like an object is a good idea, for this part a handy method call to setMask(mask) would be nice :-)
+  // call the func - llkeyboard::llsdStringarrayFromMask
+
+  LLSD key_mask=LLSD::emptyArray();
+
+  if (mask & MASK_CONTROL)     { key_mask.append(LLSD("CTL")); }  // Mac command key - has code of 0x1  in llcommon/indra_contstants
+  if (mask & MASK_ALT)         { key_mask.append(LLSD("ALT")); }
+  if (mask & MASK_SHIFT)       { key_mask.append(LLSD("SHIFT")); }
+  if (mask & MASK_MAC_CONTROL) { key_mask.append(LLSD("MAC_CONTROL")); }
+
+  event.insert("mask",key_mask); 
+  event.insert("timestamp",LLSD(LLDate::now().asString())); 
+
+  // Although vita has keyDown and keyUp requests it does not have type as a high-level concept 
+  // (maybe it should) - instead it has a convenience method that generates the keydown and keyup events 
+  // Here  we will use  "type" as  our event type
+
+  lldebugs << "LLVIewerEventRecorder::logKeyEvent Serialized LLSD for event " << event.asString() << "\n" << llendl;
+
+
+  //lldebugs  << "[VITA] key_name: "  << LLKeyboard::stringFromKey(key) << "mask: "<< mask  << "handled by " << getName() << llendl;
+  lldebugs  << "LLVIewerEventRecorder::logKeyEvent  key_name: "  << LLKeyboard::stringFromKey(key) << "mask: "<< mask  << llendl;
+
+
+  recordEvent(event);
+
+}
+
+void LLViewerEventRecorder::playbackRecording() {
+
+  LLSD LeapCommand;
+
+  // ivita sets this on startup, it also sends commands to the viewer to make start, stop, and playback menu items visible in viewer
+  LeapCommand =LLUI::sSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand");
+  
+  lldebugs << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << llendl;
+  LLLeap::create("", LeapCommand, false); // exception=false
+  
+}
+
+
+void LLViewerEventRecorder::recordEvent(LLSD event) {
+  lldebugs << "LLViewerEventRecorder::recordEvent event written to log: " << LLSDXMLStreamer(event) << llendl;
+  mLog << event << std::endl;
+  
+}
+void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) {
+  if (! logEvents) return;
+
+  // Note: keyUp is not captured since the viewer seems to not care about keyUp events
+
+  LLSD event=LLSD::emptyMap();
+
+  event.insert("timestamp",LLSD(LLDate::now().asString()));
+
+  
+  // keysym ...or
+  // keycode...or
+  // char
+
+  lldebugs << "Wrapped in conversion to wstring " <<  wstring_to_utf8str(LLWString( 1, uni_char)) << "\n" << llendl;
+  
+  event.insert("char",
+	       LLSD(  wstring_to_utf8str(LLWString( 1,uni_char))  )
+	       ); 
+
+  // path (optional) - for now we are not recording path for key events during record - should not be needed for full record and playback of recorded steps
+  // as a vita script - it does become useful if you edit the resulting vita script and wish to remove some steps leading to a key event - that sort of edit might
+  // break the test script and it would be useful to have more context to make these sorts of edits safer
+
+  // TODO need to consider mask keys too? Doesn't seem possible - at least not easily at this point
+
+  event.insert("event",LLSD("keyDown")); 
+
+  lldebugs  << "[VITA] unicode key: " << uni_char   << llendl;
+  lldebugs  << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << llendl;
+
+
+  recordEvent(event);
+
+}
+
+void LLViewerEventRecorder::logMouseEvent(std::string button_state,std::string button_name)
+{
+  if (! logEvents) return; 
+
+  LLSD  event=LLSD::emptyMap();
+
+  event.insert("event",LLSD(std::string("mouse"+ button_state)));
+  event.insert("button",LLSD(button_name));
+  if (xui!="") {
+    event.insert("path",LLSD(xui));
+  }
+
+  if (local_x>0 && local_y>0) {
+    event.insert("local_x",LLSD(local_x));
+    event.insert("local_y",LLSD(local_y));
+  }
+
+  if (global_x>0 && global_y>0) {
+    event.insert("global_x",LLSD(global_x));
+    event.insert("global_y",LLSD(global_y));
+  }
+  event.insert("timestamp",LLSD(LLDate::now().asString())); 
+  recordEvent(event);
+
+
+  clear(UNDEFINED);
+   
+
+}
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
new file mode 100644
index 0000000000..190490b51f
--- /dev/null
+++ b/indra/llui/llviewereventrecorder.h
@@ -0,0 +1,78 @@
+#ifndef LL_VIEWER_EVENT_RECORDER
+#define LL_VIEWER_EVENT_RECORDER
+
+
+#include "linden_common.h" 
+
+#include "lldir.h" 
+#include "llsd.h"  
+#include "llfile.h"
+#include "llvfile.h"
+#include "lldate.h"
+#include "llsdserialize.h"
+#include "llkeyboard.h"
+#include "llstring.h"
+
+#include <sstream>
+
+#include "llsingleton.h" // includes llerror which we need here so we can skip the include here
+
+class LLViewerEventRecorder : public LLSingleton<LLViewerEventRecorder>
+{
+
+ public:
+
+  LLViewerEventRecorder(); // TODO Protect constructor better if we can (not happy in private section) - could add a factory... - we are singleton
+  ~LLViewerEventRecorder();
+
+
+  void updateMouseEventInfo(S32 local_x,S32 local_y, S32 global_x, S32 global_y,  std::string mName);
+  void setMouseLocalCoords(S32 x,S32 y);
+  void setMouseGlobalCoords(S32 x,S32 y);
+
+  void logMouseEvent(std::string button_state, std::string button_name );
+  void logKeyEvent(KEY key, MASK mask);
+  void logKeyUnicodeEvent(llwchar uni_char);
+
+  void logVisibilityChange(std::string xui, std::string name, BOOL visibility, std::string event_subtype);
+
+  void clear_xui();
+  std::string get_xui();
+  void update_xui(std::string xui);
+
+  bool getLoggingStatus();
+  void setEventLoggingOn();
+  void setEventLoggingOff();
+
+  void playbackRecording();
+
+  bool displayViewerEventRecorderMenuItems();
+
+
+ protected:
+  // On if we wish to log events at the moment - toggle via Develop/Recorder submenu
+  bool logEvents;
+
+  std::string mLogFilename;
+  llofstream  mLog; 
+
+
+ private:
+
+  // Mouse event info 
+  S32 global_x;
+  S32 global_y;
+  S32 local_x;
+  S32 local_y;
+
+  // XUI path of UI element
+  std::string xui;
+
+  // Actually write the event out to llsd log file
+  void recordEvent(LLSD event);
+
+  void clear(S32 r); 
+
+  static const S32 UNDEFINED=-1;
+};
+#endif
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 97637c937f..53c7b4ff24 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -2656,6 +2656,8 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
 			break;
 
 		case kEventWindowClose:
+			// Note on event recording - QUIT is a known special case and we are choosing NOT to record it for the record and playback feature 
+			// it is handled at a very low-level
 			if(mCallbacks->handleCloseRequest(this))
 			{
 				// Get the app to initiate cleanup.
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index 7ab7787d77..a6e93edc79 100755
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -164,6 +164,14 @@
       <string>UserLoginInfo</string>
     </map>
 
+    <key>logevents</key>
+    <map>
+      <key>desc</key>
+      <string>Log ui events for later playback</string>
+      <key>map-to</key>
+      <string>LogEvents</string>
+    </map>
+
     <key>logmetrics</key>
     <map>
       <key>desc</key>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 344079b640..54624e3f1d 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -4842,6 +4842,16 @@
       <key>Value</key>
       <array />
     </map>
+    <key>LeapPlaybackEventsCommand</key>
+    <map>
+      <key>Comment</key>
+      <string>Command line to use leap to launch playback of event recordings</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>LLSD</string>
+      <key>Value</key>
+    </map>
     <key>LSLFindCaseInsensitivity</key>
         <map>
         <key>Comment</key>
@@ -10105,6 +10115,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>ShowEventRecorderMenuItems</key>
+    <map>
+      <key>Comment</key>
+      <string>Whether or not Event Recorder menu choices - Start / Stop event recording should appear in the (currently) Develop menu</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>ShowGestureButton</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f92274dbbd..209e91d713 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -222,6 +222,10 @@
 #include "llmachineid.h"
 #include "llmainlooprepeater.h"
 
+
+#include "llviewereventrecorder.h"
+
+
 // *FIX: These extern globals should be cleaned up.
 // The globals either represent state/config/resource-storage of either 
 // this app, or another 'component' of the viewer. App globals should be 
@@ -696,6 +700,7 @@ LLAppViewer::LLAppViewer() :
 LLAppViewer::~LLAppViewer()
 {
 	delete mSettingsLocationList;
+	LLViewerEventRecorder::instance().~LLViewerEventRecorder();
 
 	LLLoginInstance::instance().setUpdaterService(0);
 	
@@ -2545,6 +2550,10 @@ bool LLAppViewer::initConfiguration()
         }
     }
 
+    if  (clp.hasOption("logevents")) {
+	LLViewerEventRecorder::instance().setEventLoggingOn();
+    }
+
     if(clp.hasOption("channel"))
     {
 		LLVersionInfo::resetChannel(clp.getOption("channel")[0]);
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index 4ecdc31e21..a8e82c6153 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -681,7 +681,10 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key,  MASK translated_mask, BOOL
 	{
 		// it is sufficient to set this value once per call to handlekey
 		// without clearing it, as it is only used in the subsequent call to scanKey
-		mKeyHandledByUI[translated_key] = gViewerWindow->handleKey(translated_key, translated_mask);
+		mKeyHandledByUI[translated_key] = gViewerWindow->handleKey(translated_key, translated_mask); 
+		// mKeyHandledByUI is not what you think ... this indicates whether the UI has handled this keypress yet (any keypress)
+		// NOT whether some UI shortcut wishes to handle the keypress
+	  
 	}
 	return mKeyHandledByUI[translated_key];
 }
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 5e2f05f468..7bde5d388e 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -40,6 +40,7 @@
 #include "llinventorypanel.h"
 #include "llnotifications.h"
 #include "llnotificationsutil.h"
+#include "llviewereventrecorder.h"
 
 // newview includes
 #include "llagent.h"
@@ -1950,6 +1951,43 @@ class LLAdvancedDropPacket : public view_listener_t
 };
 
 
+////////////////////
+// EVENT Recorder //
+///////////////////
+
+
+class LLAdvancedViewerEventRecorder : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		std::string command = userdata.asString();
+		if ("start playback" == command)
+		{
+			llinfos << "Event Playback starting" << llendl;
+			LLViewerEventRecorder::instance().playbackRecording();
+			llinfos << "Event Playback completed" << llendl;
+		}
+		else if ("stop playback" == command)
+		{
+			// Future
+		}
+		else if ("start recording" == command)
+		{
+			LLViewerEventRecorder::instance().setEventLoggingOn();
+			llinfos << "Event recording started" << llendl;
+		}
+		else if ("stop recording" == command)
+		{
+			LLViewerEventRecorder::instance().setEventLoggingOff();
+			llinfos << "Event recording stopped" << llendl;
+		} 
+
+		return true;
+	}		
+};
+
+
+
 
 /////////////////
 // AGENT PILOT //
@@ -8320,6 +8358,8 @@ void initialize_menus()
 	// Don't prepend MenuName.Foo because these can be used in any menu.
 	enable.add("IsGodCustomerService", boost::bind(&is_god_customer_service));
 
+	enable.add("displayViewerEventRecorderMenuItems",boost::bind(&LLViewerEventRecorder::displayViewerEventRecorderMenuItems,&LLViewerEventRecorder::instance()));
+
 	view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts");
 
 	enable.add("Conversation.IsConversationLoggingAllowed", boost::bind(&LLFloaterIMContainer::isConversationLoggingAllowed));
@@ -8578,6 +8618,7 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedAgentPilot(), "Advanced.AgentPilot");
 	view_listener_t::addMenu(new LLAdvancedToggleAgentPilotLoop(), "Advanced.ToggleAgentPilotLoop");
 	view_listener_t::addMenu(new LLAdvancedCheckAgentPilotLoop(), "Advanced.CheckAgentPilotLoop");
+	view_listener_t::addMenu(new LLAdvancedViewerEventRecorder(), "Advanced.EventRecorder");
 
 	// Advanced > Debugging
 	view_listener_t::addMenu(new LLAdvancedForceErrorBreakpoint(), "Advanced.ForceErrorBreakpoint");
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 65a906d3c0..3f2ff7eb82 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -197,6 +197,8 @@
 #include "llagentui.h"
 #include "llwearablelist.h"
 
+#include "llviewereventrecorder.h"
+
 #include "llnotifications.h"
 #include "llnotificationsutil.h"
 #include "llnotificationmanager.h"
@@ -914,27 +916,18 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window,  LLCoordGL pos, MASK
 			{
 				llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl;
 			}
-			return mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down);
-		}
 
-		// Topmost view gets a chance before the hierarchy
-		//LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
-		//if (top_ctrl)
-		//{
-		//	S32 local_x, local_y;
-		//	top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
-		//		if (top_ctrl->pointInView(local_x, local_y))
-		//		{
-		//			return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down)	;
-		//		}
-		//		else
-		//		{
-		//		if (down)
-		//		{
-		//			gFocusMgr.setTopCtrl(NULL);
-		//		}
-		//	}
-		//}
+			BOOL r = mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); 
+			if (r) {
+
+				lldebugs << "LLViewerWindow::handleAnyMouseClick viewer with mousecaptor calling updatemouseeventinfo - local_x|global x  "<< local_x << " " << x  << "local/global y " << local_y << " " << y << llendl;
+
+				LLViewerEventRecorder::instance().setMouseGlobalCoords(x,y);
+				LLViewerEventRecorder::instance().logMouseEvent(std::string(buttonstatestr),std::string(buttonname)); 
+
+			}
+			return r;
+		}
 
 		// Mark the click as handled and return if we aren't within the root view to avoid spurious bugs
 		if( !mRootView->pointInView(x, y) )
@@ -942,27 +935,44 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window,  LLCoordGL pos, MASK
 			return TRUE;
 		}
 		// Give the UI views a chance to process the click
-		if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) )
+
+		BOOL r= mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ;
+		if (r) 
 		{
+
+			lldebugs << "LLViewerWindow::handleAnyMouseClick calling updatemouseeventinfo - global x  "<< " " << x	<< "global y " << y	 << "buttonstate: " << buttonstatestr << " buttonname " << buttonname << llendl;
+
+			LLViewerEventRecorder::instance().setMouseGlobalCoords(x,y);
+
+			// Clear local coords - this was a click on root window so these are not needed
+			// By not including them, this allows the test skeleton generation tool to be smarter when generating code
+			// the code generator can be smarter because when local coords are present it can try the xui path with local coords
+			// and fallback to global coordinates only if needed. 
+			// The drawback to this approach is sometimes a valid xui path will appear to work fine, but NOT interact with the UI element
+			// (VITA support not implemented yet or not visible to VITA due to widget further up xui path not being visible to VITA)
+			// For this reason it's best to provide hints where possible here by leaving out local coordinates
+			LLViewerEventRecorder::instance().setMouseLocalCoords(-1,-1);
+			LLViewerEventRecorder::instance().logMouseEvent(buttonstatestr,buttonname); 
+
 			if (LLView::sDebugMouseHandling)
 			{
-				llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << llendl;
-			}
+				llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLViewerEventRecorder::instance().get_xui()	<< llendl;
+			} 
 			return TRUE;
-		}
-		else if (LLView::sDebugMouseHandling)
-		{
-			llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl;
-		}
+		} else if (LLView::sDebugMouseHandling)
+			{
+				llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl;
+			}
 	}
 
 	// Do not allow tool manager to handle mouseclicks if we have disconnected	
 	if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) )
 	{
+		LLViewerEventRecorder::instance().clear_xui(); 
 		return TRUE;
 	}
-	
 
+	
 	// If we got this far on a down-click, it wasn't handled.
 	// Up-clicks, though, are always handled as far as the OS is concerned.
 	BOOL default_rtn = !down;
@@ -1333,7 +1343,8 @@ BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key,  MASK mask)
 void LLViewerWindow::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level)
 {
 	LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
-	return gViewerKeyboard.scanKey(key, key_down, key_up, key_level);
+	gViewerKeyboard.scanKey(key, key_down, key_up, key_level);
+	return; // Be clear this function returns nothing
 }
 
 
@@ -2477,6 +2488,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 		||(gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE))
 		||(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE)))
 	{
+		lldebugs << "LLviewerWindow::handleKey handle nav keys for nav" << llendl;
+		LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 		return TRUE;
 	}
 
@@ -2491,12 +2504,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 			&& keyboard_focus 
 			&& keyboard_focus->handleKey(key,mask,FALSE))
 		{
+			LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 			return TRUE;
 		}
 
 		if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask))
 			||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)))
 		{
+			LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 			return TRUE;
 		}
 	}
@@ -2506,6 +2521,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 	// if nothing has focus, go to first or last UI element as appropriate
 	if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL))
 	{
+		llwarns << "LLviewerWindow::handleKey give floaters first chance at tab key " << llendl;
 		if (gMenuHolder) gMenuHolder->hideMenus();
 
 		// if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode
@@ -2520,11 +2536,13 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 		{
 			mRootView->focusNextRoot();
 		}
+		LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 		return TRUE;
 	}
 	// hidden edit menu for cut/copy/paste
 	if (gEditMenu && gEditMenu->handleAcceleratorKey(key, mask))
 	{
+		LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 		return TRUE;
 	}
 
@@ -2564,18 +2582,27 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 
 		if (keyboard_focus->handleKey(key, mask, FALSE))
 		{
+
+			lldebugs << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned true" << llendl;
+			LLViewerEventRecorder::instance().logKeyEvent(key,mask); 
 			return TRUE;
+		} else {
+			lldebugs << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned FALSE" << llendl;
 		}
 	}
 
 	if( LLToolMgr::getInstance()->getCurrentTool()->handleKey(key, mask) )
 	{
+		lldebugs << "LLviewerWindow::handleKey toolbar handling?" << llendl;
+		LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 		return TRUE;
 	}
 
 	// Try for a new-format gesture
 	if (LLGestureMgr::instance().triggerGesture(key, mask))
 	{
+		lldebugs << "LLviewerWindow::handleKey new gesture feature" << llendl;
+		LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 		return TRUE;
 	}
 
@@ -2583,6 +2610,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 	// don't pass it down to the menus.
 	if (gGestureList.trigger(key, mask))
 	{
+		lldebugs << "LLviewerWindow::handleKey check gesture trigger" << llendl;
+		LLViewerEventRecorder::instance().logKeyEvent(key,mask);
 		return TRUE;
 	}
 
@@ -2631,7 +2660,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
 	// HACK: Numeric keypad <enter> on Mac is Unicode 3
 	// HACK: Control-M on Windows is Unicode 13
 	if ((uni_char == 13 && mask != MASK_CONTROL)
-		|| (uni_char == 3 && mask == MASK_NONE))
+	    || (uni_char == 3 && mask == MASK_NONE) )
 	{
 		if (mask != MASK_ALT)
 		{
@@ -2654,14 +2683,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
 			return TRUE;
 		}
 
-		//// Topmost view gets a chance before the hierarchy
-		//LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
-		//if (top_ctrl && top_ctrl->handleUnicodeChar( uni_char, FALSE ) )
-		//{
-		//	return TRUE;
-		//}
-
-		return TRUE;
+        return TRUE;
 	}
 
 	return FALSE;
@@ -2670,8 +2692,6 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
 
 void LLViewerWindow::handleScrollWheel(S32 clicks)
 {
-	LLView::sMouseHandlerMessage.clear();
-
 	LLUI::resetMouseIdleTimer();
 	
 	LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture();
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index 28f959eb71..a8e06511d7 100755
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -265,7 +265,9 @@ void LLWindowListener::getPaths(LLSD const & request)
 void LLWindowListener::keyDown(LLSD const & evt)
 {
 	Response response(LLSD(), evt);
-	
+	KEY key = getKEY(evt);
+	MASK mask = getMask(evt);
+
 	if (evt.has("path"))
 	{
 		std::string path(evt["path"]);
@@ -280,8 +282,6 @@ void LLWindowListener::keyDown(LLSD const & evt)
 			response.setResponse(target_view->getInfo());
 			
 			gFocusMgr.setKeyboardFocus(target_view);
-			KEY key = getKEY(evt);
-			MASK mask = getMask(evt);
 			gViewerKeyboard.handleKey(key, mask, false);
 			if(key < 0x80) mWindow->handleUnicodeChar(key, mask);
 		}
@@ -294,7 +294,8 @@ void LLWindowListener::keyDown(LLSD const & evt)
 	}
 	else 
 	{
-		mKbGetter()->handleTranslatedKeyDown(getKEY(evt), getMask(evt));
+		gViewerKeyboard.handleKey(key, mask, false); 
+		if(key < 0x80) mWindow->handleUnicodeChar(key, mask);
 	}
 }
 
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index b01c3067ff..b71faa2d3e 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2919,6 +2919,34 @@
          label="Recorder"
          name="Recorder"
          tear_off="true">
+            <menu_item_call visible="false"
+             label="Start event recording"
+             name="Start event recording">
+	      <menu_item_call.on_visible
+		 function="displayViewerEventRecorderMenuItems" />
+                <menu_item_call.on_click
+                 function="Advanced.EventRecorder"
+                 parameter="start recording" />
+            </menu_item_call>
+            <menu_item_call visible="false"
+             label="Stop event recording"
+             name="Stop event recording">
+	      <menu_item_call.on_visible
+		 function="displayViewerEventRecorderMenuItems" />
+                <menu_item_call.on_click
+                 function="Advanced.EventRecorder"
+                 parameter="stop recording" />
+            </menu_item_call>
+            <menu_item_call visible="false"
+             label="Playback event recording"
+             name="Playback event recording">
+	      <menu_item_call.on_visible
+		 function="displayViewerEventRecorderMenuItems" />
+                <menu_item_call.on_click
+                 function="Advanced.EventRecorder"
+                 parameter="start playback" />
+            </menu_item_call>
+
             <menu_item_call
              label="Start Playback"
              name="Start Playback">
-- 
cgit v1.2.3


From 24db277777d9bf05ad1ff3ade32e15ab5fade870 Mon Sep 17 00:00:00 2001
From: "Jeff (Gioffredo Linden)" <gioffredo@lindenlab.com>
Date: Thu, 25 Jul 2013 16:11:26 -0400
Subject: Restore VITA LLNotiication API

---
 indra/llui/CMakeLists.txt              |   2 +
 indra/llui/llnotifications.cpp         |   1 +
 indra/llui/llnotifications.h           |   4 +
 indra/llui/llnotificationslistener.cpp | 359 +++++++++++++++++++++++++++++++++
 indra/llui/llnotificationslistener.h   |  69 +++++++
 5 files changed, 435 insertions(+)
 create mode 100644 indra/llui/llnotificationslistener.cpp
 create mode 100644 indra/llui/llnotificationslistener.h

diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index aa6684e7a8..589ceac501 100755
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -75,6 +75,7 @@ set(llui_SOURCE_FILES
     llmultislider.cpp
     llmultisliderctrl.cpp
     llnotifications.cpp
+    llnotificationslistener.cpp
     llnotificationsutil.cpp
     llpanel.cpp
     llprogressbar.cpp
@@ -184,6 +185,7 @@ set(llui_HEADER_FILES
     llmultislider.h
     llnotificationptr.h
     llnotifications.h
+    llnotificationslistener.h
     llnotificationsutil.h
     llnotificationtemplate.h
     llnotificationvisibilityrule.h
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 1789f003b9..743d34c57b 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1206,6 +1206,7 @@ LLNotifications::LLNotifications()
 :	LLNotificationChannelBase(LLNotificationFilters::includeEverything),
 	mIgnoreAllNotifications(false)
 {
+        mListener.reset(new LLNotificationsListener(*this));
 	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2));
 }
 
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 87573c2a56..9037712cc8 100755
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -98,6 +98,8 @@
 #include "llrefcount.h"
 #include "llsdparam.h"
 
+#include "llnotificationslistener.h"
+
 class LLAvatarName;
 typedef enum e_notification_priority
 {
@@ -970,6 +972,8 @@ private:
 
 	bool mIgnoreAllNotifications;
 
+	boost::scoped_ptr<LLNotificationsListener> mListener;
+
 	std::vector<LLNotificationChannelPtr> mDefaultChannels;
 };
 
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
new file mode 100644
index 0000000000..9e8e943ee6
--- /dev/null
+++ b/indra/llui/llnotificationslistener.cpp
@@ -0,0 +1,359 @@
+/**
+ * @file   llnotificationslistener.cpp
+ * @author Brad Kittenbrink
+ * @date   2009-07-08
+ * @brief  Implementation for llnotificationslistener.
+ * 
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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 "linden_common.h"
+#include "llnotificationslistener.h"
+#include "llnotifications.h"
+#include "llnotificationtemplate.h"
+#include "llsd.h"
+#include "llui.h"
+
+LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
+    LLEventAPI("LLNotifications",
+               "LLNotifications listener to (e.g.) pop up a notification"),
+    mNotifications(notifications)
+{
+    add("requestAdd",
+        "Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n"
+        "If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.",
+        &LLNotificationsListener::requestAdd);
+    /*    add("listChannels",
+        "Post to [\"reply\"] a map of info on existing channels",
+        &LLNotificationsListener::listChannels,
+        LLSD().with("reply", LLSD()));
+    */
+    add("listChannelNotifications",
+        "Post to [\"reply\"] an array of info on notifications in channel [\"channel\"]",
+        &LLNotificationsListener::listChannelNotifications,
+        LLSD().with("reply", LLSD()).with("channel", LLSD()));
+    add("respond",
+        "Respond to notification [\"uuid\"] with data in [\"response\"]",
+        &LLNotificationsListener::respond,
+        LLSD().with("uuid", LLSD()));
+    add("cancel",
+        "Cancel notification [\"uuid\"]",
+        &LLNotificationsListener::cancel,
+        LLSD().with("uuid", LLSD()));
+    add("ignore",
+        "Ignore future notification [\"name\"]\n"
+        "(from <notification name= > in notifications.xml)\n"
+        "according to boolean [\"ignore\"].\n"
+        "If [\"name\"] is omitted or undefined, [un]ignore all future notifications.\n"
+        "Note that ignored notifications are not forwarded unless intercepted before\n"
+        "the \"Ignore\" channel.",
+        &LLNotificationsListener::ignore);
+    add("forward",
+        "Forward to [\"pump\"] future notifications on channel [\"channel\"]\n"
+        "according to boolean [\"forward\"]. When enabled, only types matching\n"
+        "[\"types\"] are forwarded, as follows:\n"
+        "omitted or undefined: forward all notifications\n"
+        "string: forward only the specific named [sig]type\n"
+        "array of string: forward any notification matching any named [sig]type.\n"
+        "When boolean [\"respond\"] is true, we auto-respond to each forwarded\n"
+        "notification.",
+        &LLNotificationsListener::forward,
+        LLSD().with("channel", LLSD()));
+}
+
+// This is here in the .cpp file so we don't need the definition of class
+// Forwarder in the header file.
+LLNotificationsListener::~LLNotificationsListener()
+{
+}
+
+void LLNotificationsListener::requestAdd(const LLSD& event_data) const
+{
+	if(event_data.has("reply"))
+	{
+		mNotifications.add(event_data["name"], 
+						   event_data["substitutions"], 
+						   event_data["payload"],
+						   boost::bind(&LLNotificationsListener::NotificationResponder, 
+									   this, 
+									   event_data["reply"].asString(), 
+									   _1, _2
+									   )
+						   );
+	}
+	else
+	{
+		mNotifications.add(event_data["name"], 
+						   event_data["substitutions"], 
+						   event_data["payload"]);
+	}
+}
+
+void LLNotificationsListener::NotificationResponder(const std::string& reply_pump, 
+										const LLSD& notification, 
+										const LLSD& response) const
+{
+	LLSD reponse_event;
+	reponse_event["notification"] = notification;
+	reponse_event["response"] = response;
+	LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event);
+}
+/*
+void LLNotificationsListener::listChannels(const LLSD& params) const
+{
+    LLReqID reqID(params);
+    LLSD response(reqID.makeResponse());
+    for (LLNotifications::
+
+
+
+    for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
+                                                     cmend(mNotifications.mChannels.end());
+         cmi != cmend; ++cmi)
+    {
+        LLSD channelInfo;
+        channelInfo["parent"] = cmi->second->getParentChannelName();
+        response[cmi->first] = channelInfo;
+    }
+    LLEventPumps::instance().obtain(params["reply"]).post(response);
+}
+*/
+void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
+{
+    LLReqID reqID(params);
+    LLSD response(reqID.makeResponse());
+    LLNotificationChannelPtr channel(mNotifications.getChannel(params["channel"]));
+    if (channel)
+    {
+        LLSD notifications(LLSD::emptyArray());
+        for (LLNotificationChannel::Iterator ni(channel->begin()), nend(channel->end());
+             ni != nend; ++ni)
+        {
+            notifications.append(asLLSD(*ni));
+        }
+        response["notifications"] = notifications;
+    }
+    LLEventPumps::instance().obtain(params["reply"]).post(response);
+}
+
+void LLNotificationsListener::respond(const LLSD& params) const
+{
+    LLNotificationPtr notification(mNotifications.find(params["uuid"]));
+    if (notification)
+    {
+        notification->respond(params["response"]);
+    }
+}
+
+void LLNotificationsListener::cancel(const LLSD& params) const
+{
+    LLNotificationPtr notification(mNotifications.find(params["uuid"]));
+    if (notification)
+    {
+        mNotifications.cancel(notification);
+    }
+}
+
+void LLNotificationsListener::ignore(const LLSD& params) const
+{
+    // Calling a method named "ignore", but omitting its "ignore" Boolean
+    // argument, should by default cause something to be ignored. Explicitly
+    // pass ["ignore"] = false to cancel ignore.
+    bool ignore = true;
+    if (params.has("ignore"))
+    {
+        ignore = params["ignore"].asBoolean();
+    }
+    // This method can be used to affect either a single notification name or
+    // all future notifications. The two use substantially different mechanisms.
+    if (params["name"].isDefined())
+    {
+        // ["name"] was passed: ignore just that notification
+		LLNotificationTemplatePtr templatep = mNotifications.getTemplate(params["name"]);
+		if (templatep)
+		{
+			templatep->mForm->setIgnored(ignore);
+		}
+    }
+    else
+    {
+        // no ["name"]: ignore all future notifications
+        mNotifications.setIgnoreAllNotifications(ignore);
+    }
+}
+
+class LLNotificationsListener::Forwarder: public LLEventTrackable
+{
+    LOG_CLASS(LLNotificationsListener::Forwarder);
+public:
+    Forwarder(LLNotifications& llnotifications, const std::string& channel):
+        mNotifications(llnotifications),
+        mRespond(false)
+    {
+        // Connect to the specified channel on construction. Because
+        // LLEventTrackable is a base, we should automatically disconnect when
+        // destroyed.
+        LLNotificationChannelPtr channelptr(llnotifications.getChannel(channel));
+        if (channelptr)
+        {
+            // Insert our processing as a "passed filter" listener. This way
+            // we get to run before all the "changed" listeners, and we get to
+            // swipe it (hide it from the other listeners) if desired.
+            channelptr->connectPassedFilter(boost::bind(&Forwarder::handle, this, _1));
+        }
+    }
+
+    void setPumpName(const std::string& name) { mPumpName = name; }
+    void setTypes(const LLSD& types) { mTypes = types; }
+    void setRespond(bool respond) { mRespond = respond; }
+
+private:
+    bool handle(const LLSD& notification) const;
+    bool matchType(const LLSD& filter, const std::string& type) const;
+
+    LLNotifications& mNotifications;
+    std::string mPumpName;
+    LLSD mTypes;
+    bool mRespond;
+};
+
+void LLNotificationsListener::forward(const LLSD& params)
+{
+    std::string channel(params["channel"]);
+    // First decide whether we're supposed to start forwarding or stop it.
+    // Default to true.
+    bool forward = true;
+    if (params.has("forward"))
+    {
+        forward = params["forward"].asBoolean();
+    }
+    if (! forward)
+    {
+        // This is a request to stop forwarding notifications on the specified
+        // channel. The rest of the params don't matter.
+        // Because mForwarders contains scoped_ptrs, erasing the map entry
+        // DOES delete the heap Forwarder object. Because Forwarder derives
+        // from LLEventTrackable, destroying it disconnects it from the
+        // channel.
+        mForwarders.erase(channel);
+        return;
+    }
+    // From here on, we know we're being asked to start (or modify) forwarding
+    // on the specified channel. Find or create an appropriate Forwarder.
+    ForwarderMap::iterator
+        entry(mForwarders.insert(ForwarderMap::value_type(channel, ForwarderMap::mapped_type())).first);
+    if (! entry->second)
+    {
+        entry->second.reset(new Forwarder(mNotifications, channel));
+    }
+    // Now, whether this Forwarder is brand-new or not, update it with the new
+    // request info.
+    Forwarder& fwd(*entry->second);
+    fwd.setPumpName(params["pump"]);
+    fwd.setTypes(params["types"]);
+    fwd.setRespond(params["respond"]);
+}
+
+bool LLNotificationsListener::Forwarder::handle(const LLSD& notification) const
+{
+    LL_INFOS("LLNotificationsListener") << "handle(" << notification << ")" << LL_ENDL;
+    if (notification["sigtype"].asString() == "delete")
+    {
+        LL_INFOS("LLNotificationsListener") << "ignoring delete" << LL_ENDL;
+        // let other listeners see the "delete" operation
+        return false;
+    }
+    LLNotificationPtr note(mNotifications.find(notification["id"]));
+    if (! note)
+    {
+        LL_INFOS("LLNotificationsListener") << notification["id"] << " not found" << LL_ENDL;
+        return false;
+    }
+    if (! matchType(mTypes, note->getType()))
+    {
+        LL_INFOS("LLNotificationsListener") << "didn't match types " << mTypes << LL_ENDL;
+        // We're not supposed to intercept this particular notification. Let
+        // other listeners process it.
+        return false;
+    }
+    LL_INFOS("LLNotificationsListener") << "sending via '" << mPumpName << "'" << LL_ENDL;
+    // This is a notification we care about. Forward it through specified
+    // LLEventPump.
+    LLEventPumps::instance().obtain(mPumpName).post(asLLSD(note));
+    // Are we also being asked to auto-respond?
+    if (mRespond)
+    {
+        LL_INFOS("LLNotificationsListener") << "should respond" << LL_ENDL;
+        note->respond(LLSD::emptyMap());
+        // Did that succeed in removing the notification? Only cancel() if
+        // it's still around -- otherwise we get an LL_ERRS crash!
+        note = mNotifications.find(notification["id"]);
+        if (note)
+        {
+            LL_INFOS("LLNotificationsListener") << "respond() didn't clear, canceling" << LL_ENDL;
+            mNotifications.cancel(note);
+        }
+    }
+    // If we've auto-responded to this notification, then it's going to be
+    // deleted. Other listeners would get the change operation, try to look it
+    // up and be baffled by lookup failure. So when we auto-respond, suppress
+    // this notification: don't pass it to other listeners.
+    return mRespond;
+}
+
+bool LLNotificationsListener::Forwarder::matchType(const LLSD& filter, const std::string& type) const
+{
+    // Decide whether this notification matches filter:
+    // undefined: forward all notifications
+    if (filter.isUndefined())
+    {
+        return true;
+    }
+    // array of string: forward any notification matching any named type
+    if (filter.isArray())
+    {
+        for (LLSD::array_const_iterator ti(filter.beginArray()), tend(filter.endArray());
+             ti != tend; ++ti)
+        {
+            if (ti->asString() == type)
+            {
+                return true;
+            }
+        }
+        // Didn't match any entry in the array
+        return false;
+    }
+    // string: forward only the specific named type
+    return (filter.asString() == type);
+}
+
+LLSD LLNotificationsListener::asLLSD(LLNotificationPtr note)
+{
+    LLSD notificationInfo(note->asLLSD());
+    // For some reason the following aren't included in LLNotification::asLLSD().
+    notificationInfo["summary"] = note->summarize();
+    notificationInfo["id"]      = note->id();
+    notificationInfo["type"]    = note->getType();
+    notificationInfo["message"] = note->getMessage();
+    notificationInfo["label"]   = note->getLabel();
+    return notificationInfo;
+}
diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h
new file mode 100644
index 0000000000..f9f7641de6
--- /dev/null
+++ b/indra/llui/llnotificationslistener.h
@@ -0,0 +1,69 @@
+/**
+ * @file   llnotificationslistener.h
+ * @author Brad Kittenbrink
+ * @date   2009-07-08
+ * @brief  Wrap subset of LLNotifications API in event API for test scripts.
+ * 
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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_LLNOTIFICATIONSLISTENER_H
+#define LL_LLNOTIFICATIONSLISTENER_H
+
+#include "lleventapi.h"
+#include "llnotificationptr.h"
+#include <boost/shared_ptr.hpp>
+#include <map>
+#include <string>
+
+class LLNotifications;
+class LLSD;
+
+class LLNotificationsListener : public LLEventAPI
+{
+public:
+    LLNotificationsListener(LLNotifications & notifications);
+    ~LLNotificationsListener();
+
+private:
+    void requestAdd(LLSD const & event_data) const;
+
+	void NotificationResponder(const std::string& replypump, 
+							   const LLSD& notification, 
+							   const LLSD& response) const;
+
+    void listChannels(const LLSD& params) const;
+    void listChannelNotifications(const LLSD& params) const;
+    void respond(const LLSD& params) const;
+    void cancel(const LLSD& params) const;
+    void ignore(const LLSD& params) const;
+    void forward(const LLSD& params);
+
+    static LLSD asLLSD(LLNotificationPtr);
+
+    class Forwarder;
+    typedef std::map<std::string, boost::shared_ptr<Forwarder> > ForwarderMap;
+    ForwarderMap mForwarders;
+	LLNotifications & mNotifications;
+};
+
+#endif // LL_LLNOTIFICATIONSLISTENER_H
-- 
cgit v1.2.3


From 0254b74abfeadb1dea8b37435288512887baff0d Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 25 Jul 2013 16:04:58 -0700
Subject: ACME-773 Remove the 'Use another account...' in the ACCOUNT panel

---
 indra/newview/llfacebookconnect.cpp                | 39 ----------------------
 indra/newview/llfacebookconnect.h                  |  1 -
 indra/newview/llfloatersocial.cpp                  | 16 ++++-----
 indra/newview/llfloatersocial.h                    |  1 -
 .../skins/default/xui/en/panel_social_account.xml  | 12 -------
 5 files changed, 6 insertions(+), 63 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 486195a483..8c75d0efc6 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -250,40 +250,6 @@ private:
 	bool mAutoConnect;
 };
 
-///////////////////////////////////////////////////////////////////////////////
-//
-class LLFacebookDisconnectThenConnectResponder : public LLHTTPClient::Responder
-{
-	LOG_CLASS(LLFacebookDisconnectThenConnectResponder);
-public:
-
-	LLFacebookDisconnectThenConnectResponder()
-	{
-		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
-	}
-
-	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
-	{
-		if (isGoodStatus(status))
-		{
-			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
-
-			// Clear all facebook stuff
-			LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
-			LLFacebookConnect::instance().clearContent();
-
-			LLViewerMedia::clearAllCookies();
-
-			//Now attempt to reconnect
-			LLFacebookConnect::instance().checkConnectionToFacebook(true);
-		}
-		else
-		{
-			log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
-		}
-	}
-};
-
 ///////////////////////////////////////////////////////////////////////////////
 //
 class LLFacebookInfoResponder : public LLHTTPClient::Responder
@@ -401,11 +367,6 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
     }
 }
 
-void LLFacebookConnect::disconnectThenConnectToFacebook()
-{
-	LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectThenConnectResponder());
-}
-
 void LLFacebookConnect::loadFacebookInfo()
 {
 	const bool follow_redirects = false;
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index f74b9f7d41..be3028e3a0 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -58,7 +58,6 @@ public:
 	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 disconnectThenConnectToFacebook();																// Disconnects and then connects (for switching FB accounts)
     
 	void loadFacebookInfo();
     void loadFacebookFriends();
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 3c8d4d6fb9..129934ae16 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -44,6 +44,7 @@
 #include "llsnapshotlivepreview.h"
 #include "llviewerregion.h"
 #include "llviewercontrol.h"
+#include "llviewermedia.h"
 
 static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel");
 static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
@@ -619,11 +620,9 @@ mAccountCaptionLabel(NULL),
 mAccountNameLabel(NULL),
 mPanelButtons(NULL),
 mConnectButton(NULL),
-mUseAnotherAccountButton(NULL),
 mDisconnectButton(NULL)
 {
 	mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this));
-	mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this));
 	mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this));
 
 	setVisibleCallback(boost::bind(&LLSocialAccountPanel::onVisibilityChange, this, _2));
@@ -635,7 +634,6 @@ BOOL LLSocialAccountPanel::postBuild()
 	mAccountNameLabel = getChild<LLTextBox>("account_name_label");
 	mPanelButtons = getChild<LLUICtrl>("panel_buttons");
 	mConnectButton = getChild<LLUICtrl>("connect_btn");
-	mUseAnotherAccountButton = getChild<LLUICtrl>("use_another_account_btn");
 	mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
 
 	return LLPanel::postBuild();
@@ -648,7 +646,6 @@ void LLSocialAccountPanel::draw()
 	//Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
 	bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING;
 	mDisconnectButton->setEnabled(!disconnecting);
-	mUseAnotherAccountButton->setEnabled(!disconnecting);
 
 	//Disable the 'connect' button when a connection is in progress
 	bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
@@ -669,10 +666,12 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 		LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel");
 		LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this));
 
+		//Connected
 		if(LLFacebookConnect::instance().isConnected())
 		{
 			showConnectedLayout();
 		}
+		//Check if connected (show disconnected layout in meantime)
 		else
 		{
 			showDisconnectedLayout();
@@ -712,6 +711,7 @@ bool LLSocialAccountPanel::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() + "]";
@@ -727,7 +727,6 @@ void LLSocialAccountPanel::showConnectButton()
 	if(!mConnectButton->getVisible())
 	{
 		mConnectButton->setVisible(TRUE);
-		mUseAnotherAccountButton->setVisible(FALSE);
 		mDisconnectButton->setVisible(FALSE);
 	}
 }
@@ -737,7 +736,6 @@ void LLSocialAccountPanel::hideConnectButton()
 	if(mConnectButton->getVisible())
 	{
 		mConnectButton->setVisible(FALSE);
-		mUseAnotherAccountButton->setVisible(TRUE);
 		mDisconnectButton->setVisible(TRUE);
 	}
 }
@@ -760,11 +758,9 @@ void LLSocialAccountPanel::showConnectedLayout()
 void LLSocialAccountPanel::onConnect()
 {
 	LLFacebookConnect::instance().checkConnectionToFacebook(true);
-}
 
-void LLSocialAccountPanel::onUseAnotherAccount()
-{
-	LLFacebookConnect::instance().disconnectThenConnectToFacebook();
+	//Clears browser cookies so that the user must enter their FB creds when connecting/re-connecting
+	LLViewerMedia::clearAllCookies();
 }
 
 void LLSocialAccountPanel::onDisconnect()
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 13c29e7028..e7ad9ac12e 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -139,7 +139,6 @@ private:
 	LLTextBox * mAccountNameLabel;
 	LLUICtrl * mPanelButtons;
 	LLUICtrl * mConnectButton;
-	LLUICtrl * mUseAnotherAccountButton;
 	LLUICtrl * mDisconnectButton;
 };
 
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 7bd3bb191e..5855eeed59 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -54,18 +54,6 @@
    follows="left|top"
    top_delta="0"
    height="23"
-   label="Use another account..."
-   name="use_another_account_btn"
-   width="210"
-   visible="false">
-    <commit_callback function="SocialSharing.UseAnotherAccount"/>
-  </button>
-
-  <button
-   layout="topleft"
-   follows="left|top"
-   top_pad="11"
-   height="23"
    label="Disconnect"
    name="disconnect_btn"
    width="210"
-- 
cgit v1.2.3


From 56038ded5192cfae5217ae6eae7480923b9298e5 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 25 Jul 2013 19:35:10 -0700
Subject: ACME-745 : Fix : Do not oversanitize the logged URLs...

---
 indra/newview/llviewermedia.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 6453e2348f..13483790ed 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2003,7 +2003,8 @@ void LLViewerMediaImpl::loadURI()
         {
             // Do not log the query parts
             LLURI u(uri);
-            llinfos << "Asking media source to load URI: " << u.scheme() << "://" << u.authority() << u.path() << llendl;
+            std::string sanitized_uri = (u.query().empty() ? uri : u.scheme() + "://" + u.authority() + u.path());
+            llinfos << "Asking media source to load URI: " << sanitized_uri << llendl;
         }
 		
 		mMediaSource->loadURI( uri );
@@ -2574,7 +2575,8 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
         {
             // Do not log the query parts
             LLURI u(url);
-            llinfos << "NOT LOADING media id= " << mTextureId << " url=" << u.scheme() << "://" << u.authority() << u.path() << " mime_type=" << mime_type << llendl;
+            std::string sanitized_url = (u.query().empty() ? url : u.scheme() + "://" + u.authority() + u.path());
+            llinfos << "NOT LOADING media id= " << mTextureId << " url=" << sanitized_url << ", mime_type=" << mime_type << llendl;
         }
 
 		// This impl should not be loaded at this time.
@@ -2593,7 +2595,8 @@ void LLViewerMediaImpl::navigateInternal()
     {
         // Do not log the query parts
         LLURI u(mMediaURL);
-        llinfos << "media id= " << mTextureId << " url=" << u.scheme() << "://" << u.authority() << u.path() << " mime_type=" << mMimeType << llendl;
+        std::string sanitized_url = (u.query().empty() ? mMediaURL : u.scheme() + "://" + u.authority() + u.path());
+        llinfos << "media id= " << mTextureId << " url=" << sanitized_url << ", mime_type=" << mMimeType << llendl;
     }
 
 	if(mNavigateSuspended)
-- 
cgit v1.2.3


From 7b56020d66d18145256752f9c8d66a20d02f960c Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 26 Jul 2013 18:49:31 -0700
Subject: ACME-755 Clear FB cookies by removing cookies from the .facebook.com
 domain

---
 indra/llplugin/llplugincookiestore.cpp | 26 ++++++++++++++++++++++++++
 indra/llplugin/llplugincookiestore.h   |  3 +++
 indra/newview/llfloatersocial.cpp      |  5 +++--
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp
index 82017ab3fa..9ccd3a655b 100755
--- a/indra/llplugin/llplugincookiestore.cpp
+++ b/indra/llplugin/llplugincookiestore.cpp
@@ -87,6 +87,16 @@ std::string LLPluginCookieStore::Cookie::getKey() const
 	return result;
 }
 
+std::string LLPluginCookieStore::Cookie::getDomain() const
+{
+	std::string result;
+	if(mDomainEnd > mDomainStart)
+	{
+		result += mCookie.substr(mDomainStart, mDomainEnd - mDomainStart);
+	}
+	return result;
+}
+
 bool LLPluginCookieStore::Cookie::parse(const std::string &host)
 {
 	bool first_field = true;
@@ -662,3 +672,19 @@ void LLPluginCookieStore::removeCookie(const std::string &key)
 	}
 }
 
+void LLPluginCookieStore::removeCookiesByDomain(const std::string &domain)
+{
+	cookie_map_t::iterator iter = mCookies.begin();
+	while(iter != mCookies.end())
+	{ 
+		if(iter->second->getDomain() == domain)
+		{
+			delete iter->second;
+			iter = mCookies.erase(iter);
+		}
+		else
+		{
+			++iter;
+		}
+	}
+}
diff --git a/indra/llplugin/llplugincookiestore.h b/indra/llplugin/llplugincookiestore.h
index 91289d38a5..a2fdeab647 100755
--- a/indra/llplugin/llplugincookiestore.h
+++ b/indra/llplugin/llplugincookiestore.h
@@ -67,6 +67,8 @@ public:
 	// quote or unquote a string as per the definition of 'quoted-string' in rfc2616
 	static std::string quoteString(const std::string &s);
 	static std::string unquoteString(const std::string &s);
+
+	void removeCookiesByDomain(const std::string &domain);
 	
 private:
 
@@ -79,6 +81,7 @@ private:
 		
 		// Construct a string from the cookie that uniquely represents it, to be used as a key in a std::map.
 		std::string getKey() const;
+		std::string getDomain() const;
 		
 		const std::string &getCookie() const { return mCookie; };
 		bool isSessionCookie() const { return mDate.isNull(); };
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 129934ae16..8ca5043a35 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -39,6 +39,7 @@
 #include "llresmgr.h"		// LLLocale
 #include "llsdserialize.h"
 #include "llloadingindicator.h"
+#include "llplugincookiestore.h"
 #include "llslurl.h"
 #include "lltrans.h"
 #include "llsnapshotlivepreview.h"
@@ -759,8 +760,8 @@ void LLSocialAccountPanel::onConnect()
 {
 	LLFacebookConnect::instance().checkConnectionToFacebook(true);
 
-	//Clears browser cookies so that the user must enter their FB creds when connecting/re-connecting
-	LLViewerMedia::clearAllCookies();
+	//Clear only the facebook browser cookies so that the facebook login screen appears
+	LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); 
 }
 
 void LLSocialAccountPanel::onDisconnect()
-- 
cgit v1.2.3


From 22a931efad1380e6c04dce12fe5b16c21d98a908 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Sun, 28 Jul 2013 10:42:51 -0400
Subject: STORM-1957 World Map - Land For Sale is missing L$ / sqm

---
 doc/contributions.txt                          |  1 +
 indra/newview/llworldmap.cpp                   | 11 +++++++++++
 indra/newview/skins/default/xui/en/strings.xml |  2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 66ccb404a8..0509a9cbc8 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -649,6 +649,7 @@ Jonathan Yap
 	STORM-1858
 	STORM-1862
 	OPEN-161
+	STORM-1957
 Kadah Coba
 	STORM-1060
     STORM-1843
diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp
index 5fa380e0e3..bfae142812 100755
--- a/indra/newview/llworldmap.cpp
+++ b/indra/newview/llworldmap.cpp
@@ -522,6 +522,17 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID&
 
 			tooltip_fmt.setArg("[AREA]",  llformat("%d", extra));
 			tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2));
+
+			// Check for division by zero
+			if (extra != 0)
+			{
+				tooltip_fmt.setArg("[SQMPRICE]", llformat("%.1f", (F32)extra2 / (F32)extra));
+			}
+			else
+			{
+				tooltip_fmt.setArg("[SQMPRICE]",  LLTrans::getString("Unknown"));
+			}
+
 			new_item.setTooltip(tooltip_fmt.getString());
 
 			if (type == MAP_ITEM_LAND_FOR_SALE)
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index f7b33b0a4a..3030a1ae9f 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -378,7 +378,7 @@ Please try logging in again in a minute.</string>
 	<!-- world map -->
 	<string name="texture_loading">Loading...</string>
 	<string name="worldmap_offline">Offline</string>
-	<string name="worldmap_item_tooltip_format">[AREA] m² L$[PRICE]</string>
+	<string name="worldmap_item_tooltip_format">[AREA] m² L$[PRICE] ([SQMPRICE] L$/m²)</string>
 	<string name="worldmap_results_none_found">None found.</string>
 
 	<!-- animations uploading status codes -->
-- 
cgit v1.2.3


From 9e5dbcfde52f7cf32d2757172cf6de23bd3b8156 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Mon, 29 Jul 2013 13:52:48 -0400
Subject: STORM-1838 Add display name handling to the initial notification

---
 indra/newview/llavataractions.cpp                    | 6 +-----
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 45992b8c83..5f1f57f550 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -443,13 +443,9 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const
 // static
 void LLAvatarActions::teleportRequest(const LLUUID& id)
 {
-	std::string name;
-	gCacheName->getFullName(id, name);
-	gCacheName->cleanFullName(name);
-
 	LLSD notification;
 	notification["uuid"] = id;
-	notification["NAME"] = name + "'s";
+	notification["NAME_SLURL"] =  LLSLURL("agent", id, "about").getSLURLString();
 
 	LLSD payload;
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 3a01084b9a..5c5d3b342a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3975,7 +3975,7 @@ Join me in [REGION]
    icon="alertmodal.tga"
    name="TeleportRequestPrompt"
    type="alertmodal">
-Request a teleport to [NAME] location with the following message
+Request a teleport to [NAME_SLURL] with the following message
     <tag>confirm</tag>
     <form name="form">
       <input name="message" type="text">
-- 
cgit v1.2.3


From fd3d20e20dd4af39f5ff0c74f02d75df99e6a33b Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 29 Jul 2013 14:49:19 -0400
Subject: add credit for storm-1958

---
 doc/contributions.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 0509a9cbc8..579db5fe1f 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -301,6 +301,7 @@ Ciaran Laval
 Cinder Roxley
     BUG-2326
     STORM-1703
+    STORM-1958
 Clara Young
 Coaldust Numbers
     VWR-1095
-- 
cgit v1.2.3


From bdd8005721c4030c91059a5b54c255648351a2f7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 29 Jul 2013 12:09:29 -0700
Subject: ACME-755 : Fix erasing in live std::map (breaks build on Mac and
 Linux).

---
 indra/llplugin/llplugincookiestore.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp
index 9ccd3a655b..9f4d65e723 100755
--- a/indra/llplugin/llplugincookiestore.cpp
+++ b/indra/llplugin/llplugincookiestore.cpp
@@ -679,12 +679,14 @@ void LLPluginCookieStore::removeCookiesByDomain(const std::string &domain)
 	{ 
 		if(iter->second->getDomain() == domain)
 		{
-			delete iter->second;
-			iter = mCookies.erase(iter);
-		}
-		else
-		{
-			++iter;
+            cookie_map_t::iterator doErase = iter;
+            iter++;
+			delete doErase->second;
+			mCookies.erase(doErase);
 		}
+        else
+        {
+            iter++;
+        }
 	}
 }
-- 
cgit v1.2.3


From 499d132877974d076b852b4514b6320e111a5040 Mon Sep 17 00:00:00 2001
From: "Jeff (Gioffredo Linden)" <gioffredo@lindenlab.com>
Date: Mon, 29 Jul 2013 15:15:09 -0400
Subject: Add copyright and license

---
 indra/llui/llviewereventrecorder.cpp | 26 ++++++++++++++++++++++++++
 indra/llui/llviewereventrecorder.h   | 25 +++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
index 36df1f6ac1..a352f621eb 100644
--- a/indra/llui/llviewereventrecorder.cpp
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -1,3 +1,29 @@
+/**
+ * @file llviewereventrecorder.cpp
+ * @brief Viewer event recording and playback support for mouse and keyboard events
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * 
+ * 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 "llviewereventrecorder.h"
 #include "llui.h"
 #include "llleap.h"
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
index 190490b51f..72ca643ced 100644
--- a/indra/llui/llviewereventrecorder.h
+++ b/indra/llui/llviewereventrecorder.h
@@ -1,3 +1,28 @@
+/**
+ * @file llviewereventrecorder.h
+ * @brief Viewer event recording and playback support for mouse and keyboard events
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * 
+ * 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_VIEWER_EVENT_RECORDER
 #define LL_VIEWER_EVENT_RECORDER
 
-- 
cgit v1.2.3


From 64c1fb0b82fb8ec401c82d6d66b18a1ce30ad9af Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 30 Jul 2013 11:46:08 -0400
Subject: get rid of warning generated by trying to save obsolete
 VersionChannelName setting

---
 indra/newview/llappviewer.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f92274dbbd..72a3aa47e2 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2361,8 +2361,6 @@ bool LLAppViewer::initConfiguration()
 	gSavedSettings.setString("ClientSettingsFile", 
         gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global")));
 
-	gSavedSettings.setString("VersionChannelName", LLVersionInfo::getChannel());
-
 #ifndef	LL_RELEASE_FOR_DOWNLOAD
 	// provide developer build only overrides for these control variables that are not
 	// persisted to settings.xml
-- 
cgit v1.2.3


From d0432d4d4cf1a5f3b79327b11566a5f566f35115 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 30 Jul 2013 11:53:47 -0400
Subject: CHOP-975: Remove fallback to v1.0 update query when the v1.1 gets a
 404 response

---
 .../viewer_components/updater/llupdatechecker.cpp  | 49 ++++------------------
 1 file changed, 8 insertions(+), 41 deletions(-)

diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp
index 1e768f52d9..0b105cc1b6 100755
--- a/indra/viewer_components/updater/llupdatechecker.cpp
+++ b/indra/viewer_components/updater/llupdatechecker.cpp
@@ -80,7 +80,6 @@ void LLUpdateChecker::checkVersion(std::string const & hostUrl,
 //-----------------------------------------------------------------------------
 
 
-const char * LLUpdateChecker::Implementation::sLegacyProtocolVersion = "v1.0";
 const char * LLUpdateChecker::Implementation::sProtocolVersion = "v1.1";
 
 
@@ -153,40 +152,11 @@ void LLUpdateChecker::Implementation::completed(U32 status,
 			server_error += content["error_text"].asString();
 		}
 
-		if (status == 404)
-		{
-			if (mProtocol == sProtocolVersion)
-			{
-				mProtocol = sLegacyProtocolVersion;
-				std::string retryUrl = buildUrl(mHostUrl, mServicePath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest);
-
-				LL_WARNS("UpdaterService")
-					<< "update response using " << sProtocolVersion
-					<< " was HTTP 404 (" << server_error
-					<< "); retry with legacy protocol " << mProtocol
-					<< "\n at " << retryUrl
-					<< LL_ENDL;
-	
-				mHttpClient.get(retryUrl, this);
-			}
-			else
-			{
-				LL_WARNS("UpdaterService")
-					<< "update response using " << sLegacyProtocolVersion
-					<< " was 404 (" << server_error
-					<< "); request failed"
-					<< LL_ENDL;
-				mClient.error(reason);
-			}
-		}
-		else
-		{
-			LL_WARNS("UpdaterService") << "response error " << status
-									   << " " << reason
-									   << " (" << server_error << ")"
-									   << LL_ENDL;
-			mClient.error(reason);
-		}
+		LL_WARNS("UpdaterService") << "response error " << status
+								   << " " << reason
+								   << " (" << server_error << ")"
+								   << LL_ENDL;
+		mClient.error(reason);
 	}
 	else
 	{
@@ -218,11 +188,8 @@ std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUr
 	path.append(channel);
 	path.append(version);
 	path.append(platform);
-	if (mProtocol != sLegacyProtocolVersion)
-	{
-		path.append(platform_version);
-		path.append(willing_to_test ? "testok" : "testno");
-		path.append((char*)uniqueid);
-	}
+	path.append(platform_version);
+	path.append(willing_to_test ? "testok" : "testno");
+	path.append((char*)uniqueid);
 	return LLURI::buildHTTP(hostUrl, path).asString();
 }
-- 
cgit v1.2.3


From 85c8c1daf05e09c2b8524c6b418378063467f597 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 30 Jul 2013 13:02:29 -0700
Subject: ACME-757 : Change the hard coded url to fbc service (still a hack)

---
 indra/newview/llfacebookconnect.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 8c75d0efc6..29187bcabc 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -334,7 +334,8 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-	static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+	static std::string sFacebookConnectUrl = "http://int.fbc.aditi.lindenlab.com/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+    
 	std::string url = sFacebookConnectUrl + route;
 	llinfos << url << llendl;
 	return url;
-- 
cgit v1.2.3


From d0764f57a5b9591b452b6718d53a8169499e1856 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 31 Jul 2013 13:03:57 -0700
Subject: ACME-757: Switching back to pdp15 host for testing.

---
 indra/newview/llfacebookconnect.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 29187bcabc..2dbbb71cab 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -334,8 +334,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-	static std::string sFacebookConnectUrl = "http://int.fbc.aditi.lindenlab.com/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
-    
+	//static std::string sFacebookConnectUrl = "http://int.fbc.aditi.lindenlab.com/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+    static std::string sFacebookConnectUrl = "http://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // ANOTHER HACK SO WE POINT TO PDP15
+
 	std::string url = sFacebookConnectUrl + route;
 	llinfos << url << llendl;
 	return url;
-- 
cgit v1.2.3


From a2b1e06c3def4a8a97a41f3379c336864ede21f8 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Wed, 31 Jul 2013 19:04:45 -0700
Subject: ACME-778: Adjusted the facebook code so that isConnected() does not
 depend on state changes. Instead it returns true if the user successfully
 connected and false if the user successfully disconnected.

---
 indra/newview/llfacebookconnect.cpp            | 23 +++++++++++++++++-----
 indra/newview/llfacebookconnect.h              |  9 ++++++---
 indra/newview/llfloatersocial.cpp              | 27 ++++++++++++++------------
 indra/newview/skins/default/xui/en/strings.xml |  3 ++-
 4 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 2dbbb71cab..a7b7224d28 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -199,6 +199,7 @@ public:
 		}
 		else
 		{
+			LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED);
             log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
 		}
 	}
@@ -313,6 +314,8 @@ public:
 //
 LLFacebookConnect::LLFacebookConnect()
 :	mConnectionState(FB_NOT_CONNECTED),
+	mConnected(false),
+	mInfo(),
     mContent(),
     mGeneration(0)
 {
@@ -334,8 +337,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-	//static std::string sFacebookConnectUrl = "http://int.fbc.aditi.lindenlab.com/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
-    static std::string sFacebookConnectUrl = "http://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // ANOTHER HACK SO WE POINT TO PDP15
+	static std::string sFacebookConnectUrl = "http://int.fbc.aditi.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
 
 	std::string url = sFacebookConnectUrl + route;
 	llinfos << url << llendl;
@@ -360,13 +362,10 @@ void LLFacebookConnect::disconnectFromFacebook()
 
 void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
 {
-    if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED) || (mConnectionState == FB_POST_FAILED))
-    {
         const bool follow_redirects = false;
         const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
         LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect),
                           LLSD(), timeout, follow_redirects);
-    }
 }
 
 void LLFacebookConnect::loadFacebookInfo()
@@ -507,6 +506,15 @@ void LLFacebookConnect::clearContent()
 
 void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state)
 {
+	if(connection_state == FB_CONNECTED)
+	{
+		setConnected(true);
+	}
+	else if(connection_state == FB_NOT_CONNECTED)
+	{
+		setConnected(false);
+	}
+
 	if (mConnectionState != connection_state)
 	{
 		LLSD state_info;
@@ -516,3 +524,8 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c
 	
 	mConnectionState = connection_state;
 }
+
+void LLFacebookConnect::setConnected(bool connected)
+{
+	mConnected = connected;
+}
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index be3028e3a0..b9afd181e9 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -52,7 +52,8 @@ public:
 		FB_POSTING = 4,
 		FB_POSTED = 5,
 		FB_POST_FAILED = 6,
-		FB_DISCONNECTING = 7
+		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.
@@ -73,8 +74,9 @@ public:
     const LLSD& getContent() const;
     
     void setConnectionState(EConnectionState connection_state);
-	bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_DISCONNECTING) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
-	bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING)); }
+	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; }
     S32  generation() { return mGeneration; }
     
@@ -88,6 +90,7 @@ private:
  	std::string getFacebookConnectURL(const std::string& route = "");
    
     EConnectionState mConnectionState;
+	BOOL mConnected;
 	LLSD mInfo;
     LLSD mContent;
     S32  mGeneration;
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 8ca5043a35..0041ee9d7e 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -688,20 +688,17 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 
 bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data)
 {
-
-	switch (data.get("enum").asInteger())
+	if(LLFacebookConnect::instance().isConnected())
 	{
-		case LLFacebookConnect::FB_CONNECTED:
-		case LLFacebookConnect::FB_POSTING:
-		case LLFacebookConnect::FB_POSTED:
-		case LLFacebookConnect::FB_POST_FAILED:
+		//In process of disconnecting so leave the layout as is
+		if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING)
+		{
 			showConnectedLayout();
-			break;
-		case LLFacebookConnect::FB_NOT_CONNECTED:
-		case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
-		case LLFacebookConnect::FB_CONNECTION_FAILED:
-			showDisconnectedLayout();
-			break;
+		}
+	}
+	else
+	{
+		showDisconnectedLayout();
 	}
 
 	return false;
@@ -882,6 +879,12 @@ void LLFloaterSocial::draw()
 			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/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 02b64ef7e3..d75b65896c 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -151,9 +151,10 @@ Please try logging in again in a minute.</string>
 	<!-- Facebook Connect and, eventually, other Social Network -->
 	<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="SocialFacebookDisconnecting">Disconnecting from Facebook...</string>
+	<string name="SocialFacebookErrorDisconnecting">Problem disconnecting from Facebook</string>
     
 	<!-- Tooltip -->
 	<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->
-- 
cgit v1.2.3


From 12bbf0e92251818c397bc4e33a26395b3ad98175 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 1 Aug 2013 11:41:55 -0700
Subject: ACME-773 Making cookie clearing occur during disc and connect.

---
 indra/newview/llfloatersocial.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 0041ee9d7e..4c8aec4e99 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -764,6 +764,8 @@ void LLSocialAccountPanel::onConnect()
 void LLSocialAccountPanel::onDisconnect()
 {
 	LLFacebookConnect::instance().disconnectFromFacebook();
+
+	LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); 
 }
 
 ////////////////////////
-- 
cgit v1.2.3


From 1f6d19436e659954d766d6d3698d0bfabde4fa81 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 1 Aug 2013 15:12:58 -0700
Subject: ACME: add SLShareHost variable to settings.xml, which allows changing
 the fb service host location as needed.

---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llfacebookconnect.cpp     |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 672e323801..832610c72c 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3456,6 +3456,17 @@
         <key>Value</key>
         <integer>0</integer>
     </map>
+    <key>SLShareHost</key>
+    <map>
+      <key>Comment</key>
+      <string>Host for contacting SL FB services</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://int.fbc.aditi.lindenlab.com</string>
+    </map>  
     <key>FastCacheFetchEnabled</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index a7b7224d28..dbebe8d14a 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -32,6 +32,7 @@
 #include "llagent.h"
 #include "llcallingcard.h"			// for LLAvatarTracker
 #include "llcommandhandler.h"
+#include "llcontrol.h"
 #include "llhttpclient.h"
 #include "llnotificationsutil.h"
 #include "llurlaction.h"
@@ -47,6 +48,8 @@ boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStrea
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sInfoWatcher(new LLEventStream("FacebookConnectInfo"));
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent"));
 
+extern LLControlGroup gSavedSettings;
+
 // 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)
 {
@@ -336,8 +339,10 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
+	//TODO GIL : Remove this code along with extern and llcontrol.h header
+	std::string host = gSavedSettings.getString("SLShareHost");
 	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-	static std::string sFacebookConnectUrl = "http://int.fbc.aditi.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+	static std::string sFacebookConnectUrl = host + "/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
 
 	std::string url = sFacebookConnectUrl + route;
 	llinfos << url << llendl;
-- 
cgit v1.2.3


From 7bcda3a511f47a465cb8e22eb3c36e1e82d19f17 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 1 Aug 2013 20:53:27 -0700
Subject: ACME-785 : Use a specific notifytip message (without the OK button)
 for fbc success notification

---
 indra/newview/llfacebookconnect.cpp                  | 2 +-
 indra/newview/skins/default/xui/en/notifications.xml | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index a7b7224d28..0179b3f6b1 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -61,7 +61,7 @@ void toast_user_for_success()
 {
 	LLSD args;
     args["MESSAGE"] = LLTrans::getString("facebook_post_success");
-    LLNotificationsUtil::add("SystemMessage", args);
+    LLNotificationsUtil::add("FacebookConnect", args);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 1f20d3ab58..a3592bce4a 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5992,6 +5992,14 @@ Please select at least one type of content to search (General, Moderate, or Adul
 [MESSAGE]
   </notification>
 
+ <notification
+  icon="notify.tga"
+  name="FacebookConnect"
+  persist="true"
+  type="notifytip">
+[MESSAGE]
+ </notification>
+    
   <notification
    icon="notify.tga"
    name="PaymentReceived"
-- 
cgit v1.2.3


From b19b2737b2965900e55485a5887815ce97aa9dd7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 1 Aug 2013 21:46:37 -0700
Subject: ACME-761 : Use the cap for the service url unless overridden by the
 SLShareHost setting from settings.xml

---
 indra/newview/llfacebookconnect.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 26fc480658..e4ac2a4960 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -40,6 +40,7 @@
 #include "llimagejpeg.h"
 #include "lltrans.h"
 #include "llevents.h"
+#include "llviewerregion.h"
 
 #include "llfloaterwebcontent.h"
 #include "llfloaterreg.h"
@@ -339,13 +340,21 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
 {
-	//TODO GIL : Remove this code along with extern and llcontrol.h header
+	static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
+    
+	//*TODO : Remove this code along with extern and llcontrol.h header
 	std::string host = gSavedSettings.getString("SLShareHost");
-	//static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-	static std::string sFacebookConnectUrl = host + "/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+    if (!host.empty())
+    {
+        sFacebookConnectUrl = host + "/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
+    }
+    else
+    {
+        sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
+    }
+    //End removable part
 
 	std::string url = sFacebookConnectUrl + route;
-	llinfos << url << llendl;
 	return url;
 }
 
-- 
cgit v1.2.3


From 93e8ec86dc08ace8bf9a20a0d14b38d47f961c47 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 2 Aug 2013 19:21:38 +0100
Subject: changed PLACE to CHECK IN for ACME-794

---
 indra/newview/skins/default/xui/en/floater_social.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 3eff2c2ae1..39df777d1b 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -54,7 +54,7 @@
        filename="panel_social_place.xml"
        class="llsocialcheckinpanel"
        follows="all"
-       label="PLACE"
+       label="CHECK IN"
        help_topic="panel_social_place"
        name="panel_social_place"/>
      <panel
-- 
cgit v1.2.3


From b6e1153c39a0719716c549618839645c10ec6bbd Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 2 Aug 2013 19:54:42 +0100
Subject: changed facebook_post_success text to be more consistent with other
 notification text for ACME-793

---
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index d75b65896c..6d94923dba 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3430,7 +3430,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
   </string>
 
   <string name="facebook_post_success">
-    Posting to Facebook was successful.
+    You posted to Facebook.
   </string>
 
   <string name="no_session_message">
-- 
cgit v1.2.3


From dd70cc8f32aab7712f92198c43c8b4d86b8c5e73 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 2 Aug 2013 12:44:50 -0700
Subject: ACME : Fix a spurious crash when showing the Advanced->Shortcuts menu
 just after launch

---
 indra/newview/llfloatersocial.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4c8aec4e99..4cbc9c0218 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -374,7 +374,7 @@ void LLSocialPhotoPanel::updateControls()
 	LLSnapshotLivePreview* previewp = getPreviewView();
 	BOOL got_bytes = previewp && previewp->getDataSize() > 0;
 	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
-	LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType();
+	LLSnapshotLivePreview::ESnapshotType shot_type = (previewp ? previewp->getSnapshotType() : LLSnapshotLivePreview::SNAPSHOT_POSTCARD);
 
 	// *TODO: Separate maximum size for Web images from postcards
 	lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
-- 
cgit v1.2.3


From 5728cc8d6fe315e2234f77f4c079b60ffaa7f8db Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Fri, 2 Aug 2013 20:59:46 +0100
Subject: added learn more link to panel_social_account for ACME-797

---
 .../skins/default/xui/en/panel_social_account.xml  | 55 +++++++++++++---------
 1 file changed, 33 insertions(+), 22 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 5855eeed59..957d117d9d 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -37,28 +37,39 @@
     name="panel_buttons"
     height="345"
     left="9">
-  <button
-   layout="topleft"
-   follows="left|top"
-   top_pad="9"
-   visible="true"
-   height="23"
-   label="Connect..."
-   name="connect_btn"
-   width="210">
-    <commit_callback function="SocialSharing.Connect"/>
-  </button>
+    <button
+     layout="topleft"
+     follows="left|top"
+     top_pad="9"
+     visible="true"
+     height="23"
+     label="Connect..."
+     name="connect_btn"
+     width="210">
+      <commit_callback function="SocialSharing.Connect"/>
+    </button>
 
-  <button
-   layout="topleft"
-   follows="left|top"
-   top_delta="0"
-   height="23"
-   label="Disconnect"
-   name="disconnect_btn"
-   width="210"
-   visible="false">
-    <commit_callback function="SocialSharing.Disconnect"/>
-  </button>
+    <button
+     layout="topleft"
+     follows="left|top"
+     top_delta="0"
+     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"
+      height="16"
+      left="3"
+      name="account_learn_more_label"
+      top_pad="5"
+      type="string">
+      [https://support.secondlife.com/ Learn more.]
+    </text>
   </panel>
 </panel>
-- 
cgit v1.2.3


From 1abafdc8b5bf0197b2a3586737d461140e07e994 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 2 Aug 2013 14:42:03 -0700
Subject: Switching SLShareHost to pdp location

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 832610c72c..20919adc76 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3465,7 +3465,7 @@
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://int.fbc.aditi.lindenlab.com</string>
+      <string>http://pdp15.lindenlab.com</string>
     </map>  
     <key>FastCacheFetchEnabled</key>
     <map>
-- 
cgit v1.2.3


From 56b54aaf2954765f68c4fbe843495fdcdb918744 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 3 Aug 2013 01:42:31 +0100
Subject: made checkin use a placeholder location URL when the given SLURL is
 not valid

---
 indra/newview/llfloatersocial.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4cbc9c0218..eb9a7d2400 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -53,6 +53,7 @@ static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsoci
 static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsocialaccountpanel");
 
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
+const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/";
 const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg";
 
 std::string get_map_url()
@@ -582,6 +583,13 @@ void LLSocialCheckinPanel::sendCheckin()
 	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;
+	}
     
 	// Get the region name
 	std::string region_name = gAgent.getRegion()->getName();
-- 
cgit v1.2.3


From a4bad4ba21787c6895368f5eb5cda7c3881d57da Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 2 Aug 2013 18:58:37 -0700
Subject: ACME-744: Temporary solution. The internal browser was not setting
 keyboard focus properly...as to why an investigation is needed. For now
 explicly setting keyboard focus to the internal browser after it is
 displayed.

---
 indra/newview/llfacebookconnect.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index e4ac2a4960..560208c31e 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -333,7 +333,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
     p.url(url).allow_address_entry(false);
     p.url(url).allow_back_forward_navigation(false);
     p.url(url).trusted_content(true);
-	LLFloaterReg::showInstance("fbc_web", p);
+	LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p);
+	//TODO Gil: Hack to give the focus to the web browser to show cursor, will fix
+	gFocusMgr.setKeyboardFocus( floater );
 
 	//LLUrlAction::openURLExternal(url);
 }
-- 
cgit v1.2.3


From 35278461964653fc032995afdc366f096c937a14 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 2 Aug 2013 19:25:10 -0700
Subject: ACME-796 : Do not flip the fbc state to failure while connecting
 through web browser. Handle the dismiss case as best as possible.

---
 indra/newview/llfacebookconnect.cpp   |  2 +-
 indra/newview/llfloatersocial.cpp     |  6 +++++-
 indra/newview/llfloaterwebcontent.cpp | 11 +++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index e4ac2a4960..98fd8b1d7b 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -122,7 +122,7 @@ public:
 			// Grab some graph data now that we are connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
 		}
-		else
+		else if (status != 302)
 		{
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
             log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description"));
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index eb9a7d2400..59db93f4b2 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -684,8 +684,12 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
 		else
 		{
 			showDisconnectedLayout();
-			LLFacebookConnect::instance().checkConnectionToFacebook();
 		}
+        if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
+            (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
+        {
+            LLFacebookConnect::instance().checkConnectionToFacebook();
+        }
 	}
 	else
 	{
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index e81055f7b1..9d703d2752 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -29,6 +29,7 @@
 #include "llcombobox.h"
 #include "lliconctrl.h"
 #include "llfloaterreg.h"
+#include "llfacebookconnect.h"
 #include "lllayoutstack.h"
 #include "llpluginclassmedia.h"
 #include "llprogressbar.h"
@@ -293,6 +294,16 @@ 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
+    LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web");
+    if (fbc_web == this)
+    {
+        if (!LLFacebookConnect::instance().isConnected())
+        {
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
+        }
+    }
+    
 	LLViewerMedia::proxyWindowClosed(mUUID);
 	destroy();
 }
-- 
cgit v1.2.3


From b75213b39ad7456d04d3e1644f2116853ead0da0 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 5 Aug 2013 11:19:54 -0400
Subject: open-185: remove duplicate gperftools entry in autobuild.xml

---
 autobuild.xml         | 36 ------------------------------------
 doc/contributions.txt |  1 +
 2 files changed, 1 insertion(+), 36 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index 628d3f6883..e13536c3b3 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -879,42 +879,6 @@
           </map>
         </map>
       </map>
-      <key>gperftools</key>
-      <map>
-        <key>license</key>
-        <string>bsd</string>
-        <key>license_file</key>
-        <string>LICENSES/gperftools.txt</string>
-        <key>name</key>
-        <string>gperftools</string>
-        <key>platforms</key>
-        <map>
-          <key>linux</key>
-          <map>
-            <key>archive</key>
-            <map>
-              <key>hash</key>
-              <string>8aedfdcf670348c18a9991ae1b384a61</string>
-              <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2</string>
-            </map>
-            <key>name</key>
-            <string>linux</string>
-          </map>
-          <key>windows</key>
-          <map>
-            <key>archive</key>
-            <map>
-              <key>hash</key>
-              <string>f62841804acb91e1309603a84f3f0ce8</string>
-              <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2</string>
-            </map>
-            <key>name</key>
-            <string>windows</string>
-          </map>
-        </map>
-      </map>
       <key>gstreamer</key>
       <map>
         <key>license</key>
diff --git a/doc/contributions.txt b/doc/contributions.txt
index 72096a0ab7..18e8ba0189 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -300,6 +300,7 @@ Christopher  Organiser
 Ciaran Laval
 Cinder Roxley
     BUG-2326
+    OPEN-185
     STORM-1703
     STORM-1958
     STORM-1951
-- 
cgit v1.2.3


From d9d1d2722737069618e15eac2f33ac4600c357ba Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Mon, 5 Aug 2013 19:04:08 +0100
Subject: changed wording of learn more link for ACME-797

---
 indra/newview/skins/default/xui/en/panel_social_account.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 957d117d9d..882e410bdb 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -65,11 +65,11 @@
       length="1"
       follows="top|left"
       height="16"
-      left="3"
+      left="0"
       name="account_learn_more_label"
-      top_pad="5"
+      top_pad="20"
       type="string">
-      [https://support.secondlife.com/ Learn more.]
+      [https://support.secondlife.com/ Learn about posting to Facebook]
     </text>
   </panel>
 </panel>
-- 
cgit v1.2.3


From c7342bc6c0950add28918159935b8001c4ad2dc8 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 6 Aug 2013 10:27:18 -0700
Subject: ACME-744: Adjusted comment to be more clear

---
 indra/newview/llfacebookconnect.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 645f62579d..ad776b2d1a 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -334,7 +334,10 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
     p.url(url).allow_back_forward_navigation(false);
     p.url(url).trusted_content(true);
 	LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p);
-	//TODO Gil: Hack to give the focus to the web browser to show cursor, will fix
+	//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);
-- 
cgit v1.2.3


From 3e08ccf6abb6f6ca7f1fa2fc6e80fd6589203f28 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 6 Aug 2013 17:12:32 -0700
Subject: ACME-801: Adding a suggested friend as a friend does not remove them
 from the suggested friend list

---
 indra/newview/llfacebookconnect.cpp |  5 +----
 indra/newview/llfacebookconnect.h   |  2 --
 indra/newview/llpanelpeople.cpp     | 42 ++++++++++++++++---------------------
 indra/newview/llpanelpeople.h       |  1 -
 4 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index ad776b2d1a..bdc17773d7 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -320,8 +320,7 @@ LLFacebookConnect::LLFacebookConnect()
 :	mConnectionState(FB_NOT_CONNECTED),
 	mConnected(false),
 	mInfo(),
-    mContent(),
-    mGeneration(0)
+    mContent()
 {
 }
 
@@ -506,7 +505,6 @@ const LLSD& LLFacebookConnect::getInfo() const
 
 void LLFacebookConnect::storeContent(const LLSD& content)
 {
-    mGeneration++;
     mContent = content;
 
 	sContentWatcher->post(content);
@@ -519,7 +517,6 @@ const LLSD& LLFacebookConnect::getContent() const
 
 void LLFacebookConnect::clearContent()
 {
-    mGeneration++;
     mContent = LLSD();
 }
 
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index b9afd181e9..0f005cbe24 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -78,7 +78,6 @@ public:
 	bool isConnected() { return mConnected; }
 	bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_DISCONNECTING)); }
     EConnectionState getConnectionState() { return mConnectionState; }
-    S32  generation() { return mGeneration; }
     
     void openFacebookWeb(std::string url);
 
@@ -93,7 +92,6 @@ private:
 	BOOL mConnected;
 	LLSD mInfo;
     LLSD mContent;
-    S32  mGeneration;
 	
 	static boost::scoped_ptr<LLEventPump> sStateWatcher;
 	static boost::scoped_ptr<LLEventPump> sInfoWatcher;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f1ee76f733..1786f73a8b 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -510,8 +510,7 @@ LLPanelPeople::LLPanelPeople()
 		mNearbyList(NULL),
 		mRecentList(NULL),
 		mGroupList(NULL),
-		mMiniMap(NULL),
-        mFacebookListGeneration(0)
+		mMiniMap(NULL)
 {
 	mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList,	this));
 	mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList,	this));
@@ -783,36 +782,31 @@ void LLPanelPeople::updateFriendList()
 
 bool LLPanelPeople::updateSuggestedFriendList()
 {
-	if (LLFacebookConnect::instance().generation() != mFacebookListGeneration)
-	{
-		mFacebookListGeneration = LLFacebookConnect::instance().generation();
+	const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
+	uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs();
+	suggested_friends.clear();
 
-		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;
 
-		//Add suggested friends
-		LLSD friends = LLFacebookConnect::instance().getContent();
-		for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
+		if(!second_life_buddy)
 		{
-			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())
 			{
-				//FB+SL but not SL friend
-				if (agent_id.notNull())
-				{
-					suggested_friends.push_back(agent_id);
-				}
+				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();
 	}
 
+	//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;
 }
 
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index b746835dfb..c7141f36ee 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -140,7 +140,6 @@ private:
 	LLAvatarList*			mNearbyList;
 	LLAvatarList*			mRecentList;
 	LLGroupList*			mGroupList;
-    S32                     mFacebookListGeneration;
 	LLNetMap*				mMiniMap;
 
 	std::vector<std::string> mSavedOriginalFilters;
-- 
cgit v1.2.3


From 9167198312ac98f02640ecc3c445fa721413febd Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 7 Aug 2013 16:12:29 -0700
Subject: ACME-814 : Disable Post in Photo panel while the preview is
 processing

---
 indra/newview/llfloatersocial.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 59db93f4b2..937f76648d 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -205,8 +205,8 @@ void LLSocialPhotoPanel::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());
-    mPostButton->setEnabled(no_ongoing_connection);
     mCancelButton->setEnabled(no_ongoing_connection);
     mCaptionTextBox->setEnabled(no_ongoing_connection);
     mResolutionComboBox->setEnabled(no_ongoing_connection);
@@ -247,6 +247,9 @@ void LLSocialPhotoPanel::draw()
     // 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();
 }
-- 
cgit v1.2.3


From 77baf98d12c75621f8b1d69824abf01b9aa260f7 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 7 Aug 2013 18:45:50 -0700
Subject: ACME-820 : Let checkin checkbox be available and swap tile map /
 default tile when toggling

---
 indra/newview/llfloatersocial.cpp                   |  11 +++++------
 indra/newview/llfloatersocial.h                     |   2 +-
 .../default/textures/icons/map_placeholder.jpg      | Bin 25641 -> 12931 bytes
 .../skins/default/xui/en/panel_social_place.xml     |  13 ++++++++++++-
 4 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 937f76648d..66a586b16b 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -499,8 +499,8 @@ BOOL LLSocialCheckinPanel::postBuild()
 	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");
-    mMapCheckBoxValue = mMapCheckBox->get();
     
 	return LLPanel::postBuild();
 }
@@ -511,6 +511,7 @@ void LLSocialCheckinPanel::draw()
     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?
@@ -524,9 +525,6 @@ void LLSocialCheckinPanel::draw()
         // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox
         mMapLoadingIndicator->setVisible(true);
         mMapPlaceholder->setVisible(false);
-        mMapCheckBoxValue = mMapCheckBox->get();
-        mMapCheckBox->set(false);
-        mMapCheckBox->setEnabled(false);
     }
     // Are we done loading the map tile?
     if (mReloadingMapTexture && mMapTexture->isFullyLoaded())
@@ -540,9 +538,10 @@ void LLSocialCheckinPanel::draw()
         // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value
         mMapLoadingIndicator->setVisible(false);
         mMapPlaceholder->setVisible(true);
-        mMapCheckBox->setEnabled(no_ongoing_connection);
-        mMapCheckBox->set(mMapCheckBoxValue);
     }
+    // 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();
 }
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index e7ad9ac12e..bbe07c9704 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -110,9 +110,9 @@ private:
 	LLUICtrl* mMessageTextEditor;
     LLUICtrl* mMapLoadingIndicator;
     LLIconCtrl* mMapPlaceholder;
+    LLIconCtrl* mMapDefault;
     LLCheckBoxCtrl* mMapCheckBox;
     bool mReloadingMapTexture;
-    bool mMapCheckBoxValue;
 };
 
 class LLSocialAccountPanel : public LLPanel
diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg
index 0cb86c58d3..57204e2261 100644
Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and b/indra/newview/skins/default/textures/icons/map_placeholder.jpg differ
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml
index b53a41487a..13e94f6998 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_place.xml
@@ -71,9 +71,20 @@
                 visible="true"
                 name="map_placeholder">
               </icon>
+              <icon
+                  follows="left|top"
+                  height="128"
+                  width="128"
+                  image_name="Map_Placeholder_Icon"
+                  layout="topleft"
+                  top="20"
+                  left="9"
+                  visible="true"
+                  name="map_default">
+              </icon>
             <check_box
               follows="left|top"
-              initial_value="true"
+              initial_value="false"
               top_delta="8"
               width="8"
               label=""
-- 
cgit v1.2.3


From abdb549395518954d6c80e50d132d77613275ebd Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 8 Aug 2013 18:57:27 -0700
Subject: ACME-821 : Use 128x128 png for the default tile icon instead of
 300x300 jpg

---
 .../skins/default/textures/icons/map_placeholder.jpg    | Bin 12931 -> 0 bytes
 .../skins/default/textures/icons/map_placeholder.png    | Bin 0 -> 7694 bytes
 indra/newview/skins/default/textures/textures.xml       |   2 +-
 3 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.jpg
 create mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.png

diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg
deleted file mode 100644
index 57204e2261..0000000000
Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and /dev/null differ
diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.png b/indra/newview/skins/default/textures/icons/map_placeholder.png
new file mode 100644
index 0000000000..31e457aa75
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/map_placeholder.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 4100849f6f..94c187e21a 100755
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -326,7 +326,7 @@ with the same filename but different name
 
   <texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" />
 
-  <texture name="Map_Placeholder_Icon" file_name="icons/map_placeholder.jpg" preload="true" />
+  <texture name="Map_Placeholder_Icon" file_name="icons/map_placeholder.png" preload="true" />
     
   <texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" />
   <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" />
-- 
cgit v1.2.3


From fff55ee5d057aeb50b0c7f096ede659ee71bb25e Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 9 Aug 2013 13:21:25 -0700
Subject: ACME-800: Posted to Facebook notifications persist in the
 open_notifications.xml file per user

---
 indra/newview/skins/default/xui/en/notifications.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index a3592bce4a..46ebdcff54 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5995,7 +5995,6 @@ Please select at least one type of content to search (General, Moderate, or Adul
  <notification
   icon="notify.tga"
   name="FacebookConnect"
-  persist="true"
   type="notifytip">
 [MESSAGE]
  </notification>
-- 
cgit v1.2.3


From 481abb13812214d7d5f1124f8eb80f1cc1b08c19 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 9 Aug 2013 18:31:10 -0700
Subject: ACME 824: Suggested Friends do not repopulate if you disconnect and
 reconnect to Facebook API in same viewer session

---
 indra/newview/llfacebookconnect.cpp | 47 ++++++++++++++++++++++++++++---------
 indra/newview/llfacebookconnect.h   |  6 ++++-
 indra/newview/llpanelpeople.cpp     | 34 +++++++++++++--------------
 3 files changed, 58 insertions(+), 29 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index bdc17773d7..5551acff0d 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -197,9 +197,11 @@ public:
 		{
 			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
 			
-			// Clear all facebook stuff
-            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+			// Clear data
+			LLFacebookConnect::instance().clearInfo();
 			LLFacebookConnect::instance().clearContent();
+			//Notify state change
+            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
 		}
 		else
 		{
@@ -320,7 +322,9 @@ LLFacebookConnect::LLFacebookConnect()
 :	mConnectionState(FB_NOT_CONNECTED),
 	mConnected(false),
 	mInfo(),
-    mContent()
+    mContent(),
+	mRefreshInfo(false),
+	mRefreshContent(false)
 {
 }
 
@@ -388,18 +392,24 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
 
 void LLFacebookConnect::loadFacebookInfo()
 {
-	const bool follow_redirects = false;
-	const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
-	LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(),
-		LLSD(), timeout, follow_redirects);
+	if(mRefreshInfo)
+	{
+		const bool follow_redirects = false;
+		const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+		LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(),
+			LLSD(), timeout, follow_redirects);
+	}
 }
 
 void LLFacebookConnect::loadFacebookFriends()
 {
-	const bool follow_redirects = false;
-	const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
-	LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(),
-					  LLSD(), timeout, follow_redirects);
+	if(mRefreshContent)
+	{
+		const bool follow_redirects = false;
+		const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+		LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(),
+			LLSD(), timeout, follow_redirects);
+	}
 }
 
 void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message)
@@ -495,6 +505,8 @@ void LLFacebookConnect::updateStatus(const std::string& message)
 void LLFacebookConnect::storeInfo(const LLSD& info)
 {
 	mInfo = info;
+	mRefreshInfo = false;
+
 	sInfoWatcher->post(info);
 }
 
@@ -503,9 +515,15 @@ 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);
 }
@@ -520,11 +538,18 @@ void LLFacebookConnect::clearContent()
     mContent = LLSD();
 }
 
+void LLFacebookConnect::setDataDirty()
+{
+	mRefreshInfo = true;
+	mRefreshContent = true;
+}
+
 void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state)
 {
 	if(connection_state == FB_CONNECTED)
 	{
 		setConnected(true);
+		setDataDirty();
 	}
 	else if(connection_state == FB_NOT_CONNECTED)
 	{
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 0f005cbe24..77c26842de 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -69,9 +69,11 @@ public:
 	
 	void storeInfo(const LLSD& info);
 	const LLSD& getInfo() const;
-    void clearContent();
+	void clearInfo();
 	void storeContent(const LLSD& content);
     const LLSD& getContent() const;
+	void clearContent();
+	void setDataDirty();
     
     void setConnectionState(EConnectionState connection_state);
 	void setConnected(bool connected);
@@ -92,6 +94,8 @@ private:
 	BOOL mConnected;
 	LLSD mInfo;
     LLSD mContent;
+	bool mRefreshInfo;
+	bool mRefreshContent;
 	
 	static boost::scoped_ptr<LLEventPump> sStateWatcher;
 	static boost::scoped_ptr<LLEventPump> sInfoWatcher;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 1786f73a8b..72953ec6d3 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -835,12 +835,16 @@ void LLPanelPeople::updateRecentList()
 
 bool LLPanelPeople::onConnectedToFacebook(const LLSD& data)
 {
-	if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED)
-	{
-		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople");
+	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;
 }
@@ -852,21 +856,16 @@ void LLPanelPeople::updateFacebookList(bool 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));
 
-		if (mTryToConnectToFbc)
-		{
-			// try to reconnect to facebook!
-			if (LLFacebookConnect::instance().isConnected())
-			{
-				LLFacebookConnect::instance().loadFacebookFriends();
-			}
-			else
-			{
-				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));
-				LLFacebookConnect::instance().checkConnectionToFacebook();
-			}
+		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));
 
-			// don't try again
+		if (LLFacebookConnect::instance().isConnected())
+		{
+			LLFacebookConnect::instance().loadFacebookFriends();
+		}
+		else if(mTryToConnectToFbc)
+		{
+			LLFacebookConnect::instance().checkConnectionToFacebook();
 			mTryToConnectToFbc = false;
 		}
     
@@ -874,6 +873,7 @@ void LLPanelPeople::updateFacebookList(bool visible)
 	}
 	else
 	{
+		LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople");
 		LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople");
 	}
 }
-- 
cgit v1.2.3


From 91c9cc4c33f68f4f39e23763317a76ccb573c38b Mon Sep 17 00:00:00 2001
From: dolphin <dolphin@lindenlab.com>
Date: Mon, 12 Aug 2013 11:09:05 -0700
Subject: Save SL NVAPI profile only when changes have been made.

---
 indra/newview/llappviewerwin32.cpp | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 3cf3c739d9..80a80f4298 100755
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -172,21 +172,20 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
 			nvapi_error(status);
 			return;
 		}
+
+        // (5) Now we apply (or save) our changes to the system
+        status = NvAPI_DRS_SaveSettings(hSession);
+        if (status != NVAPI_OK) 
+        {
+            nvapi_error(status);
+            return;
+        }
 	}
 	else if (status != NVAPI_OK)
 	{
 		nvapi_error(status);
 		return;
 	}
-
-	
-
-	// (5) Now we apply (or save) our changes to the system
-	status = NvAPI_DRS_SaveSettings(hSession);
-	if (status != NVAPI_OK) 
-	{
-		nvapi_error(status);
-	}
 }
 
 //#define DEBUGGING_SEH_FILTER 1
-- 
cgit v1.2.3


From d0e964289ec9888686619c4edd756edd622ca214 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Tue, 13 Aug 2013 01:47:20 +0100
Subject: added read_from_master parameter for ACME-829

---
 indra/newview/app_settings/settings.xml |  2 +-
 indra/newview/llfacebookconnect.cpp     | 35 +++++++++++++++++++++------------
 indra/newview/llfacebookconnect.h       |  3 ++-
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 20919adc76..bebd1fd9e8 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3465,7 +3465,7 @@
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://pdp15.lindenlab.com</string>
+      <string></string>
     </map>  
     <key>FastCacheFetchEnabled</key>
     <map>
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 5551acff0d..0a4fefbd24 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -119,7 +119,6 @@ public:
 		{
 			LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
 			
-			// Grab some graph data now that we are connected
             LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
 		}
 		else if (status != 302)
@@ -324,7 +323,8 @@ LLFacebookConnect::LLFacebookConnect()
 	mInfo(),
     mContent(),
 	mRefreshInfo(false),
-	mRefreshContent(false)
+	mRefreshContent(false),
+	mReadFromMaster(false)
 {
 }
 
@@ -346,7 +346,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 	//LLUrlAction::openURLExternal(url);
 }
 
-std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
+std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master)
 {
 	static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
     
@@ -363,6 +363,10 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route)
     //End removable part
 
 	std::string url = sFacebookConnectUrl + route;
+	if (include_read_from_master && mReadFromMaster)
+	{
+		url += "?read_from_master=true";
+	}
 	return url;
 }
 
@@ -384,10 +388,10 @@ void LLFacebookConnect::disconnectFromFacebook()
 
 void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
 {
-        const bool follow_redirects = false;
-        const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
-        LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect),
-                          LLSD(), timeout, follow_redirects);
+	const bool follow_redirects = false;
+	const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+	LLHTTPClient::get(getFacebookConnectURL("/connection", true), new LLFacebookConnectedResponder(auto_connect),
+						LLSD(), timeout, follow_redirects);
 }
 
 void LLFacebookConnect::loadFacebookInfo()
@@ -396,7 +400,7 @@ void LLFacebookConnect::loadFacebookInfo()
 	{
 		const bool follow_redirects = false;
 		const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
-		LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(),
+		LLHTTPClient::get(getFacebookConnectURL("/info", true), new LLFacebookInfoResponder(),
 			LLSD(), timeout, follow_redirects);
 	}
 }
@@ -407,7 +411,7 @@ void LLFacebookConnect::loadFacebookFriends()
 	{
 		const bool follow_redirects = false;
 		const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
-		LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(),
+		LLHTTPClient::get(getFacebookConnectURL("/friends", true), new LLFacebookFriendsResponder(),
 			LLSD(), timeout, follow_redirects);
 	}
 }
@@ -427,7 +431,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri
 		body["message"] = message;
 
 	// Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/checkin", true), body, new LLFacebookShareResponder());
 }
 
 void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption)
@@ -437,7 +441,7 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri
 	body["caption"] = caption;
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookShareResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/photo", true), body, new LLFacebookShareResponder());
 }
 
 void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption)
@@ -490,7 +494,7 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std:
 	memcpy(data, body.str().data(), size);
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers);
+	LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo", true), data, size, new LLFacebookShareResponder(), headers);
 }
 
 void LLFacebookConnect::updateStatus(const std::string& message)
@@ -499,7 +503,7 @@ void LLFacebookConnect::updateStatus(const std::string& message)
 	body["message"] = message;
 	
     // Note: we can use that route for different publish action. We should be able to use the same responder.
-	LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder());
+	LLHTTPClient::post(getFacebookConnectURL("/share/wall", true), body, new LLFacebookShareResponder());
 }
 
 void LLFacebookConnect::storeInfo(const LLSD& info)
@@ -548,6 +552,7 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c
 {
 	if(connection_state == FB_CONNECTED)
 	{
+		mReadFromMaster = true;
 		setConnected(true);
 		setDataDirty();
 	}
@@ -555,6 +560,10 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c
 	{
 		setConnected(false);
 	}
+	else if(connection_state == FB_POSTED)
+	{
+		mReadFromMaster = false;
+	}
 
 	if (mConnectionState != connection_state)
 	{
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index 77c26842de..a77ac24167 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -88,7 +88,7 @@ private:
 
 	LLFacebookConnect();
 	~LLFacebookConnect() {};
- 	std::string getFacebookConnectURL(const std::string& route = "");
+ 	std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false);
    
     EConnectionState mConnectionState;
 	BOOL mConnected;
@@ -96,6 +96,7 @@ private:
     LLSD mContent;
 	bool mRefreshInfo;
 	bool mRefreshContent;
+	bool mReadFromMaster;
 	
 	static boost::scoped_ptr<LLEventPump> sStateWatcher;
 	static boost::scoped_ptr<LLEventPump> sInfoWatcher;
-- 
cgit v1.2.3


From abc2abf45dbe69daa0130ad823ca7184acc9d8df Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 12 Aug 2013 20:26:33 -0700
Subject: ACME-820 : Use the LL hosted default image for the default map tile
 in checkin

---
 indra/newview/llfloatersocial.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 66a586b16b..4c17d9e40d 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -54,7 +54,7 @@ static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsoci
 
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/";
-const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg";
+const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png";
 
 std::string get_map_url()
 {
-- 
cgit v1.2.3


From be07694b9cc8d2203cfedc777bcb00021dfa91a1 Mon Sep 17 00:00:00 2001
From: Ansariel <none@none>
Date: Thu, 22 Aug 2013 00:51:15 +0200
Subject: MAINT-2773: Disable texture animation doesn't work

---
 doc/contributions.txt                |  1 +
 indra/newview/llviewerobjectlist.cpp | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 7712f16ade..caeda19496 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -176,6 +176,7 @@ Ansariel Hiller
 	STORM-1713
 	STORM-1899
 	MAINT-2368
+	MAINT-2773
 Aralara Rajal
 Ardy Lay
 	STORM-859
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 66615657d8..b4e287c446 100755
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -954,15 +954,17 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
 			objectp = *idle_iter;
 			llassert(objectp->isActive());
 			objectp->idleUpdate(agent, world, frame_time);
-
-			}
+		}
 
 		//update flexible objects
 		LLVolumeImplFlexible::updateClass();
 
 		//update animated textures
-		LLViewerTextureAnim::updateClass();
-			}
+		if (gAnimateTextures)
+		{
+			LLViewerTextureAnim::updateClass();
+		}
+	}
 
 
 
-- 
cgit v1.2.3


From ecc4f2357df4cc139aa4e6a6a22f1ac5460f6871 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 26 Aug 2013 16:42:31 -0400
Subject: remove unused --logevents command line option because new validation
 causes unmapped options to be errors

---
 indra/newview/app_settings/cmd_line.xml | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index 789a07fbe2..a9f6079630 100755
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -177,14 +177,6 @@
       <string>UserLoginInfo</string>
     </map>
 
-    <key>logevents</key>
-    <map>
-      <key>desc</key>
-      <string>Log ui events for later playback</string>
-      <key>map-to</key>
-      <string>LogEvents</string>
-    </map>
-
     <key>logmetrics</key>
     <map>
       <key>desc</key>
-- 
cgit v1.2.3


From a4e74449857c57bf67104087015560baa69789ab Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 26 Aug 2013 16:43:03 -0400
Subject: correct merge error in llupdatechecker.cpp

---
 .../viewer_components/updater/llupdatechecker.cpp  | 39 +++-------------------
 1 file changed, 5 insertions(+), 34 deletions(-)

diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp
index 3e170e44f4..abdace979a 100755
--- a/indra/viewer_components/updater/llupdatechecker.cpp
+++ b/indra/viewer_components/updater/llupdatechecker.cpp
@@ -149,40 +149,11 @@ void LLUpdateChecker::Implementation::completed(U32 status,
 			server_error += content["error_text"].asString();
 		}
 
-		if (status == 404)
-		{
-			if (mProtocol == sProtocolVersion)
-			{
-				mProtocol = sLegacyProtocolVersion;
-				std::string retryUrl = buildUrl(mUrlBase, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest);
-
-				LL_WARNS("UpdaterService")
-					<< "update response using " << sProtocolVersion
-					<< " was HTTP 404 (" << server_error
-					<< "); retry with legacy protocol " << mProtocol
-					<< "\n at " << retryUrl
-					<< LL_ENDL;
-	
-				mHttpClient.get(retryUrl, this);
-			}
-			else
-			{
-				LL_WARNS("UpdaterService")
-					<< "update response using " << sLegacyProtocolVersion
-					<< " was 404 (" << server_error
-					<< "); request failed"
-					<< LL_ENDL;
-				mClient.error(reason);
-			}
-		}
-		else
-		{
-			LL_WARNS("UpdaterService") << "response error " << status
-									   << " " << reason
-									   << " (" << server_error << ")"
-									   << LL_ENDL;
-			mClient.error(reason);
-		}
+		LL_WARNS("UpdaterService") << "response error " << status
+								   << " " << reason
+								   << " (" << server_error << ")"
+								   << LL_ENDL;
+		mClient.error(reason);
 	}
 	else
 	{
-- 
cgit v1.2.3


From 7614589adcf796e889c7d1d4ccda56a4b9353d31 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 27 Aug 2013 16:31:36 -0400
Subject: MAINT-3074: Remove warning log that kills FPS

---
 indra/llui/llview.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 9a42fc637b..262d9335c0 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -995,7 +995,6 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
 
 BOOL LLView::handleUnicodeCharHere(llwchar uni_char )
 {
-	llwarns << "LLView::handleUnicodeCharHere - about to return false - key is not being handled - a class somewhere should implement this method" << llendl;
 	return FALSE;
 }
 
-- 
cgit v1.2.3


From 306b2d810effdc677194f4db26c906a59e7386ff Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 27 Aug 2013 16:27:19 -0400
Subject: Fix coding style fails

---
 indra/llui/llview.cpp | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 262d9335c0..20015dca1a 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -760,15 +760,15 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA
 		if ((viewp->*method)( local_x, local_y, extra )
 			|| (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y )))
 		{
-		lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x  "<< local_x << " " << x	<< "local/global y " << local_y << " " << y << llendl;
-		lldebugs << "LLView::childrenHandleMouseEvent  getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl;
+			lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x  "<< local_x << " " << x	<< "local/global y " << local_y << " " << y << llendl;
+			lldebugs << "LLView::childrenHandleMouseEvent  getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl;
 
-		LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); 
+			LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); 
 
-		// This is NOT event recording related
-		viewp->logMouseEvent();
+			// This is NOT event recording related
+			viewp->logMouseEvent();
 
-		return viewp;
+			return viewp;
 		}
 	}
 	return NULL;
@@ -936,7 +936,8 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
 			// For event logging we don't care which widget handles it
 			// So we capture the key at the end of this function once we know if it was handled
 			handled = handleKeyHere( key, mask );
-			if (handled) {
+			if (handled)
+			{
 				llwarns << "Key handled by " << getName() << llendl;
 			}
 		}
@@ -985,7 +986,8 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
 		handled = mParentView->handleUnicodeChar(uni_char, FALSE);
 	}
 
-	if (handled) {
+	if (handled)
+	{
 		LLViewerEventRecorder::instance().logKeyUnicodeEvent(uni_char);
 	}
 	
@@ -1018,21 +1020,16 @@ BOOL LLView::hasMouseCapture()
 
 BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask)
 {
-
-
 	LLView* r = childrenHandleMouseUp( x, y, mask );
 
 	return (r!=NULL);
-
 }
 
 BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask)
 {
-
 	LLView* r= childrenHandleMouseDown(x, y, mask );
 
 	return (r!=NULL);
-
 }
 
 BOOL LLView::handleDoubleClick(S32 x, S32 y, MASK mask)
-- 
cgit v1.2.3


From 3364614f8b3c61a369760b4effc2ed9382be75f9 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 29 Aug 2013 09:27:12 -0400
Subject: add "Settings" logging tag to make debugging settings loading easier

---
 indra/llxml/llcontrol.cpp     | 31 ++++++++++++++++---------------
 indra/newview/llappviewer.cpp | 22 +++++++++++-----------
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 16f2290787..97fad7feb0 100755
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -391,7 +391,7 @@ LLControlVariable* LLControlGroup::declareControl(const std::string& name, eCont
 		}
 		else
 		{
-			llwarns << "Control named " << name << " already exists, ignoring new declaration." << llendl;
+			LL_WARNS("Settings") << "Control named " << name << " already exists, ignoring new declaration." << LL_ENDL;
 		}
  		return existing_control;
 	}
@@ -630,14 +630,14 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
 
 	if (!xml_controls.parseFile(filename))
 	{
-		llwarns << "Unable to open control file " << filename << llendl;
+		LL_WARNS("Settings") << "Unable to open control file " << filename << LL_ENDL;
 		return 0;
 	}
 
 	LLXmlTreeNode* rootp = xml_controls.getRoot();
 	if (!rootp || !rootp->hasAttribute("version"))
 	{
-		llwarns << "No valid settings header found in control file " << filename << llendl;
+		LL_WARNS("Settings") << "No valid settings header found in control file " << filename << LL_ENDL;
 		return 0;
 	}
 
@@ -650,7 +650,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
 	// Check file version
 	if (version != CURRENT_VERSION)
 	{
-		llinfos << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << llendl;
+		LL_INFOS("Settings") << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << LL_ENDL;
 		return 0;
 	}
 
@@ -668,7 +668,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
 			if (!name.empty())
 			{
 				//read in to end of line
-				llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl;
+				LL_WARNS("Settings") << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << LL_ENDL;
 			}
 			child_nodep = rootp->getNextChild();
 			continue;
@@ -822,7 +822,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
 		LLControlVariable* control = iter->second;
 		if (!control)
 		{
-			llwarns << "Tried to save invalid control: " << iter->first << llendl;
+			LL_WARNS("Settings") << "Tried to save invalid control: " << iter->first << LL_ENDL;
 		}
 		else if( control->shouldSave(nondefault_only) )
 		{
@@ -838,12 +838,12 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
 	{
 		LLSDSerialize::toPrettyXML(settings, file);
 		file.close();
-		llinfos << "Saved to " << filename << llendl;
+		LL_INFOS("Settings") << "Saved to " << filename << LL_ENDL;
 	}
 	else
 	{
         // This is a warning because sometime we want to use settings files which can't be written...
-		llwarns << "Unable to open settings file: " << filename << llendl;
+		LL_WARNS("Settings") << "Unable to open settings file: " << filename << LL_ENDL;
 		return 0;
 	}
 	return num_saved;
@@ -856,14 +856,14 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
 	infile.open(filename);
 	if(!infile.is_open())
 	{
-		llwarns << "Cannot find file " << filename << " to load." << llendl;
+		LL_WARNS("Settings") << "Cannot find file " << filename << " to load." << LL_ENDL;
 		return 0;
 	}
 
 	if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(settings, infile))
 	{
 		infile.close();
-		llwarns << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << llendl;
+		LL_WARNS("Settings") << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << LL_ENDL;
 		return loadFromFileLegacy(filename, TRUE, TYPE_STRING);
 	}
 
@@ -976,6 +976,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
 		++validitems;
 	}
 
+	LL_DEBUGS("Settings") << "Loaded " << validitems << " settings from " << filename << LL_ENDL;
 	return validitems;
 }
 
@@ -1012,7 +1013,7 @@ void main()
 	BOOL_CONTROL baz;
 
 	U32 count = gGlobals.loadFromFile("controls.ini");
-	llinfos << "Loaded " << count << " controls" << llendl;
+	LL_INFOS("Settings") << "Loaded " << count << " controls" << LL_ENDL;
 
 	// test insertion
 	foo = new LLControlVariable<F32>("gFoo", 5.f, 1.f, 20.f);
@@ -1273,19 +1274,19 @@ LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const st
 		LLColor4 color(sd);
 		if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f)
 		{
-			llwarns << "Color " << control_name << " red value out of range: " << color << llendl;
+			LL_WARNS("Settings") << "Color " << control_name << " red value out of range: " << color << LL_ENDL;
 		}
 		else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f)
 		{
-			llwarns << "Color " << control_name << " green value out of range: " << color << llendl;
+			LL_WARNS("Settings") << "Color " << control_name << " green value out of range: " << color << LL_ENDL;
 		}
 		else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f)
 		{
-			llwarns << "Color " << control_name << " blue value out of range: " << color << llendl;
+			LL_WARNS("Settings") << "Color " << control_name << " blue value out of range: " << color << LL_ENDL;
 		}
 		else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f)
 		{
-			llwarns << "Color " << control_name << " alpha value out of range: " << color << llendl;
+			LL_WARNS("Settings") << "Color " << control_name << " alpha value out of range: " << color << LL_ENDL;
 		}
 
 		return LLColor4(sd);
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 338558c937..8a7c24c5b5 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2227,13 +2227,13 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 
 		BOOST_FOREACH(const SettingsFile& file, group.files)
 		{
-			llinfos << "Attempting to load settings for the group " << file.name()
-			    << " - from location " << location_key << llendl;
+			LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name()
+			    << " - from location " << location_key << LL_ENDL;
 
 			LLControlGroup* settings_group = LLControlGroup::getInstance(file.name);
 			if(!settings_group)
 			{
-				llwarns << "No matching settings group for name " << file.name() << llendl;
+				LL_WARNS("Settings") << "No matching settings group for name " << file.name() << LL_ENDL;
 				continue;
 			}
 
@@ -2262,7 +2262,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 
 			if(settings_group->loadFromFile(full_settings_path, set_defaults, file.persistent))
 			{	// success!
-				llinfos << "Loaded settings file " << full_settings_path << llendl;
+				LL_INFOS("Settings") << "Loaded settings file " << full_settings_path << LL_ENDL;
 			}
 			else
 			{	// failed to load
@@ -2276,7 +2276,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 					// only complain if we actually have a filename at this point
 					if (!full_settings_path.empty())
 					{
-						llinfos << "Cannot load " << full_settings_path << " - No settings found." << llendl;
+						LL_INFOS("Settings") << "Cannot load " << full_settings_path << " - No settings found." << LL_ENDL;
 					}
 				}
 			}
@@ -2435,8 +2435,8 @@ bool LLAppViewer::initConfiguration()
 			gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, 
 										   clp.getOption("settings")[0]);		
 		gSavedSettings.setString("ClientSettingsFile", user_settings_filename);
-		llinfos	<< "Using command line specified settings filename: " 
-			<< user_settings_filename << llendl;
+		LL_INFOS("Settings")	<< "Using command line specified settings filename: " 
+			<< user_settings_filename << LL_ENDL;
 	}
 
 	// - load overrides from user_settings 
@@ -2452,8 +2452,8 @@ bool LLAppViewer::initConfiguration()
 	{
 		std::string session_settings_filename = clp.getOption("sessionsettings")[0];		
 		gSavedSettings.setString("SessionSettingsFile", session_settings_filename);
-		llinfos	<< "Using session settings filename: " 
-			<< session_settings_filename << llendl;
+		LL_INFOS("Settings")	<< "Using session settings filename: " 
+			<< session_settings_filename << LL_ENDL;
 	}
 	loadSettingsFromDirectory("Session");
 
@@ -2461,8 +2461,8 @@ bool LLAppViewer::initConfiguration()
 	{
 		std::string user_session_settings_filename = clp.getOption("usersessionsettings")[0];		
 		gSavedSettings.setString("UserSessionSettingsFile", user_session_settings_filename);
-		llinfos	<< "Using user session settings filename: " 
-			<< user_session_settings_filename << llendl;
+		LL_INFOS("Settings") << "Using user session settings filename: " 
+			<< user_session_settings_filename << LL_ENDL;
 
 	}
 	loadSettingsFromDirectory("UserSession");
-- 
cgit v1.2.3


From ea305b74d124aedf64afbb89d2b3685dae49bed9 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 29 Aug 2013 12:56:20 -0400
Subject: remove refresh of search attributes from draw method in About Land
 floater; does not seem to be needed and slows things down

---
 indra/newview/llfloaterland.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index f6d4f9a605..ba9fbbc84e 100755
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2092,7 +2092,6 @@ void LLPanelLandOptions::refresh()
 // virtual
 void LLPanelLandOptions::draw()
 {
-	refreshSearch();	// Is this necessary?  JC
 	LLPanel::draw();
 }
 
-- 
cgit v1.2.3


From d43a302eaf1b0ca521d4b865e39a8d849da5d5b8 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 29 Aug 2013 16:51:59 -0400
Subject: MAINT-3075: don't display the target user name as a SLURL in the
 RequestTeleport dialog

---
 indra/newview/llavataractions.cpp                    | 9 ++++++++-
 indra/newview/skins/default/xui/en/notifications.xml | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 5f1f57f550..70cc48f12b 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -445,7 +445,14 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
 {
 	LLSD notification;
 	notification["uuid"] = id;
-	notification["NAME_SLURL"] =  LLSLURL("agent", id, "about").getSLURLString();
+	LLAvatarName av_name;
+	if (!LLAvatarNameCache::get(id, &av_name))
+	{
+		// unlikely ... they just picked this name from somewhere...
+		LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id));
+		return; // reinvoke this when the name resolves
+	}
+	notification["NAME"] = av_name.getCompleteName();
 
 	LLSD payload;
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9ed9a6f409..fce21b403b 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4073,7 +4073,7 @@ Join me in [REGION]
    icon="alertmodal.tga"
    name="TeleportRequestPrompt"
    type="alertmodal">
-Request a teleport to [NAME_SLURL] with the following message
+Request a teleport to [NAME] with the following message
     <tag>confirm</tag>
     <form name="form">
       <input name="message" type="text">
-- 
cgit v1.2.3


From 5172d4edac75fbca2209279ffd8a837cfe99434d Mon Sep 17 00:00:00 2001
From: Nicky <none@none>
Date: Tue, 3 Sep 2013 13:50:35 -0400
Subject: OPEN-187: Properly cleanup all allocated OpenSSL structures.

---
 doc/contributions.txt                |  1 +
 indra/newview/llsechandler_basic.cpp | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index a6d522de2f..17c38ce343 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -924,6 +924,7 @@ Nicky Dasmijn
 	BUG-2432
 	BUG-3605
 	CHUIBUG-197
+	OPEN-187
 Nicky Perian
 	OPEN-1
 	STORM-1087
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index 928d26646b..c4d5450e2b 100755
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -207,6 +207,7 @@ LLSD _basic_constraints_ext(X509* cert)
 			}
 		}
 
+		BASIC_CONSTRAINTS_free( bs );
 	}
 	return result;
 }
@@ -268,6 +269,8 @@ LLSD _ext_key_usage_ext(X509* cert)
 				ASN1_OBJECT_free(usage);
 			}
 		}
+
+		EXTENDED_KEY_USAGE_free( eku );
 	}
 	return result;
 }
@@ -280,6 +283,8 @@ LLSD _subject_key_identifier_ext(X509 *cert)
 	if(skeyid)
 	{
 		result = cert_string_from_octet_string(skeyid);
+
+		ASN1_OCTET_STRING_free( skeyid );
 	}
 	return result;
 }
@@ -300,6 +305,9 @@ LLSD _authority_key_identifier_ext(X509* cert)
 		{
 			result[CERT_AUTHORITY_KEY_IDENTIFIER_SERIAL] = cert_string_from_asn1_integer(akeyid->serial);
 		}	
+
+
+		AUTHORITY_KEYID_free( akeyid );
 	}
 	
 	// we ignore the issuer name in the authority key identifier, we check the issue name via
@@ -1049,6 +1057,8 @@ void LLBasicCertificateStore::validate(int validation_policy,
 		throw LLInvalidCertificate((*current_cert));			
 	}
 	std::string sha1_hash((const char *)cert_x509->sha1_hash, SHA_DIGEST_LENGTH);
+	X509_free( cert_x509 );
+	cert_x509 = NULL;
 	t_cert_cache::iterator cache_entry = mTrustedCertCache.find(sha1_hash);
 	if(cache_entry != mTrustedCertCache.end())
 	{
-- 
cgit v1.2.3


From 2108e9de5bb93d60a040ff385f50552ceed9b076 Mon Sep 17 00:00:00 2001
From: "katharine@exodusviewer.com" <katharine@exodusviewer.com>
Date: Wed, 4 Sep 2013 16:37:33 -0400
Subject: OPEN-149: fix documentation of LLColor4 constructor for F32 vector

---
 doc/contributions.txt  | 1 +
 indra/llmath/v4color.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index c377de8513..b2df058614 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -688,6 +688,7 @@ Kagehi Kohn
 Kaimen Takahe
 Katharine Berry
 	STORM-1900
+    OPEN-149
 Keklily Longfall
 Ken Lavender
 Ken March
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index b047f86e6e..8c8c315808 100755
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -50,7 +50,7 @@ class LLColor4
 		LLColor4(F32 r, F32 g, F32 b);		// Initializes LLColor4 to (r, g, b, 1)
 		LLColor4(F32 r, F32 g, F32 b, F32 a);		// Initializes LLColor4 to (r. g, b, a)
 		LLColor4(U32 clr);							// Initializes LLColor4 to (r=clr>>24, etc))
-		LLColor4(const F32 *vec);			// Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1)
+		LLColor4(const F32 *vec);			// Initializes LLColor4 to (vec[0]. vec[1], vec[2], vec[3])
 		LLColor4(const LLColor3 &vec, F32 a = 1.f);	// Initializes LLColor4 to (vec, a)
 		explicit LLColor4(const LLSD& sd);
 		explicit LLColor4(const LLColor4U& color4u);  // "explicit" to avoid automatic conversion
-- 
cgit v1.2.3


From 035ab9f3747dc555148b17b87888fcf60ccc0114 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 5 Sep 2013 11:41:19 -0400
Subject: open-183: improve local build number generation to account for
 multiple heads

---
 indra/cmake/BuildVersion.cmake | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake
index af2063ce6d..e4b63dc7cb 100755
--- a/indra/cmake/BuildVersion.cmake
+++ b/indra/cmake/BuildVersion.cmake
@@ -16,22 +16,26 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
 
         else (DEFINED ENV{revision})
            find_program(MERCURIAL hg)
-           if (DEFINED MERCURIAL)
+           find_program(WORDCOUNT wc)
+           find_program(SED sed)
+           if (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
               execute_process(
-                 COMMAND ${MERCURIAL} log -r tip --template "{rev}"
+                 COMMAND ${MERCURIAL} log -r tip:0 --template '\\n'
+                 COMMAND ${WORDCOUNT} -l
+                 COMMAND ${SED} "s/ //g"
                  OUTPUT_VARIABLE VIEWER_VERSION_REVISION
                  OUTPUT_STRIP_TRAILING_WHITESPACE
                  )
               if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
                  message("Revision (from hg) ${VIEWER_VERSION_REVISION}")
               else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
+                 message("Revision not set (repository not found?); using 0")
                  set(VIEWER_VERSION_REVISION 0 )
-                 message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}")
               endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
-           else (DEFINED MERCURIAL)
+           else (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
+              message("Revision not set: 'hg', 'wc' or 'sed' not found; using 0")
               set(VIEWER_VERSION_REVISION 0)
-              message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}")
-           endif (DEFINED MERCURIAL)
+           endif (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
         endif (DEFINED ENV{revision})
         message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
     else ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
-- 
cgit v1.2.3


From 8dc273b942ca3bae7469dcbaf7bab171b889eea1 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 5 Sep 2013 15:18:58 -0400
Subject: correct some doc strings in the autobuild config file

---
 autobuild.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index e047d4d686..3ffe77451f 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1965,11 +1965,11 @@
     <key>package_description</key>
     <map>
       <key>description</key>
-      <string>Spell checking dictionaries</string>
+      <string>Second Life Viewer</string>
       <key>license</key>
-      <string>various open</string>
+      <string>LGPL</string>
       <key>name</key>
-      <string>dictionaries</string>
+      <string>Second Life Viewer</string>
       <key>platforms</key>
       <map>
         <key>common</key>
-- 
cgit v1.2.3


From 242266890fdee3fa4b82cb50e33a88967ccf27dc Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 10 Sep 2013 14:35:53 -0400
Subject: remove llversionviewer.h (incorrectly re-created in a merge)

---
 indra/llcommon/llversionviewer.h | 41 ----------------------------------------
 1 file changed, 41 deletions(-)
 delete mode 100644 indra/llcommon/llversionviewer.h

diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
deleted file mode 100644
index 6a5ff314e4..0000000000
--- a/indra/llcommon/llversionviewer.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/** 
- * @file llversionviewer.h
- * @brief
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, 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_LLVERSIONVIEWER_H
-#define LL_LLVERSIONVIEWER_H
-
-const S32 LL_VERSION_MAJOR = 3;
-const S32 LL_VERSION_MINOR = 4;
-const S32 LL_VERSION_PATCH = 6;
-const S32 LL_VERSION_BUILD = 0;
-
-const char * const LL_CHANNEL = "Second Life Developer";
-
-#if LL_DARWIN
-const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer";
-#endif
-
-#endif
-- 
cgit v1.2.3


From f4d2e21f4fdf6953cfa375bd716b1458e3de14e8 Mon Sep 17 00:00:00 2001
From: ZaiLynch <none@none>
Date: Wed, 11 Sep 2013 12:17:22 -0400
Subject: Changing shortcut to toggle preference floater

---
 doc/contributions.txt                              | 1 +
 indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index f33cf36ec2..404103cf91 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1365,6 +1365,7 @@ YongYong Francois
 Zak Westminster
 Zai Lynch
 	VWR-19505
+    STORM-1902
 Zana Kohime
 Zaren Alexander
 Zarkonnen Decosta
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index dabfc4eebd..0e95a9d9a9 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -180,7 +180,7 @@
          name="Preferences"
          shortcut="control|P">
             <menu_item_call.on_click
-             function="Floater.Show"
+             function="Floater.Toggle"
              parameter="preferences" />
         </menu_item_call>
          <menu_item_call
-- 
cgit v1.2.3


From 0142a0c6a9c05db10423b38beab2b2b356e5f85e Mon Sep 17 00:00:00 2001
From: Drake Arconis <lightdrake@gmail.com>
Date: Wed, 11 Sep 2013 19:02:36 -0400
Subject: OPEN-189 Add missing header guard

---
 doc/contributions.txt                | 1 +
 indra/llwindow/llwindowmacosx-objc.h | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 0035d4f597..4e3ce70e0b 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1122,6 +1122,7 @@ Slee Mayo
 snowy Sidran
 Sovereign Engineer
     MAINT-2334
+    OPEN-189
 SpacedOut Frye
 	VWR-34
 	VWR-45
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index 32b3bfb078..3b6295fba8 100755
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -25,6 +25,9 @@
  * $/LicenseInfo$
  */
 
+#ifndef LL_LLWINDOWMACOSX_OBJC_H
+#define LL_LLWINDOWMACOSX_OBJC_H
+
 #include <map>
 #include <vector>
 
@@ -143,3 +146,5 @@ NSWindowRef getMainAppWindow();
 GLViewRef getGLView();
 
 unsigned int getModifiers();
+
+#endif // LL_LLWINDOWMACOSX_OBJC_H
-- 
cgit v1.2.3


From bcff609fb839dc576c7e4f7529e1c751847ffd32 Mon Sep 17 00:00:00 2001
From: JJ Linden <jj@lindenlab.com>
Date: Mon, 16 Sep 2013 12:58:40 -0700
Subject: changes for additional packages to be packaged from the same build.
 see BuildParams for example environment variables used to specify the
 packages and their channels and sourceids. also updated mac packages to use a
 larger virtual drive and auto-open on download

---
 BuildParams                               |  7 ++-
 build.sh                                  | 28 ++++++++--
 indra/lib/python/indra/util/llmanifest.py | 87 ++++++++++++++++++++++++++++++-
 indra/newview/viewer_manifest.py          | 41 ++++++++-------
 4 files changed, 135 insertions(+), 28 deletions(-)

diff --git a/BuildParams b/BuildParams
index 327530934d..63812d33c1 100755
--- a/BuildParams
+++ b/BuildParams
@@ -26,8 +26,13 @@ codeticket_since = 3.3.0-release
 Linux.gcc_version = /usr/bin/gcc-4.6
 Linux.cxx_version = /usr/bin/g++-4.6
 
-# Setup default sourceid so Windows can pick up the TeamCity override
+# Setup default packaging parameters.
 sourceid = ""
+additional_packages = "Amazon Desura"
+Amazon_sourceid = "1207v_Amazon"
+Amazon_viewer_channel_suffix = " Amazon"
+Desura_sourceid = "1208_desura"
+Desura_viewer_channel_suffix = " Desura"
 
 ################################################################
 ####      Examples of how to set the viewer_channel         ####
diff --git a/build.sh b/build.sh
index a78f368e47..4875ef39f7 100755
--- a/build.sh
+++ b/build.sh
@@ -38,22 +38,22 @@ build_dir_CYGWIN()
 
 installer_Darwin()
 {
-  ls -1td "$(build_dir_Darwin ${last_built_variant:-Release})/newview/"*.dmg 2>/dev/null | sed 1q
+  ls -1tr "$(build_dir_Darwin ${last_built_variant:-Release})/newview/"*"$additional_package_name"*.dmg 2>/dev/null | sed 1q
 }
 
 installer_Linux()
 {
-  ls -1td "$(build_dir_Linux ${last_built_variant:-Release})/newview/"*.tar.bz2 2>/dev/null | sed 1q
+  ls -1tr "$(build_dir_Linux ${last_built_variant:-Release})/newview/"*"$additional_package_name"*.tar.bz2 2>/dev/null | grep -v symbols | sed 1q
 }
 
 installer_CYGWIN()
 {
   v=${last_built_variant:-Release}
   d=$(build_dir_CYGWIN $v)
-  if [ -r "$d/newview/$v/touched.bat" ]
+  if [ -r "$d/newview/$additional_package_name$v/touched.bat" ]
   then
-    p=$(sed 's:.*=::' "$d/newview/$v/touched.bat")
-    echo "$d/newview/$v/$p"
+    p=$(sed 's:.*=::' "$d/newview/$additional_package_name$v/touched.bat")
+    echo "$d/newview/$additional_package_name$v/$p"
   fi
 }
 
@@ -355,10 +355,28 @@ then
       # Coverity doesn't package, so it's ok, anything else is fail
       succeeded=$build_coverity
     else
+      # Upload base package.
       upload_item installer "$package" binary/octet-stream
       upload_item quicklink "$package" binary/octet-stream
       [ -f $build_dir/summary.json ] && upload_item installer $build_dir/summary.json text/plain
 
+      # Upload additional packages.
+      for package_id in $additional_packages
+      do
+        case $arch in
+        CYGWIN) export additional_package_name="$package_id/" ;;
+        *) export additional_package_name=$package_id ;;
+        esac
+        package=$(installer_$arch)
+        if [ x"$package" != x ]
+        then
+          upload_item installer "$package" binary/octet-stream
+        else
+          record_failure "Failed to upload $package_id package."
+        fi
+      done
+      export additional_package_name=""
+
       case "$last_built_variant" in
       Release)
         # Upload crash reporter files
diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py
index 54049b5545..52b4acbc94 100755
--- a/indra/lib/python/indra/util/llmanifest.py
+++ b/indra/lib/python/indra/util/llmanifest.py
@@ -224,15 +224,98 @@ def main():
     for opt in args:
         print "Option:", opt, "=", args[opt]
 
+    # pass in sourceid as an argument now instead of an environment variable
+    try:
+        args['sourceid'] = os.environ["sourceid"]
+    except KeyError:
+        args['sourceid'] = ""
+
+    # Build base package.
+    touch = args.get('touch')
+    if touch:
+        print 'Creating base package'
+    args['package_id'] = "" # base package has no package ID
     wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
     wm.do(*args['actions'])
-
+    # Store package file for later if making touched file.
+    base_package_file = ""
+    if touch:
+        print 'Created base package ', wm.package_file
+        base_package_file = "" + wm.package_file
+
+    # handle multiple packages if set
+    try:
+        additional_packages = os.environ["additional_packages"]
+    except KeyError:
+        additional_packages = ""
+    if additional_packages:
+        # Determine destination prefix / suffix for additional packages.
+        base_dest_postfix = args['dest']
+        base_dest_prefix = ""
+        base_dest_parts = args['dest'].split(os.sep)
+        if len(base_dest_parts) > 1:
+            base_dest_postfix = base_dest_parts[len(base_dest_parts) - 1]
+            base_dest_prefix = base_dest_parts[0]
+            i = 1
+            while i < len(base_dest_parts) - 1:
+                base_dest_prefix = base_dest_prefix + os.sep + base_dest_parts[i]
+                i = i + 1
+        # Determine touched prefix / suffix for additional packages.
+        base_touch_postfix = ""
+        base_touch_prefix = ""
+        if touch:
+            base_touch_postfix = touch
+            base_touch_parts = touch.split('/')
+            if "arwin" in args['platform']:
+                if len(base_touch_parts) > 1:
+                    base_touch_postfix = base_touch_parts[len(base_touch_parts) - 1]
+                    base_touch_prefix = base_touch_parts[0]
+                    i = 1
+                    while i < len(base_touch_parts) - 1:
+                        base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
+                        i = i + 1
+            else:
+                if len(base_touch_parts) > 2:
+                    base_touch_postfix = base_touch_parts[len(base_touch_parts) - 2] + '/' + base_touch_parts[len(base_touch_parts) - 1]
+                    base_touch_prefix = base_touch_parts[0]
+                    i = 1
+                    while i < len(base_touch_parts) - 2:
+                        base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
+                        i = i + 1
+        # Store base channel name.
+        base_channel_name = args['channel']
+        # Build each additional package.
+        package_id_list = additional_packages.split(" ")
+        for package_id in package_id_list:
+            try:
+                args['package_id'] = package_id
+                args['channel'] = base_channel_name + os.environ[package_id + "_viewer_channel_suffix"]
+                if package_id + "_sourceid" in os.environ:
+                    args['sourceid'] = os.environ[package_id + "_sourceid"]
+                else:
+                    args['sourceid'] = ""
+                args['dest'] = base_dest_prefix + os.sep + package_id + os.sep + base_dest_postfix
+            except KeyError:
+                sys.stderr.write("Failed to create package for package_id: %s" % package_id)
+                sys.stderr.flush()
+                continue
+            if touch:
+                print 'Creating additional package for ', package_id, ' in ', args['dest']
+            wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
+            wm.do(*args['actions'])
+            if touch:
+                print 'Created additional package ', wm.package_file, ' for ', package_id
+                faketouch = base_touch_prefix + '/' + package_id + '/' + base_touch_postfix
+                fp = open(faketouch, 'w')
+                fp.write('set package_file=%s\n' % wm.package_file)
+                fp.close()
+    
     # Write out the package file in this format, so that it can easily be called
     # and used in a .bat file - yeah, it sucks, but this is the simplest...
     touch = args.get('touch')
     if touch:
         fp = open(touch, 'w')
-        fp.write('set package_file=%s\n' % wm.package_file)
+        fp.write('set package_file=%s\n' % base_package_file)
         fp.close()
         print 'touched', touch
     return 0
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 19863dd845..effe3994a3 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -106,24 +106,18 @@ class ViewerManifest(LLManifest):
 
                 # CHOP-955: If we have "sourceid" in the build process
                 # environment, generate it into settings_install.xml.
-                try:
-                    sourceid = os.environ["sourceid"]
-                except KeyError:
-                    # no sourceid, no settings_install.xml file
-                    pass
-                else:
-                    if sourceid:
-                        # Single-entry subset of the LLSD content of settings.xml
-                        content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers',
-                                                     Persist=1,
-                                                     Type='String',
-                                                     Value=sourceid))
-                        # put_in_file(src=) need not be an actual pathname; it
-                        # only needs to be non-empty
-                        settings_install = self.put_in_file(llsd.format_pretty_xml(content),
-                                                            "settings_install.xml",
-                                                            src="environment")
-                        print "Put sourceid '%s' in %s" % (sourceid, settings_install)
+                if self.args['sourceid']:
+                    # Single-entry subset of the LLSD content of settings.xml
+                    content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers',
+                                                 Persist=1,
+                                                 Type='String',
+                                                 Value=self.args['sourceid']))
+                    # put_in_file(src=) need not be an actual pathname; it
+                    # only needs to be non-empty
+                    settings_install = self.put_in_file(llsd.format_pretty_xml(content),
+                                                        "settings_install.xml",
+                                                        src="environment")
+                    print "Put sourceid '%s' in %s" % (self.args['sourceid'], settings_install)
 
                 self.end_prefix("app_settings")
 
@@ -611,6 +605,9 @@ class WindowsManifest(ViewerManifest):
             installer_file = self.args['installer_name']
         else:
             installer_file = installer_file % substitution_strings
+        if len(self.args['package_id']) > 0:
+            installer_file = installer_file.replace(self.args['package_id'], "")
+            installer_file = installer_file.replace(".exe", self.args['package_id'] + ".exe")
         substitution_strings['installer_file'] = installer_file
 
         tempfile = "secondlife_setup_tmp.nsi"
@@ -838,7 +835,9 @@ class DarwinManifest(ViewerManifest):
 
         volname="Second Life Installer"  # DO NOT CHANGE without understanding comment above
 
-        if self.default_channel():
+        if len(self.args['package_id']) > 0:
+            imagename = imagename + self.args['package_id']
+        elif self.default_channel():
             if not self.default_grid():
                 # beta case
                 imagename = imagename + '_' + self.args['grid'].upper()
@@ -851,7 +850,7 @@ class DarwinManifest(ViewerManifest):
         # make sure we don't have stale files laying about
         self.remove(sparsename, finalname)
 
-        self.run_command('hdiutil create %(sparse)r -volname %(vol)r -fs HFS+ -type SPARSE -megabytes 700 -layout SPUD' % {
+        self.run_command('hdiutil create %(sparse)r -volname %(vol)r -fs HFS+ -type SPARSE -megabytes 1000 -layout SPUD' % {
                 'sparse':sparsename,
                 'vol':volname})
 
@@ -926,6 +925,7 @@ class DarwinManifest(ViewerManifest):
 
         print "Converting temp disk image to final disk image"
         self.run_command('hdiutil convert %(sparse)r -format UDZO -imagekey zlib-level=9 -o %(final)r' % {'sparse':sparsename, 'final':finalname})
+        self.run_command('hdiutil internet-enable -yes %(final)r' % {'final':finalname})
         # get rid of the temp file
         self.package_file = finalname
         self.remove(sparsename)
@@ -998,6 +998,7 @@ class LinuxManifest(ViewerManifest):
                     installer_name += '_' + self.args['grid'].upper()
             else:
                 installer_name += '_' + self.channel_oneword().upper()
+        installer_name = installer_name + self.args['package_id']
 
         self.strip_binaries()
 
-- 
cgit v1.2.3


From be84aefc40719dacb9ab2c0ace9a2a706d768ffc Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 18 Sep 2013 10:42:43 -0700
Subject: add experimental packaging

---
 BuildParams | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/BuildParams b/BuildParams
index 63812d33c1..0d7a0b5a51 100755
--- a/BuildParams
+++ b/BuildParams
@@ -26,14 +26,6 @@ codeticket_since = 3.3.0-release
 Linux.gcc_version = /usr/bin/gcc-4.6
 Linux.cxx_version = /usr/bin/g++-4.6
 
-# Setup default packaging parameters.
-sourceid = ""
-additional_packages = "Amazon Desura"
-Amazon_sourceid = "1207v_Amazon"
-Amazon_viewer_channel_suffix = " Amazon"
-Desura_sourceid = "1208_desura"
-Desura_viewer_channel_suffix = " Desura"
-
 ################################################################
 ####      Examples of how to set the viewer_channel         ####
 #
@@ -54,6 +46,18 @@ Desura_viewer_channel_suffix = " Desura"
 ################################################################
 viewer_channel = "Second Life Test"
 
+# Setup default packaging parameters.
+sourceid = ""
+additional_packages = "Amazon Desura B C"
+Amazon_sourceid = "1207v_Amazon"
+Amazon_viewer_channel_suffix = " Amazon"
+Desura_sourceid = "1208_desura"
+Desura_viewer_channel_suffix = " Desura"
+B_sourceid = "1301_B"
+B_viewer_channel_suffix = " B"
+C_sourceid = "1302_C"
+C_viewer_channel_suffix = " C"
+
 # Report changes since...
 viewer-development.show_changes_since = last_sprint
 
-- 
cgit v1.2.3


From 6c13c4dd552a05cf055a90bdd90937de9f3903a5 Mon Sep 17 00:00:00 2001
From: JJ Linden <jj@lindenlab.com>
Date: Mon, 23 Sep 2013 13:26:24 -0700
Subject: made change to include channel name in the settings_install.xml file
 generated. changed so that sourceid is not part of a list of options pulled
 into that file, along with the channel

---
 indra/newview/viewer_manifest.py | 41 ++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index effe3994a3..894e368427 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -104,20 +104,37 @@ class ViewerManifest(LLManifest):
                     self.path("dictionaries")
                     self.end_prefix(pkgdir)
 
-                # CHOP-955: If we have "sourceid" in the build process
-                # environment, generate it into settings_install.xml.
-                if self.args['sourceid']:
-                    # Single-entry subset of the LLSD content of settings.xml
-                    content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers',
-                                                 Persist=1,
-                                                 Type='String',
-                                                 Value=self.args['sourceid']))
+                # CHOP-955: If we have "sourceid" or "viewer_channel" in the
+                # build process environment, generate it into
+                # settings_install.xml.
+                settings_template = dict(
+                    sourceid=dict(Comment='Identify referring agency to Linden web servers',
+                                  Persist=1,
+                                  Type='String',
+                                  Value=''),
+                    CmdLineChannel=dict(Comment='Command line specified channel name',
+                                        Persist=0,
+                                        Type='String',
+                                        Value=''))
+                settings_install = {}
+                for key, setting in (("sourceid", "sourceid"),
+                                     ("channel", "CmdLineChannel")):
+                    if key in self.args:
+                        # only set if value is non-empty
+                        if self.args[key]:
+                            # copy corresponding setting from settings_template
+                            settings_install[setting] = settings_template[setting].copy()
+                            # then fill in Value
+                            settings_install[setting]["Value"] = self.args[key]
+                            print "Put %s '%s' in settings_install.xml" % (setting, self.args[key])
+
+                # did we actually copy anything into settings_install dict?
+                if settings_install:
                     # put_in_file(src=) need not be an actual pathname; it
                     # only needs to be non-empty
-                    settings_install = self.put_in_file(llsd.format_pretty_xml(content),
-                                                        "settings_install.xml",
-                                                        src="environment")
-                    print "Put sourceid '%s' in %s" % (self.args['sourceid'], settings_install)
+                    self.put_in_file(llsd.format_pretty_xml(settings_install),
+                                     "settings_install.xml",
+                                     src="environment")
 
                 self.end_prefix("app_settings")
 
-- 
cgit v1.2.3


From ba7a564700ba20c6ece7ab16197c2415ebec42cb Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Thu, 3 Oct 2013 18:21:19 -0400
Subject: improve preference label for fly/jump

---
 indra/newview/skins/default/xui/en/panel_preferences_move.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index 198fcf9355..8794e3bf95 100755
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -133,7 +133,7 @@
    control_name="AutomaticFly"
    follows="left|top"
    height="20"
-   label="Fly/land on holding up/down"
+   label="Hold jump or crouch key to start or stop flying"
    layout="topleft"
    left_delta="0"
    name="automatic_fly"
@@ -270,4 +270,4 @@
      function="Floater.Show"
      parameter="pref_joystick" />
   </button>
-</panel>
\ No newline at end of file
+</panel>
-- 
cgit v1.2.3


From 913e55b5ce4c5e018d18678b9a78b06541976da1 Mon Sep 17 00:00:00 2001
From: simon <none@none>
Date: Wed, 16 Oct 2013 12:06:42 -0700
Subject: MAINT-3312 : crash in LLVOAvatar::lazyAttach().   Reverted some
 earlier changes

---
 indra/newview/llvoavatar.cpp | 50 +++++++++++++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6d29919784..f92fa0371e 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5523,7 +5523,12 @@ void LLVOAvatar::addChild(LLViewerObject *childp)
 	{
 		if (!attachObject(childp))
 		{
-			mPendingAttachment.push_back(childp);
+			llwarns << "addChild() failed for " 
+					<< childp->getID()
+					<< " item " << childp->getAttachmentItemID()
+					<< llendl;
+			// MAINT-3312 backout
+			// mPendingAttachment.push_back(childp);
 		}
 	}
 	else
@@ -5557,21 +5562,26 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
 
 	if (!attachment)
 	{
-		llwarns << "Object attachment point invalid: " << attachmentID << llendl;
+		llwarns << "Object attachment point invalid: " << attachmentID 
+			<< " trying to use 1 (chest)"
+			<< llendl;
 
-		for (int i = 0; i < 15 && !attachment; i++)
+		attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL);	// Arbitrary using 1 (chest)
+		if (attachment)
 		{
-			attachment = get_if_there(mAttachmentPoints, i, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
-
-			if (attachment)
-			{
-				llwarns << "Object attachment point falling back to : " << i << llendl;
-			}
+			llwarns << "Object attachment point invalid: " << attachmentID 
+				<< " on object " << viewer_object->getID()
+				<< " attachment item " << viewer_object->getAttachmentItemID()
+				<< " falling back to 1 (chest)"
+				<< llendl;
 		}
-		
-		if (!attachment)
+		else
 		{
-			llerrs << "Could not find any object attachment point for: " << attachmentID << llendl;
+			llwarns << "Object attachment point invalid: " << attachmentID 
+				<< " on object " << viewer_object->getID()
+				<< " attachment item " << viewer_object->getAttachmentItemID()
+				<< "Unable to use fallback attachment point 1 (chest)"
+				<< llendl;
 		}
 	}
 
@@ -5643,16 +5653,22 @@ void LLVOAvatar::lazyAttach()
 	
 	for (U32 i = 0; i < mPendingAttachment.size(); i++)
 	{
-		if (mPendingAttachment[i]->mDrawable)
+		LLPointer<LLViewerObject> cur_attachment = mPendingAttachment[i];
+		if (cur_attachment->mDrawable)
 		{
-			if (!attachObject(mPendingAttachment[i]))
-			{
-				still_pending.push_back(mPendingAttachment[i]);
+			if (!attachObject(cur_attachment))
+			{	// Drop it
+				llwarns << "attachObject() failed for " 
+					<< cur_attachment->getID()
+					<< " item " << cur_attachment->getAttachmentItemID()
+					<< llendl;
+				// MAINT-3312 backout
+				//still_pending.push_back(cur_attachment);
 			}
 		}
 		else
 		{
-			still_pending.push_back(mPendingAttachment[i]);
+			still_pending.push_back(cur_attachment);
 		}
 	}
 
-- 
cgit v1.2.3


From d61b6425b7a90b50ea121656ac34cc2a989f9bfb Mon Sep 17 00:00:00 2001
From: MaximB ProductEngine <mberezhnoy@productengine.com>
Date: Thu, 17 Oct 2013 00:47:55 +0300
Subject: MAINT-3294 (Microphone button clipped when resizing Conversations
 List in CHUI)

---
 indra/newview/skins/default/xui/en/floater_im_container.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
index b639d534c3..28c89868bd 100755
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -42,7 +42,7 @@
          user_resize="true"        
          name="conversations_layout_panel"
          min_dim="43"
-         expanded_min_dim="136">
+         expanded_min_dim="140">
             <layout_stack
              animate="false" 
              follows="left|top|right"
@@ -100,7 +100,7 @@
                 <layout_panel
                  auto_resize="false"
                  name="conversations_pane_buttons_collapsed"
-                 width="36">
+                 width="35">
                     <button
                      follows="right|top"
                      height="25"
@@ -110,10 +110,10 @@
                      image_unselected="Toolbar_Middle_Off"
                      layout="topleft"
                      top="1"
-                     left="5"
+                     left="4"
                      name="expand_collapse_btn"
                      tool_tip="Collapse/Expand this list"
-                     width="34" />
+                     width="35" />
                 </layout_panel>
             </layout_stack>
             <panel
-- 
cgit v1.2.3


From 4621aedc37bd8ad4042fe29283a2309d94264938 Mon Sep 17 00:00:00 2001
From: eli <none@none>
Date: Wed, 16 Oct 2013 17:10:14 -0700
Subject: fix INTL-126 fix incorrectly translated Boolean values in XUI; remove
 some obsolete strings

---
 .../newview/skins/default/xui/da/floater_tools.xml |  4 ----
 .../default/xui/da/panel_preferences_graphics1.xml | 10 +++++-----
 .../default/xui/da/panel_preferences_setup.xml     |  5 ++---
 .../newview/skins/default/xui/de/floater_tools.xml |  5 -----
 .../default/xui/es/floater_hardware_settings.xml   |  2 +-
 .../newview/skins/default/xui/es/floater_tools.xml |  5 -----
 .../default/xui/es/panel_preferences_graphics1.xml | 10 +++++-----
 .../default/xui/es/panel_preferences_setup.xml     |  2 +-
 .../default/xui/es/panel_preferences_sound.xml     |  2 +-
 .../skins/default/xui/es/panel_tools_texture.xml   |  2 +-
 .../default/xui/fr/floater_hardware_settings.xml   |  2 +-
 .../newview/skins/default/xui/fr/floater_tools.xml |  5 -----
 .../newview/skins/default/xui/it/floater_tools.xml |  5 -----
 .../default/xui/it/panel_preferences_graphics1.xml |  2 +-
 .../default/xui/it/panel_preferences_setup.xml     |  2 +-
 .../skins/default/xui/it/panel_tools_texture.xml   |  2 +-
 .../newview/skins/default/xui/ja/floater_tools.xml |  5 -----
 .../newview/skins/default/xui/pl/floater_tools.xml |  5 -----
 .../default/xui/pl/panel_preferences_graphics1.xml |  2 +-
 .../default/xui/pl/panel_preferences_setup.xml     |  5 ++---
 .../newview/skins/default/xui/pt/floater_tools.xml |  5 -----
 .../default/xui/pt/panel_preferences_graphics1.xml | 10 +++++-----
 .../default/xui/pt/panel_preferences_setup.xml     |  2 +-
 .../default/xui/pt/panel_preferences_sound.xml     |  2 +-
 .../skins/default/xui/ru/floater_auction.xml       |  2 +-
 .../skins/default/xui/ru/floater_bulk_perms.xml    |  2 +-
 .../default/xui/ru/floater_hardware_settings.xml   |  2 +-
 .../default/xui/ru/floater_live_lsleditor.xml      |  4 ++--
 .../skins/default/xui/ru/floater_perm_prefs.xml    |  2 +-
 .../default/xui/ru/floater_preferences_proxy.xml   |  2 +-
 .../default/xui/ru/floater_settings_debug.xml      |  2 +-
 .../skins/default/xui/ru/floater_texture_ctrl.xml  |  4 ++--
 .../newview/skins/default/xui/ru/floater_tools.xml | 11 +++--------
 .../skins/default/xui/ru/floater_world_map.xml     |  2 +-
 .../skins/default/xui/ru/panel_group_general.xml   |  2 +-
 .../xui/ru/panel_media_settings_general.xml        | 10 +++++-----
 .../xui/ru/panel_media_settings_permissions.xml    | 12 ++++++------
 .../xui/ru/panel_media_settings_security.xml       |  2 +-
 .../default/xui/ru/panel_preferences_general.xml   |  2 +-
 .../default/xui/ru/panel_preferences_graphics1.xml | 22 +++++++++++-----------
 .../default/xui/ru/panel_preferences_setup.xml     |  8 ++++----
 .../default/xui/ru/panel_preferences_sound.xml     |  8 ++++----
 .../skins/default/xui/ru/panel_tools_texture.xml   |  2 +-
 .../newview/skins/default/xui/tr/floater_tools.xml |  5 -----
 .../newview/skins/default/xui/zh/floater_tools.xml |  5 -----
 .../default/xui/zh/panel_preferences_setup.xml     |  2 +-
 46 files changed, 79 insertions(+), 135 deletions(-)

diff --git a/indra/newview/skins/default/xui/da/floater_tools.xml b/indra/newview/skins/default/xui/da/floater_tools.xml
index 815bde456e..9be129bbf6 100755
--- a/indra/newview/skins/default/xui/da/floater_tools.xml
+++ b/indra/newview/skins/default/xui/da/floater_tools.xml
@@ -462,10 +462,6 @@
 				<combo_box.item label="Rør" name="suction"/>
 				<combo_box.item label="Væv" name="weave"/>
 			</combo_box>
-			<check_box initial_value="falsk" label="Flugt planare overflader" name="checkbox planar align" tool_tip="Flugt teksuter på alle valgte overflader med den sidst valgte overflade. Kræver at planar tekstur-mapning er valgt."/>
-			<text name="rpt">
-				Gentagelser / overflade
-			</text>
 			<spinner label="Vandret (U)" name="TexScaleU"/>
 			<check_box label="Vend" name="checkbox flip s"/>
 			<spinner label="Lodret (V)" name="TexScaleV"/>
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml
index 72200a07ad..e494b2b755 100755
--- a/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml
@@ -26,14 +26,14 @@
 		<text name="ShadersText">
 			Overflader:
 		</text>
-		<check_box initial_value="sand" label="Gennemsigtig vand" name="TransparentWater"/>
+		<check_box initial_value="true" label="Gennemsigtig vand" name="TransparentWater"/>
 		<check_box initial_value="true" label="Glatte flader og skin" name="BumpShiny"/>
-		<check_box initial_value="sand" label="Lokale lys" name="LocalLights"/>
+		<check_box initial_value="true" label="Lokale lys" name="LocalLights"/>
 		<check_box initial_value="true" label="Basale flader" name="BasicShaders" tool_tip="Ved at slå dette valg fra, kan det forhindres at visse grafikkort drivere crasher."/>
 		<check_box initial_value="true" label="Atmosfæriske flader" name="WindLightUseAtmosShaders"/>
-		<check_box initial_value="sand" label="Lys og skygger" name="UseLightShaders"/>
-		<check_box initial_value="sand" label="&quot;Ambient Occlusion&quot;" name="UseSSAO"/>
-		<check_box initial_value="sand" label="Skarphedsdybde" name="UseDoF"/>
+		<check_box initial_value="true" label="Lys og skygger" name="UseLightShaders"/>
+		<check_box initial_value="true" label="&quot;Ambient Occlusion&quot;" name="UseSSAO"/>
+		<check_box initial_value="true" label="Skarphedsdybde" name="UseDoF"/>
 		<text name="shadows_label">
 			Skygger:
 		</text>
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_setup.xml b/indra/newview/skins/default/xui/da/panel_preferences_setup.xml
index 479e98817e..7be9a9d555 100755
--- a/indra/newview/skins/default/xui/da/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/da/panel_preferences_setup.xml
@@ -26,14 +26,13 @@
 		Web:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Benyt min browser(IE, Firefox, Safari)" name="external" tool_tip="Brug systemets standard web browser til hjælp, web links, m.v. Ikke anbefalet hvis du kører i fuld-skærm." value="1"/>
+		<radio_item label="Benyt min browser(IE, Firefox, Safari)" name="external" tool_tip="Brug systemets standard web browser til hjælp, web links, m.v. Ikke anbefalet hvis du kører i fuld-skærm." value="true"/>
 		<radio_item label="Benyt den indbyggede browser" name="internal" tool_tip="Brug den indbyggede web browser til hjælp, web links m.v. Denne browser åbner et nyt vindue i [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Aktivér plugins" name="browser_plugins_enabled"/>
 	<check_box initial_value="true" label="Acceptér cookies" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Aktivér Javascript" name="browser_javascript_enabled"/>
-	<check_box initial_value="fra" label="Tilad media browser pop-ups" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Aktivér web proxy" name="web_proxy_enabled"/>
+	<check_box initial_value="false" label="Tilad media browser pop-ups" name="media_popup_enabled"/>	
 	<text name="Proxy location">
 		Proxy placering:
 	</text>
diff --git a/indra/newview/skins/default/xui/de/floater_tools.xml b/indra/newview/skins/default/xui/de/floater_tools.xml
index 5f5c34a5cf..6634a4bd90 100755
--- a/indra/newview/skins/default/xui/de/floater_tools.xml
+++ b/indra/newview/skins/default/xui/de/floater_tools.xml
@@ -466,16 +466,11 @@
 				<combo_box.item label="Saugen" name="suction"/>
 				<combo_box.item label="gewoben" name="weave"/>
 			</combo_box>
-			<check_box initial_value="falsch" label="Flache Oberflächen ausrichten" name="checkbox planar align" tool_tip="Texturen auf allen ausgewählten Oberflächen an der zuletzt ausgewählten Oberfläche ausrichten. Planar Texture Mapping erforderlich."/>
-			<text name="rpt">
-				Wiederholungen / Oberfläche
-			</text>
 			<spinner label="Horizontal (U)" name="TexScaleU"/>
 			<check_box label="Umkehren" name="checkbox flip s"/>
 			<spinner label="Vertikal (V)" name="TexScaleV"/>
 			<check_box label="Umkehren" name="checkbox flip t"/>
 			<spinner label="Rotation˚" name="TexRot"/>
-			<spinner label="Wiederholungen / Meter" name="rptctrl"/>
 			<button label="Übernehmen" label_selected="Übernehmen" name="button apply"/>
 			<text name="tex offset">
 				Texture-Versatz
diff --git a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
index c351db5eae..c2327c96c4 100755
--- a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml
@@ -28,7 +28,7 @@
 	<text name="tc label">
 		Activar S3TC:
 	</text>
-	<check_box initial_value="verdadero" label="Activar la compresión de texturas (requiere reiniciar)" name="texture compression" tool_tip="Comprime las texturas de la memoria de vídeo, lo cual permite cargar texturas de una resolución más alta, pero con una cierta pérdida de calidad del color."/>
+	<check_box initial_value="true" label="Activar la compresión de texturas (requiere reiniciar)" name="texture compression" tool_tip="Comprime las texturas de la memoria de vídeo, lo cual permite cargar texturas de una resolución más alta, pero con una cierta pérdida de calidad del color."/>
 	<slider label="Memoria para texturas (MB):" name="GraphicsCardTextureMemory" tool_tip="Cantidad de memoria asignada a las texturas. Por defecto es la memoria de la tarjeta de vídeo. Reducir esta cantidad puede mejorar el rendimiento, pero también hacer que las texturas se vean borrosas."/>
 	<spinner label="Intensidad de la niebla:" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/es/floater_tools.xml b/indra/newview/skins/default/xui/es/floater_tools.xml
index 15462c3726..32baa5bb7d 100755
--- a/indra/newview/skins/default/xui/es/floater_tools.xml
+++ b/indra/newview/skins/default/xui/es/floater_tools.xml
@@ -443,16 +443,11 @@
 				<combo_box.item label="succión" name="suction"/>
 				<combo_box.item label="tejido" name="weave"/>
 			</combo_box>
-			<check_box initial_value="falso" label="Alinear caras del plano" name="checkbox planar align" tool_tip="Alinear texturas en todas las caras seleccionadas con la última cara seleccionada. Requiere la representación de texturas en el plano."/>
-			<text name="rpt">
-				Repeticiones por cara
-			</text>
 			<spinner label="Horizontal (U)" name="TexScaleU"/>
 			<check_box label="Voltear" name="checkbox flip s"/>
 			<spinner label="Vertical (V)" name="TexScaleV"/>
 			<check_box label="Voltear" name="checkbox flip t"/>
 			<spinner label="Rotación" name="TexRot"/>
-			<spinner label="Repeticiones / Metro" name="rptctrl"/>
 			<button label="Aplicar" label_selected="Aplicar" name="button apply"/>
 			<text name="tex offset">
 				Desplazar
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml
index 9362f76708..a9eab74e2b 100755
--- a/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml
@@ -25,14 +25,14 @@
 		<text name="ShadersText">
 			Shaders:
 		</text>
-		<check_box initial_value="verdadero" label="Agua transparente" name="TransparentWater"/>
+		<check_box initial_value="true" label="Agua transparente" name="TransparentWater"/>
 		<check_box initial_value="true" label="Efecto de relieve y brillo" name="BumpShiny"/>
-		<check_box initial_value="verdadero" label="Luces locales" name="LocalLights"/>
+		<check_box initial_value="true" label="Luces locales" name="LocalLights"/>
 		<check_box initial_value="true" label="Shaders básicos" name="BasicShaders" tool_tip="Desactivando esta opción puede prevenir fallos en algunos controladores de la tarjeta gráfica."/>
 		<check_box initial_value="true" label="Shaders de la atmósfera" name="WindLightUseAtmosShaders"/>
-		<check_box initial_value="verdadero" label="Modelo de iluminación avanzado" name="UseLightShaders"/>
-		<check_box initial_value="verdadero" label="Oclusión del ambiente" name="UseSSAO"/>
-		<check_box initial_value="verdadero" label="Profundidad del campo" name="UseDoF"/>
+		<check_box initial_value="true" label="Modelo de iluminación avanzado" name="UseLightShaders"/>
+		<check_box initial_value="true" label="Oclusión del ambiente" name="UseSSAO"/>
+		<check_box initial_value="true" label="Profundidad del campo" name="UseDoF"/>
 		<text name="shadows_label">
 			Sombras:
 		</text>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
index f7eaa03d63..508bfbcd32 100755
--- a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml
@@ -21,7 +21,7 @@
 	<check_box initial_value="true" label="Activar plugins" name="browser_plugins_enabled"/>
 	<check_box initial_value="true" label="Aceptar las &apos;cookies&apos;" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Activar Javascript" name="browser_javascript_enabled"/>
-	<check_box initial_value="falso" label="Permitir las ventanas emergentes en el navegador" name="media_popup_enabled"/>
+	<check_box initial_value="false" label="Permitir las ventanas emergentes en el navegador" name="media_popup_enabled"/>
 	<text name="Software updates:">
 		Actualizaciones de software:
 	</text>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_sound.xml b/indra/newview/skins/default/xui/es/panel_preferences_sound.xml
index 5cb1654c70..dcd6984715 100755
--- a/indra/newview/skins/default/xui/es/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_sound.xml
@@ -19,7 +19,7 @@
 	<check_box label="Activado" name="enable_voice_check"/>
 	<check_box label="Permitir la ejecución automática de los media" name="media_auto_play_btn" tool_tip="Marcar esto para permitir la ejecución automática de los media" value="true"/>
 	<check_box label="Ejecutar para otros avatares los media anexados" name="media_show_on_others_btn" tool_tip="Al desmarcar esto se esconderán los media anexados a otros avatares cercanos" value="true"/>
-	<check_box label="Reproducir sonidos de los gestos" name="gesture_audio_play_btn" tool_tip="Selecciona esta opción para escuchar los sonidos de los gestos" value="verdadero"/>
+	<check_box label="Reproducir sonidos de los gestos" name="gesture_audio_play_btn" tool_tip="Selecciona esta opción para escuchar los sonidos de los gestos" value="true"/>
 	<text name="voice_chat_settings">
 		Configuración del chat de voz
 	</text>
diff --git a/indra/newview/skins/default/xui/es/panel_tools_texture.xml b/indra/newview/skins/default/xui/es/panel_tools_texture.xml
index 7199905a1c..b820880e60 100644
--- a/indra/newview/skins/default/xui/es/panel_tools_texture.xml
+++ b/indra/newview/skins/default/xui/es/panel_tools_texture.xml
@@ -112,5 +112,5 @@
 	<spinner label="Grados de rotación" name="shinyRot"/>
 	<spinner label="Desplazamiento horizontal" name="shinyOffsetU"/>
 	<spinner label="Desplazamiento vertical" name="shinyOffsetV"/>
-	<check_box initial_value="falso" label="Alinear caras del plano" name="checkbox planar align" tool_tip="Alinear texturas en todas las caras seleccionadas con la última cara seleccionada. Requiere la representación de texturas en el plano."/>
+	<check_box initial_value="false" label="Alinear caras del plano" name="checkbox planar align" tool_tip="Alinear texturas en todas las caras seleccionadas con la última cara seleccionada. Requiere la representación de texturas en el plano."/>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
index 098f8fc713..bb146556ba 100755
--- a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml
@@ -28,7 +28,7 @@
 	<text name="tc label">
 		Activer S3TC :
 	</text>
-	<check_box initial_value="vraie" label="Activer la compression des textures (redémarrage requis)" name="texture compression" tool_tip="Comprime les textures en mémoire vidéo afin de permettre de charger des textures de résolution plus élevée au prix d&apos;une certaine qualité de couleur."/>
+	<check_box initial_value="true" label="Activer la compression des textures (redémarrage requis)" name="texture compression" tool_tip="Comprime les textures en mémoire vidéo afin de permettre de charger des textures de résolution plus élevée au prix d&apos;une certaine qualité de couleur."/>
 	<slider label="Mémoire textures (Mo) :" name="GraphicsCardTextureMemory" tool_tip="Quantité de mémoire à affecter aux textures. Utilise la mémoire de la carte vidéo par défaut. Si vous réduisez ce paramètre, cela peut améliorer les performances, mais les textures risquent d&apos;être floues."/>
 	<spinner label="Indice du brouillard :" name="fog"/>
 	<button label="OK" label_selected="OK" name="OK"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml
index bcc3423862..421e14d51b 100755
--- a/indra/newview/skins/default/xui/fr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/fr/floater_tools.xml
@@ -463,16 +463,11 @@
 				<combo_box.item label="Ventouses" name="suction"/>
 				<combo_box.item label="Tissage" name="weave"/>
 			</combo_box>
-			<check_box initial_value="false" label="Aligner les faces Plan" name="checkbox planar align" tool_tip="Aligner les textures sur toutes les faces sélectionnées avec la dernière face sélectionnée. Application de la texture Plan requise."/>
-			<text name="rpt">
-				Répétitions / Face
-			</text>
 			<spinner label="Horizontal (U)" name="TexScaleU"/>
 			<check_box label="Inverser" name="checkbox flip s"/>
 			<spinner label="Vertical (V)" name="TexScaleV"/>
 			<check_box label="Inverser" name="checkbox flip t"/>
 			<spinner label="Rotation˚" name="TexRot"/>
-			<spinner label="Répétitions / Mètre" name="rptctrl"/>
 			<button label="Appliquer" label_selected="Appliquer" name="button apply"/>
 			<text name="tex offset">
 				Décalage de la texture
diff --git a/indra/newview/skins/default/xui/it/floater_tools.xml b/indra/newview/skins/default/xui/it/floater_tools.xml
index dd59035dd4..468f284ccb 100755
--- a/indra/newview/skins/default/xui/it/floater_tools.xml
+++ b/indra/newview/skins/default/xui/it/floater_tools.xml
@@ -470,16 +470,11 @@
 				<combo_box.item label="Cerchi rialzati" name="suction"/>
 				<combo_box.item label="Trama" name="weave"/>
 			</combo_box>
-			<check_box initial_value="falso" label="Allinea facce planari" name="checkbox planar align" tool_tip="Allinea le texture su tutte le facce selezionate con l’ultima faccia selezionata. È richiesta la mappatura planare delle texture."/>
-			<text name="rpt">
-				Ripetizioni / Faccia
-			</text>
 			<spinner label="Orizzontale (U)" name="TexScaleU"/>
 			<check_box label="Inverti" name="checkbox flip s"/>
 			<spinner label="Verticale (V)" name="TexScaleV"/>
 			<check_box label="Inverti" name="checkbox flip t"/>
 			<spinner label="Rotazione˚" name="TexRot"/>
-			<spinner label="Ripetizioni / Metro" name="rptctrl"/>
 			<button label="Applica" label_selected="Applica" name="button apply"/>
 			<text name="tex offset">
 				Bilanciamento della texture
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml
index e7483b1ba5..2978c48db6 100755
--- a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml
@@ -25,7 +25,7 @@
 		<text name="ShadersText">
 			Effetti grafici:
 		</text>
-		<check_box initial_value="vero" label="Acqua trasparente" name="TransparentWater"/>
+		<check_box initial_value="true" label="Acqua trasparente" name="TransparentWater"/>
 		<check_box initial_value="true" label="Piccoli rilievi e scintillii" name="BumpShiny"/>
 		<check_box initial_value="true" label="Luci locali" name="LocalLights"/>
 		<check_box initial_value="true" label="Effetti grafici base" name="BasicShaders" tool_tip="Disabilitare questa opzione può evitare che qualche scheda grafica vada in crash."/>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
index 4c190197b4..fcc9661d03 100755
--- a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml
@@ -21,7 +21,7 @@
 	<check_box initial_value="true" label="Abilita plugin" name="browser_plugins_enabled"/>
 	<check_box initial_value="true" label="Accetta cookie" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Abilita Javascript" name="browser_javascript_enabled"/>
-	<check_box initial_value="falso" label="Consenti pop-up nel browser media" name="media_popup_enabled"/>
+	<check_box initial_value="false" label="Consenti pop-up nel browser media" name="media_popup_enabled"/>
 	<text name="Software updates:">
 		Aggiornamenti software:
 	</text>
diff --git a/indra/newview/skins/default/xui/it/panel_tools_texture.xml b/indra/newview/skins/default/xui/it/panel_tools_texture.xml
index 4e515563ac..36ad2980cb 100644
--- a/indra/newview/skins/default/xui/it/panel_tools_texture.xml
+++ b/indra/newview/skins/default/xui/it/panel_tools_texture.xml
@@ -112,5 +112,5 @@
 	<spinner label="Gradi di rotazione" name="shinyRot"/>
 	<spinner label="Spostamento orizzontale" name="shinyOffsetU"/>
 	<spinner label="Spostamento verticale" name="shinyOffsetV"/>
-	<check_box initial_value="falso" label="Allinea facce planari" name="checkbox planar align" tool_tip="Allinea le texture su tutte le facce selezionate con l’ultima faccia selezionata. È richiesta la mappatura planare delle texture."/>
+	<check_box initial_value="false" label="Allinea facce planari" name="checkbox planar align" tool_tip="Allinea le texture su tutte le facce selezionate con l’ultima faccia selezionata. È richiesta la mappatura planare delle texture."/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml
index 4bd6439ad2..5511433ae3 100755
--- a/indra/newview/skins/default/xui/ja/floater_tools.xml
+++ b/indra/newview/skins/default/xui/ja/floater_tools.xml
@@ -469,16 +469,11 @@
 				<combo_box.item label="吸い込み" name="suction"/>
 				<combo_box.item label="織目" name="weave"/>
 			</combo_box>
-			<check_box initial_value="false" label="平面を揃える" name="checkbox planar align" tool_tip="選択面全てのテクスチャを、最後に選択された面に揃えます。 平面テクスチャのマッピングが必要です。"/>
-			<text name="rpt">
-				反復 / 面
-			</text>
 			<spinner label="水平(U)" name="TexScaleU"/>
 			<check_box label="反転" name="checkbox flip s"/>
 			<spinner label="垂直(V)" name="TexScaleV"/>
 			<check_box label="反転" name="checkbox flip t"/>
 			<spinner label="回転˚" name="TexRot"/>
-			<spinner label="反復 / メーター" name="rptctrl"/>
 			<button label="適用" label_selected="適用" name="button apply"/>
 			<text name="tex offset">
 				テクスチャのズレ
diff --git a/indra/newview/skins/default/xui/pl/floater_tools.xml b/indra/newview/skins/default/xui/pl/floater_tools.xml
index 9e6fed8387..69d5c23f9c 100755
--- a/indra/newview/skins/default/xui/pl/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pl/floater_tools.xml
@@ -442,16 +442,11 @@
 				<combo_box.item label="Suction" name="suction"/>
 				<combo_box.item label="Fali" name="weave"/>
 			</combo_box>
-			<check_box initial_value="nieprawda" label="Połącz powierzchnie planarne" name="checkbox planar align" tool_tip="Połącz tekstury na wszystkich wybranych powierzchniach z powierzchnią wybraną jako ostatnia. Wymaga planarnego mapowania tekstury."/>
-			<text name="rpt">
-				Powtórzenia / Powierzchnia
-			</text>
 			<spinner label="Poziomo (U)" name="TexScaleU"/>
 			<check_box label="Odwróć" name="checkbox flip s"/>
 			<spinner label="Pionowo (V)" name="TexScaleV"/>
 			<check_box label="Odwróć" name="checkbox flip t"/>
 			<spinner label="Powtórzenia˚" name="TexRot"/>
-			<spinner label="Powtórzenia / metr" name="rptctrl"/>
 			<button label="Zastosuj" label_selected="Zastosuj" name="button apply"/>
 			<text name="tex offset">
 				Wyrównanie tekstury
diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml
index f2beef091a..4cd271a141 100755
--- a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml
@@ -26,7 +26,7 @@
 		<text name="ShadersText">
 			Cieniowanie pixeli (shadery):
 		</text>
-		<check_box initial_value="prawda" label="Przeźroczystość wody" name="TransparentWater"/>
+		<check_box initial_value="true" label="Przeźroczystość wody" name="TransparentWater"/>
 		<check_box initial_value="true" label="Mapowanie wypukłości i połysk" name="BumpShiny"/>
 		<check_box initial_value="true" label="Podstawowe shadery" name="BasicShaders" tool_tip="Wyłączenie tej opcji może naprawić błędy niektórych sterowników graficznych."/>
 		<check_box initial_value="true" label="Shadery atmosfery" name="WindLightUseAtmosShaders"/>
diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml
index fa0a5981a8..b663e18227 100755
--- a/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml
@@ -26,14 +26,13 @@
 		Internet:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="Użyj zewnętrznej przeglądarki (IE, Firefox, Safari)" name="external" tool_tip="Używaj zewnętrznej przeglądarki. Nie jest to rekomendowane w trybie pełnoekranowym." value="1"/>
+		<radio_item label="Użyj zewnętrznej przeglądarki (IE, Firefox, Safari)" name="external" tool_tip="Używaj zewnętrznej przeglądarki. Nie jest to rekomendowane w trybie pełnoekranowym." value="true"/>
 		<radio_item label="Używaj wbudowanej przeglądarki." name="internal" tool_tip="Używaj wbudowanej przeglądarki. Ta przeglądarka otworzy nowe okno w [APP_NAME]." value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="Zezwalaj na wtyczki" name="browser_plugins_enabled"/>
 	<check_box initial_value="true" label="Akceptuj ciasteczka z Internetu" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Zezwalaj na Javascript" name="browser_javascript_enabled"/>
-	<check_box initial_value="nieprawda" label="Zezwól na wyskakujące okienka przeglądarki mediów" name="media_popup_enabled"/>
-	<check_box initial_value="false" label="Używaj serwera proxy" name="web_proxy_enabled"/>
+	<check_box initial_value="false" label="Zezwól na wyskakujące okienka przeglądarki mediów" name="media_popup_enabled"/>
 	<text name="Proxy location">
 		Lokalizacja proxy:
 	</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_tools.xml b/indra/newview/skins/default/xui/pt/floater_tools.xml
index 8c245c582e..66c14cdecf 100755
--- a/indra/newview/skins/default/xui/pt/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pt/floater_tools.xml
@@ -463,16 +463,11 @@
 				<combo_box.item label="Sulcos" name="suction"/>
 				<combo_box.item label="Weave" name="weave"/>
 			</combo_box>
-			<check_box initial_value="falso" label="Alinhar planares" name="checkbox planar align" tool_tip="Alinhar texturas dos planos selecionados com o plano selecionado por último. Requer mapeamento planar da textura."/>
-			<text name="rpt">
-				Repetições / Plano
-			</text>
 			<spinner label="Horizontal (U)" name="TexScaleU"/>
 			<check_box label="Inverter" name="checkbox flip s"/>
 			<spinner label="Vertical (V)" name="TexScaleV"/>
 			<check_box label="Inverter" name="checkbox flip t"/>
 			<spinner label="Rotação˚" name="TexRot"/>
-			<spinner label="Repetições/Metro" name="rptctrl"/>
 			<button label="Aplicar" label_selected="Aplicar" name="button apply"/>
 			<text name="tex offset">
 				Offset de textura
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml
index 37e8838bf4..756e345cb8 100755
--- a/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml
@@ -26,14 +26,14 @@ rápido
 		<text name="ShadersText">
 			Sombreadores:
 		</text>
-		<check_box initial_value="verdadeiro" label="Água transparente" name="TransparentWater"/>
+		<check_box initial_value="true" label="Água transparente" name="TransparentWater"/>
 		<check_box initial_value="true" label="Bump de Mapeamento e Brilho" name="BumpShiny"/>
-		<check_box initial_value="verdadeiro" label="Luzes locais" name="LocalLights"/>
+		<check_box initial_value="true" label="Luzes locais" name="LocalLights"/>
 		<check_box initial_value="true" label="Sombreadores básicos" name="BasicShaders" tool_tip="Desabilitar esta opção poderá impedir que alguns drivers de placa de vídeo a travem."/>
 		<check_box initial_value="true" label="Sombreadores Atmosféricos" name="WindLightUseAtmosShaders"/>
-		<check_box initial_value="verdadeiro" label="Modelo avançado de luzes" name="UseLightShaders"/>
-		<check_box initial_value="verdadeiro" label="Oclusão ambiental" name="UseSSAO"/>
-		<check_box initial_value="verdadeiro" label="Profundidade" name="UseDoF"/>
+		<check_box initial_value="true" label="Modelo avançado de luzes" name="UseLightShaders"/>
+		<check_box initial_value="true" label="Oclusão ambiental" name="UseSSAO"/>
+		<check_box initial_value="true" label="Profundidade" name="UseDoF"/>
 		<text name="shadows_label">
 			Sombras:
 		</text>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
index 887d0cfe98..1279e74e21 100755
--- a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml
@@ -21,7 +21,7 @@
 	<check_box initial_value="true" label="Habilitar plugins" name="browser_plugins_enabled"/>
 	<check_box initial_value="true" label="Aceitar cookies" name="cookies_enabled"/>
 	<check_box initial_value="true" label="Habilitar Javascript" name="browser_javascript_enabled"/>
-	<check_box initial_value="falso" label="Ativar pop-ups no navegador de mídia" name="media_popup_enabled"/>
+	<check_box initial_value="false" label="Ativar pop-ups no navegador de mídia" name="media_popup_enabled"/>
 	<text name="Software updates:">
 		Atualizações de software:
 	</text>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_sound.xml b/indra/newview/skins/default/xui/pt/panel_preferences_sound.xml
index d910a7b812..fff5fd7005 100755
--- a/indra/newview/skins/default/xui/pt/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_sound.xml
@@ -19,7 +19,7 @@
 	<check_box label="Ativado" name="enable_voice_check"/>
 	<check_box label="Autorizar auto-play de mídias" name="media_auto_play_btn" tool_tip="Marque esta opção para auto-executar mídias, se elas quiserem" value="true"/>
 	<check_box label="Tocar mídia anexada em outros avatares" name="media_show_on_others_btn" tool_tip="Desmarque esta opção para ocultar mídias anexadas em avatares por perto" value="true"/>
-	<check_box label="Tocar áudio de gestos" name="gesture_audio_play_btn" tool_tip="Selecione para ouvir o áudio de gestos" value="verdadeiro"/>
+	<check_box label="Tocar áudio de gestos" name="gesture_audio_play_btn" tool_tip="Selecione para ouvir o áudio de gestos" value="true"/>
 	<text name="voice_chat_settings">
 		Configuração de bate-papo de voz
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/floater_auction.xml b/indra/newview/skins/default/xui/ru/floater_auction.xml
index d84dc2e941..105c75c919 100755
--- a/indra/newview/skins/default/xui/ru/floater_auction.xml
+++ b/indra/newview/skins/default/xui/ru/floater_auction.xml
@@ -3,7 +3,7 @@
 	<floater.string name="already for sale">
 		Нельзя выставить на аукцион участки, которые уже продаются.
 	</floater.string>
-	<check_box initial_value="истина" label="Включая желтую ограду вокруг выбранного участка" name="fence_check"/>
+	<check_box initial_value="true" label="Включая желтую ограду вокруг выбранного участка" name="fence_check"/>
 	<button label="Снимок" label_selected="Снимок" name="snapshot_btn"/>
 	<button label="Купить может каждый" label_selected="Купить может каждый" name="sell_to_anyone_btn"/>
 	<button label="Очистить настройки" label_selected="Очистить настройки" name="reset_parcel_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml b/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml
index 31fc1c5ed3..304bf97dc1 100755
--- a/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml
+++ b/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml
@@ -39,7 +39,7 @@
 	</text>
 	<check_box label="Изменять" name="next_owner_modify"/>
 	<check_box label="Копировать" name="next_owner_copy"/>
-	<check_box initial_value="истина" label="Передать" name="next_owner_transfer" tool_tip="Следующий владелец может отдать или перепродать объект"/>
+	<check_box initial_value="true" label="Передать" name="next_owner_transfer" tool_tip="Следующий владелец может отдать или перепродать объект"/>
 	<button label="OK" name="ok"/>
 	<button label="Применить" name="apply"/>
 	<button label="Отмена" name="close"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml b/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
index 43f8c36473..d7da112a27 100755
--- a/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/ru/floater_hardware_settings.xml
@@ -24,7 +24,7 @@
 	<text name="Enable VBO:">
 		Включить VBO:
 	</text>
-	<check_box initial_value="истина" label="Включить объекты вершинных буферов OpenGL" name="vbo" tool_tip="Включение этого параметра на современном оборудовании даст увеличение производительности.  Однако на старом оборудовании это может привести к сбою приложения."/>
+	<check_box initial_value="true" label="Включить объекты вершинных буферов OpenGL" name="vbo" tool_tip="Включение этого параметра на современном оборудовании даст увеличение производительности.  Однако на старом оборудовании это может привести к сбою приложения."/>
 	<text name="tc label">
 		Включить S3TC:
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/ru/floater_live_lsleditor.xml
index d8047fc045..fb6e747592 100755
--- a/indra/newview/skins/default/xui/ru/floater_live_lsleditor.xml
+++ b/indra/newview/skins/default/xui/ru/floater_live_lsleditor.xml
@@ -10,6 +10,6 @@
 		СКРИПТ: [NAME]
 	</floater.string>
 	<button label="Сброс" label_selected="Сброс" name="Reset"/>
-	<check_box initial_value="истина" label="Выполняется" name="running"/>
-	<check_box initial_value="истина" label="Моно" name="mono"/>
+	<check_box initial_value="true" label="Выполняется" name="running"/>
+	<check_box initial_value="true" label="Моно" name="mono"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_perm_prefs.xml b/indra/newview/skins/default/xui/ru/floater_perm_prefs.xml
index a704b87bd1..626f3c9321 100755
--- a/indra/newview/skins/default/xui/ru/floater_perm_prefs.xml
+++ b/indra/newview/skins/default/xui/ru/floater_perm_prefs.xml
@@ -8,7 +8,7 @@
 		</text>
 		<check_box label="изменять" name="next_owner_modify"/>
 		<check_box label="копировать" name="next_owner_copy"/>
-		<check_box initial_value="истина" label="перепродавать/отдавать" name="next_owner_transfer"/>
+		<check_box initial_value="true" label="перепродавать/отдавать" name="next_owner_transfer"/>
 	</panel>
 	<button label="ОК" label_selected="ОК" name="ok"/>
 	<button label="Отмена" label_selected="Отмена" name="cancel"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_preferences_proxy.xml b/indra/newview/skins/default/xui/ru/floater_preferences_proxy.xml
index 4eecfedf17..13cff2bcbe 100755
--- a/indra/newview/skins/default/xui/ru/floater_preferences_proxy.xml
+++ b/indra/newview/skins/default/xui/ru/floater_preferences_proxy.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="Proxy Settings Floater" title="Настройки прокси-сервера">
-	<check_box initial_value="ложь" label="Использовать HTTP-прокси для веб-страниц" name="web_proxy_enabled"/>
+	<check_box initial_value="false" label="Использовать HTTP-прокси для веб-страниц" name="web_proxy_enabled"/>
 	<text name="http_proxy_label">
 		HTTP-прокси:
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/floater_settings_debug.xml b/indra/newview/skins/default/xui/ru/floater_settings_debug.xml
index 7db014ef53..db78d11e90 100755
--- a/indra/newview/skins/default/xui/ru/floater_settings_debug.xml
+++ b/indra/newview/skins/default/xui/ru/floater_settings_debug.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="settings_debug" title="НАСТРОЙКИ ОТЛАДКИ">
 	<radio_group name="boolean_combo">
-		<radio_item label="ИСТИНА" name="TRUE" value="истина"/>
+		<radio_item label="ИСТИНА" name="TRUE" value="true"/>
 		<radio_item label="ЛОЖЬ" name="FALSE" value=""/>
 	</radio_group>
 	<color_swatch label="Цвет" name="val_color_swatch"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml
index a9a21e7d4a..c9e117362f 100755
--- a/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml
@@ -19,10 +19,10 @@
 	<button label="По умолчанию" label_selected="По умолчанию" name="Default"/>
 	<button label="Очистить" label_selected="Очистить" name="Blank"/>
 	<button label="Нет" label_selected="Нет" name="None"/>
-	<check_box initial_value="истина" label="Применить сейчас" name="apply_immediate_check"/>
+	<check_box initial_value="true" label="Применить сейчас" name="apply_immediate_check"/>
 	<text name="preview_disabled" value="Просмотр отключен"/>
 	<filter_editor label="Фильтровать текстуры" name="inventory search editor"/>
-	<check_box initial_value="ложь" label="Показывать папки" name="show_folders_check"/>
+	<check_box initial_value="false" label="Показывать папки" name="show_folders_check"/>
 	<button label="Добавить" label_selected="Добавить" name="l_add_btn"/>
 	<button label="Удалить" label_selected="Удалить" name="l_rem_btn"/>
 	<button label="Передать" label_selected="Передать" name="l_upl_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_tools.xml b/indra/newview/skins/default/xui/ru/floater_tools.xml
index c312f73428..35921d147f 100755
--- a/indra/newview/skins/default/xui/ru/floater_tools.xml
+++ b/indra/newview/skins/default/xui/ru/floater_tools.xml
@@ -76,8 +76,8 @@
 	<text label="Растяжка обеих сторон" name="checkbox uniform label">
 		Растяжка обеих сторон
 	</text>
-	<check_box initial_value="истина" label="Растягивать текстуры" name="checkbox stretch textures"/>
-	<check_box initial_value="истина" label="Привязка" name="checkbox snap to grid"/>
+	<check_box initial_value="true" label="Растягивать текстуры" name="checkbox stretch textures"/>
+	<check_box initial_value="true" label="Привязка" name="checkbox snap to grid"/>
 	<combo_box name="combobox grid mode" tool_tip="Выберите тип линейки сетки для размещения объекта">
 		<combo_box.item label="Мировая" name="World"/>
 		<combo_box.item label="Локальная" name="Local"/>
@@ -101,7 +101,7 @@
 	<button name="ToolGrass" tool_tip="Трава"/>
 	<check_box label="Держать инструмент" name="checkbox sticky"/>
 	<check_box label="Копировать выдел." name="checkbox copy selection"/>
-	<check_box initial_value="истина" label="Центрир. копию" name="checkbox copy centers"/>
+	<check_box initial_value="true" label="Центрир. копию" name="checkbox copy centers"/>
 	<check_box label="Повернуть копию" name="checkbox copy rotates"/>
 	<radio_group name="land_radio_group">
 		<radio_item label="Выбрать землю" name="radio select land"/>
@@ -465,16 +465,11 @@
 				<combo_box.item label="присоска" name="suction"/>
 				<combo_box.item label="переплетение" name="weave"/>
 			</combo_box>
-			<check_box initial_value="ложь" label="Согласование" name="checkbox planar align" tool_tip="Согласование текстур на всех выбранных граних по последней выбранной грани. Должно быть выбрано наложение по плоскостям."/>
-			<text name="rpt">
-				Повторов на грань
-			</text>
 			<spinner label="По горизонтали (U)" name="TexScaleU"/>
 			<check_box label="Разворот" name="checkbox flip s"/>
 			<spinner label="По вертикали (V)" name="TexScaleV"/>
 			<check_box label="Разворот" name="checkbox flip t"/>
 			<spinner label="Вращение˚" name="TexRot"/>
-			<spinner label="Повторов на метр" name="rptctrl"/>
 			<button label="Применить" label_selected="Применить" name="button apply"/>
 			<text name="tex offset">
 				Сдвиг текстуры
diff --git a/indra/newview/skins/default/xui/ru/floater_world_map.xml b/indra/newview/skins/default/xui/ru/floater_world_map.xml
index ef8dfe22ae..7d2acfd9a0 100755
--- a/indra/newview/skins/default/xui/ru/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/ru/floater_world_map.xml
@@ -35,7 +35,7 @@
 		<text name="pg_label">
 			Общие
 		</text>
-		<check_box initial_value="истина" name="events_mature_chk"/>
+		<check_box initial_value="true" name="events_mature_chk"/>
 		<text name="events_mature_label">
 			Умеренные
 		</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_group_general.xml b/indra/newview/skins/default/xui/ru/panel_group_general.xml
index 4d7e1c9fff..ba38dbf89e 100755
--- a/indra/newview/skins/default/xui/ru/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/ru/panel_group_general.xml
@@ -51,6 +51,6 @@
 			<combo_box.item label="Умеренный контент" name="mature"/>
 			<combo_box.item label="Общий контент" name="pg"/>
 		</combo_box>
-		<check_box initial_value="истина" label="Показать в поиске" name="show_in_group_list" tool_tip="Позволить людям видеть эту группу в результатах поиска"/>
+		<check_box initial_value="true" label="Показать в поиске" name="show_in_group_list" tool_tip="Позволить людям видеть эту группу в результатах поиска"/>
 	</panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_media_settings_general.xml b/indra/newview/skins/default/xui/ru/panel_media_settings_general.xml
index 6dc435db20..d52397832c 100755
--- a/indra/newview/skins/default/xui/ru/panel_media_settings_general.xml
+++ b/indra/newview/skins/default/xui/ru/panel_media_settings_general.xml
@@ -15,14 +15,14 @@
 	</text>
 	<text name="current_url" tool_tip="Текущая страница для этого медиа-источника" value=""/>
 	<button label="Сброс" name="current_url_reset_btn"/>
-	<check_box initial_value="ложь" label="Автоматическое зацикливание" name="auto_loop"/>
-	<check_box initial_value="ложь" label="Реакция на первый щелчок" name="first_click_interact"/>
-	<check_box initial_value="ложь" label="Автоувеличение" name="auto_zoom"/>
-	<check_box initial_value="ложь" label="Автоматическое проигрывание" name="auto_play"/>
+	<check_box initial_value="false" label="Автоматическое зацикливание" name="auto_loop"/>
+	<check_box initial_value="false" label="Реакция на первый щелчок" name="first_click_interact"/>
+	<check_box initial_value="false" label="Автоувеличение" name="auto_zoom"/>
+	<check_box initial_value="false" label="Автоматическое проигрывание" name="auto_play"/>
 	<text name="media_setting_note">
 		Примечание. Жители могут переопределять эту настройку.
 	</text>
-	<check_box initial_value="ложь" label="Автомасштабирование на объекте" name="auto_scale"/>
+	<check_box initial_value="false" label="Автомасштабирование на объекте" name="auto_scale"/>
 	<text name="size_label">
 		Размер:
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_media_settings_permissions.xml b/indra/newview/skins/default/xui/ru/panel_media_settings_permissions.xml
index 680cba9c14..cfb006f346 100755
--- a/indra/newview/skins/default/xui/ru/panel_media_settings_permissions.xml
+++ b/indra/newview/skins/default/xui/ru/panel_media_settings_permissions.xml
@@ -14,16 +14,16 @@
 	<text name="owner_label">
 		Владелец
 	</text>
-	<check_box initial_value="ложь" label="Разрешить навигацию и взаимодействие" name="perms_owner_interact"/>
-	<check_box initial_value="ложь" label="Панель управления видна" name="perms_owner_control"/>
+	<check_box initial_value="false" label="Разрешить навигацию и взаимодействие" name="perms_owner_interact"/>
+	<check_box initial_value="false" label="Панель управления видна" name="perms_owner_control"/>
 	<text name="group_label">
 		Группа:
 	</text>
-	<check_box initial_value="ложь" label="Разрешить навигацию и взаимодействие" name="perms_group_interact"/>
-	<check_box initial_value="ложь" label="Панель управления видна" name="perms_group_control"/>
+	<check_box initial_value="false" label="Разрешить навигацию и взаимодействие" name="perms_group_interact"/>
+	<check_box initial_value="false" label="Панель управления видна" name="perms_group_control"/>
 	<text name="anyone_label">
 		всем
 	</text>
-	<check_box initial_value="ложь" label="Разрешить навигацию и взаимодействие" name="perms_anyone_interact"/>
-	<check_box initial_value="ложь" label="Панель управления видна" name="perms_anyone_control"/>
+	<check_box initial_value="false" label="Разрешить навигацию и взаимодействие" name="perms_anyone_interact"/>
+	<check_box initial_value="false" label="Панель управления видна" name="perms_anyone_control"/>
 </panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_media_settings_security.xml b/indra/newview/skins/default/xui/ru/panel_media_settings_security.xml
index 6b30dc799c..bae491472a 100755
--- a/indra/newview/skins/default/xui/ru/panel_media_settings_security.xml
+++ b/indra/newview/skins/default/xui/ru/panel_media_settings_security.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Безопасность" name="Media Settings Security">
-	<check_box initial_value="ложь" label="Разрешить доступ к ссылкам только по шаблону" name="whitelist_enable"/>
+	<check_box initial_value="false" label="Разрешить доступ к ссылкам только по шаблону" name="whitelist_enable"/>
 	<text name="home_url_fails_some_items_in_whitelist">
 		Пункты, не подходящие для домашней страницы, отмечены знаком:
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
index c7a850f78a..62617caed3 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
@@ -36,7 +36,7 @@
 		<combo_box.item label="Мое последнее место" name="MyLastLocation"/>
 		<combo_box.item label="Мой дом" name="MyHome"/>
 	</combo_box>
-	<check_box initial_value="истина" label="Показывать на экране входа" name="show_location_checkbox"/>
+	<check_box initial_value="true" label="Показывать на экране входа" name="show_location_checkbox"/>
 	<text name="name_tags_textbox">
 		Теги имен:
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml
index 029e72e137..c93955fcdc 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml
@@ -25,14 +25,14 @@
 		<text name="ShadersText">
 			Шейдеры:
 		</text>
-		<check_box initial_value="истина" label="Прозрачность воды" name="TransparentWater"/>
-		<check_box initial_value="истина" label="Рельефность и сияние" name="BumpShiny"/>
-		<check_box initial_value="истина" label="Локальный свет" name="LocalLights"/>
-		<check_box initial_value="истина" label="Базовые шейдеры" name="BasicShaders" tool_tip="Отключение этого параметра может предотвратить зависание некоторых видеокарт"/>
-		<check_box initial_value="истина" label="Атмосферные шейдеры" name="WindLightUseAtmosShaders"/>
-		<check_box initial_value="истина" label="Расширенная модель освещения" name="UseLightShaders"/>
-		<check_box initial_value="истина" label="Объемный свет" name="UseSSAO"/>
-		<check_box initial_value="истина" label="Глубина поля" name="UseDoF"/>
+		<check_box initial_value="true" label="Прозрачность воды" name="TransparentWater"/>
+		<check_box initial_value="true" label="Рельефность и сияние" name="BumpShiny"/>
+		<check_box initial_value="true" label="Локальный свет" name="LocalLights"/>
+		<check_box initial_value="true" label="Базовые шейдеры" name="BasicShaders" tool_tip="Отключение этого параметра может предотвратить зависание некоторых видеокарт"/>
+		<check_box initial_value="true" label="Атмосферные шейдеры" name="WindLightUseAtmosShaders"/>
+		<check_box initial_value="true" label="Расширенная модель освещения" name="UseLightShaders"/>
+		<check_box initial_value="true" label="Объемный свет" name="UseSSAO"/>
+		<check_box initial_value="true" label="Глубина поля" name="UseDoF"/>
 		<text name="shadows_label">
 			Тени:
 		</text>
@@ -95,9 +95,9 @@
 		<text name="AvatarRenderingText">
 			Отрисовка аватара:
 		</text>
-		<check_box initial_value="истина" label="Плоские аватары" name="AvatarImpostors"/>
-		<check_box initial_value="истина" label="Аппаратная отрисовка" name="AvatarVertexProgram"/>
-		<check_box initial_value="истина" label="Одежда аватара" name="AvatarCloth"/>
+		<check_box initial_value="true" label="Плоские аватары" name="AvatarImpostors"/>
+		<check_box initial_value="true" label="Аппаратная отрисовка" name="AvatarVertexProgram"/>
+		<check_box initial_value="true" label="Одежда аватара" name="AvatarCloth"/>
 		<text name="TerrainDetailText">
 			Ландшафт:
 		</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
index e9c0c7de10..1741397a84 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml
@@ -18,10 +18,10 @@
 		<radio_item label="Использовать мой браузер (IE, Firefox, Safari)" name="external" tool_tip="Будет использоваться браузер, заданный в системе по умолчанию. Не рекомендуется, если [APP_NAME] работает в полноэкранном режиме." value="true"/>
 		<radio_item label="Использовать встроенный браузер" name="internal" tool_tip="Для просмотра справки, ссылок на веб-страницы и т. д. будет использоваться встроенный браузер. Этот браузер открывается как новое окно в [APP_NAME]." value=""/>
 	</radio_group>
-	<check_box initial_value="истина" label="Разрешить плагины" name="browser_plugins_enabled"/>
-	<check_box initial_value="истина" label="Принимать файлы cookie" name="cookies_enabled"/>
-	<check_box initial_value="истина" label="Разрешить Javascript" name="browser_javascript_enabled"/>
-	<check_box initial_value="ложь" label="Разрешить всплывающие окна" name="media_popup_enabled"/>
+	<check_box initial_value="true" label="Разрешить плагины" name="browser_plugins_enabled"/>
+	<check_box initial_value="true" label="Принимать файлы cookie" name="cookies_enabled"/>
+	<check_box initial_value="true" label="Разрешить Javascript" name="browser_javascript_enabled"/>
+	<check_box initial_value="false" label="Разрешить всплывающие окна" name="media_popup_enabled"/>
 	<text name="Software updates:">
 		Обновления ПО:
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml b/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml
index bf673750d2..44f270527c 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_sound.xml
@@ -4,7 +4,7 @@
 		среднюю кнопку мыши
 	</panel.string>
 	<slider label="Общая громкость" name="System Volume"/>
-	<check_box initial_value="истина" name="mute_when_minimized"/>
+	<check_box initial_value="true" name="mute_when_minimized"/>
 	<text name="mute_chb_label">
 		Заглушать, когда свернуто
 	</text>
@@ -17,9 +17,9 @@
 	<check_box label="Включено" name="enable_media"/>
 	<slider label="Голосовой чат" name="Voice Volume"/>
 	<check_box label="Включено" name="enable_voice_check"/>
-	<check_box label="Разрешить автовоспроизведение медиа" name="media_auto_play_btn" tool_tip="Установка флажка позволит вам автоматически воспроизводить медиа" value="истина"/>
-	<check_box label="Воспроизводить медиа, присоединенные к другому аватару" name="media_show_on_others_btn" tool_tip="Снятие флажка скроет медиа, присоединенные к другому аватару" value="истина"/>
-	<check_box label="Сопровождать жесты звуками" name="gesture_audio_play_btn" tool_tip="Установите флажок, чтобы слышать звуки при жестах" value="истина"/>
+	<check_box label="Разрешить автовоспроизведение медиа" name="media_auto_play_btn" tool_tip="Установка флажка позволит вам автоматически воспроизводить медиа" value="true"/>
+	<check_box label="Воспроизводить медиа, присоединенные к другому аватару" name="media_show_on_others_btn" tool_tip="Снятие флажка скроет медиа, присоединенные к другому аватару" value="true"/>
+	<check_box label="Сопровождать жесты звуками" name="gesture_audio_play_btn" tool_tip="Установите флажок, чтобы слышать звуки при жестах" value="true"/>
 	<text name="voice_chat_settings">
 		Настройки голосового чата
 	</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_tools_texture.xml b/indra/newview/skins/default/xui/ru/panel_tools_texture.xml
index 60717a3d1d..1abf729487 100644
--- a/indra/newview/skins/default/xui/ru/panel_tools_texture.xml
+++ b/indra/newview/skins/default/xui/ru/panel_tools_texture.xml
@@ -112,5 +112,5 @@
 	<spinner label="Поворот, градусы" name="shinyRot"/>
 	<spinner label="Смещение по горизонтали" name="shinyOffsetU"/>
 	<spinner label="Смещение по вертикали" name="shinyOffsetV"/>
-	<check_box initial_value="ложь" label="Согласование" name="checkbox planar align" tool_tip="Согласование текстур на всех выбранных гранях по последней выбранной грани. Должно быть выбрано наложение по плоскостям."/>
+	<check_box initial_value="false" label="Согласование" name="checkbox planar align" tool_tip="Согласование текстур на всех выбранных гранях по последней выбранной грани. Должно быть выбрано наложение по плоскостям."/>
 </panel>
diff --git a/indra/newview/skins/default/xui/tr/floater_tools.xml b/indra/newview/skins/default/xui/tr/floater_tools.xml
index 4bf0372a8a..39a3569efa 100755
--- a/indra/newview/skins/default/xui/tr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/tr/floater_tools.xml
@@ -465,16 +465,11 @@
 				<combo_box.item label="vakum" name="suction"/>
 				<combo_box.item label="örgü" name="weave"/>
 			</combo_box>
-			<check_box initial_value="false" label="Planar yüzleri hizala" name="checkbox planar align" tool_tip="Tüm seçili yüzeylerdeki dokuları son seçili yüzdekiyle hizalar. Planar doku eşleştirmesi gerektirir."/>
-			<text name="rpt">
-				Tekrarlar / Yüz
-			</text>
 			<spinner label="Yatay (U)" name="TexScaleU"/>
 			<check_box label="Çevir" name="checkbox flip s"/>
 			<spinner label="Dikey (V)" name="TexScaleV"/>
 			<check_box label="Çevir" name="checkbox flip t"/>
 			<spinner label="Döndürme*" name="TexRot"/>
-			<spinner label="Tekrarlar / Metre" name="rptctrl"/>
 			<button label="Uygula" label_selected="Uygula" name="button apply"/>
 			<text name="tex offset">
 				Doku Dengeleyicisi
diff --git a/indra/newview/skins/default/xui/zh/floater_tools.xml b/indra/newview/skins/default/xui/zh/floater_tools.xml
index 33c9ebeaf0..7e6c972f40 100755
--- a/indra/newview/skins/default/xui/zh/floater_tools.xml
+++ b/indra/newview/skins/default/xui/zh/floater_tools.xml
@@ -465,16 +465,11 @@
 				<combo_box.item label="吸附" name="suction"/>
 				<combo_box.item label="編織" name="weave"/>
 			</combo_box>
-			<check_box initial_value="false" label="對齊平面" name="checkbox planar align" tool_tip="以最後所選擇的面為基準,對齊全部所選擇的面上的材質。 這必須使用平面材質映射方式。"/>
-			<text name="rpt">
-				重覆次數 / 面
-			</text>
 			<spinner label="水平(U)" name="TexScaleU"/>
 			<check_box label="翻轉" name="checkbox flip s"/>
 			<spinner label="垂直(V)" name="TexScaleV"/>
 			<check_box label="翻轉" name="checkbox flip t"/>
 			<spinner label="旋轉˚" name="TexRot"/>
-			<spinner label="重覆次數 / 公尺" name="rptctrl"/>
 			<button label="套用" label_selected="套用" name="button apply"/>
 			<text name="tex offset">
 				材質位移
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml b/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml
index 0fcc49b203..ab4d9a881d 100755
--- a/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml
@@ -15,7 +15,7 @@
 		網頁:
 	</text>
 	<radio_group name="use_external_browser">
-		<radio_item label="使用我的網頁瀏覽器(例如 IE, Firefox, Safari)" name="external" tool_tip="使用系統預設的瀏覽器瀏覽幫助,開啟網頁。全螢幕模式下不建議這麼做。" value="1"/>
+		<radio_item label="使用我的網頁瀏覽器(例如 IE, Firefox, Safari)" name="external" tool_tip="使用系統預設的瀏覽器瀏覽幫助,開啟網頁。全螢幕模式下不建議這麼做。" value="true"/>
 		<radio_item label="使用內建網頁瀏覽器" name="internal" tool_tip="使用內建的瀏覽器瀏覽幫助,開啟網頁。該瀏覽器將透過 [APP_NAME] 開啟新視窗。" value=""/>
 	</radio_group>
 	<check_box initial_value="true" label="啟用外掛" name="browser_plugins_enabled"/>
-- 
cgit v1.2.3


From 437efd9b866074d2385a70183af34ec1414ad59a Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Thu, 17 Oct 2013 14:44:15 -0700
Subject: MAINT-3330 fix regression on mac caused by shader change for 3107 by
 rolling back to prev version of shader

---
 indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index 3df4d333ce..c98e7d1cd3 100755
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
@@ -31,11 +31,9 @@ uniform vec4 matrixPalette[45];
 mat4 getSkinnedTransform()
 {
 	mat4 ret;
-	
-	float x = fract(weight.x);
 	int i = int(floor(weight.x));
-		i = min(i, 15);
-		i = max(i, 0);
+	float x = fract(weight.x);
+	
 	ret[0] = mix(matrixPalette[i+0], matrixPalette[i+1],  x);
 	ret[1] = mix(matrixPalette[i+15],matrixPalette[i+16], x);
 	ret[2] = mix(matrixPalette[i+30],matrixPalette[i+31], x);
-- 
cgit v1.2.3


From 8eb56668feb91032136ccfabee44c3ceb1d586b3 Mon Sep 17 00:00:00 2001
From: simon <none@none>
Date: Thu, 17 Oct 2013 14:58:27 -0700
Subject: SUN-69 MAINT-2258 : temp attachments getting removed improperly. 
 Reviewed by Kelly.

---
 indra/newview/llagentwearables.cpp | 27 +++++++++++++++++++++------
 indra/newview/llappearancemgr.cpp  | 35 ++++++++++++++++++++++++++++++++---
 indra/newview/llappearancemgr.h    |  9 +++++++++
 indra/newview/llviewerobject.cpp   |  7 +++++++
 indra/newview/llviewerobject.h     |  2 ++
 indra/newview/llvoavatar.cpp       | 22 ++++++++++++++++++++++
 indra/newview/llvoavatar.h         |  2 ++
 7 files changed, 95 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 1edbbe2a2e..fa810aac76 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1538,7 +1538,11 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
 	std::set<LLUUID> requested_item_ids;
 	std::set<LLUUID> current_item_ids;
 	for (S32 i=0; i<obj_item_array.count(); i++)
-		requested_item_ids.insert(obj_item_array[i].get()->getLinkedUUID());
+	{
+		const LLUUID & requested_id = obj_item_array[i].get()->getLinkedUUID();
+		//llinfos << "Requested attachment id " << requested_id << llendl;
+		requested_item_ids.insert(requested_id);
+	}
 
 	// Build up list of objects to be removed and items currently attached.
 	llvo_vec_t objects_to_remove;
@@ -1555,17 +1559,28 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
 			if (objectp)
 			{
 				LLUUID object_item_id = objectp->getAttachmentItemID();
+
+				bool remove_attachment = true;
 				if (requested_item_ids.find(object_item_id) != requested_item_ids.end())
-				{
-					// Object currently worn, was requested.
+				{	// Object currently worn, was requested to keep it
 					// Flag as currently worn so we won't have to add it again.
-					current_item_ids.insert(object_item_id);
+					remove_attachment = false;
 				}
-				else
+				else if (objectp->isTempAttachment())
+				{	// Check if we should keep this temp attachment
+					remove_attachment = LLAppearanceMgr::instance().shouldRemoveTempAttachment(objectp->getID());
+				}
+
+				if (remove_attachment)
 				{
-					// object currently worn, not requested.
+					// llinfos << "found object to remove, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << llendl;
 					objects_to_remove.push_back(objectp);
 				}
+				else
+				{
+					// llinfos << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << llendl;
+					current_item_ids.insert(object_item_id);
+				}
 			}
 		}
 	}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index fd9236c8b3..da1609297e 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3415,21 +3415,50 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove)
 		llwarns << "called with empty list, nothing to do" << llendl;
 	}
 	for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it)
-			{
+	{
 		const LLUUID& id_to_remove = *it;
 		const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove);
 		removeCOFItemLinks(linked_item_id);
-			}
-	updateAppearanceFromCOF();
+		addDoomedTempAttachment(linked_item_id);
 	}
+	updateAppearanceFromCOF();
+}
 
 void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove)
 {
 	LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove);
 	removeCOFItemLinks(linked_item_id);
+	addDoomedTempAttachment(linked_item_id);
 	updateAppearanceFromCOF();
 }
 
+
+// Adds the given item ID to mDoomedTempAttachmentIDs iff it's a temp attachment
+void LLAppearanceMgr::addDoomedTempAttachment(const LLUUID& id_to_remove)
+{
+	LLViewerObject * attachmentp = gAgentAvatarp->findAttachmentByID(id_to_remove);
+	if (attachmentp &&
+		attachmentp->isTempAttachment())
+	{	// If this is a temp attachment and we want to remove it, record the ID 
+		// so it will be deleted when attachments are synced up with COF
+		mDoomedTempAttachmentIDs.insert(id_to_remove);
+		//llinfos << "Will remove temp attachment id " << id_to_remove << llendl;
+	}
+}
+
+// Find AND REMOVES the given UUID from mDoomedTempAttachmentIDs
+bool LLAppearanceMgr::shouldRemoveTempAttachment(const LLUUID& item_id)
+{
+	doomed_temp_attachments_t::iterator iter = mDoomedTempAttachmentIDs.find(item_id);
+	if (iter != mDoomedTempAttachmentIDs.end())
+	{
+		mDoomedTempAttachmentIDs.erase(iter);
+		return true;
+	}
+	return false;
+}
+
+
 bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_body)
 {
 	if (!item || !item->isWearableType()) return false;
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 46252afbde..5ec80f1cf0 100755
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -142,6 +142,9 @@ public:
 	void removeAllClothesFromAvatar();
 	void removeAllAttachmentsFromAvatar();
 
+	// Special handling of temp attachments, which are not in the COF
+	bool shouldRemoveTempAttachment(const LLUUID& item_id);
+
 	//has the current outfit changed since it was loaded?
 	bool isOutfitDirty() { return mOutfitIsDirty; }
 
@@ -239,6 +242,12 @@ private:
 
 	std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
 
+	// Set of temp attachment UUIDs that should be removed
+	typedef std::set<LLUUID> doomed_temp_attachments_t;
+	doomed_temp_attachments_t	mDoomedTempAttachmentIDs;
+
+	void addDoomedTempAttachment(const LLUUID& id_to_remove);
+
 	//////////////////////////////////////////////////////////////////////////////////
 	// Item-specific convenience functions 
 public:
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 7151a0d6ed..1544e66431 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -5879,6 +5879,13 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif
 	return ;
 }
 
+// virtual 
+BOOL	LLViewerObject::isTempAttachment() const
+{
+	return (mID.notNull() && (mID == mAttachmentItemID));
+}
+
+
 const LLUUID &LLViewerObject::getAttachmentItemID() const
 {
 	return mAttachmentItemID;
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index b035473c74..80bdd628a1 100755
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -171,6 +171,8 @@ public:
 	virtual BOOL	isAttachment() const { return FALSE; }
 	virtual LLVOAvatar* getAvatar() const;  //get the avatar this object is attached to, or NULL if object is not an attachment
 	virtual BOOL	isHUDAttachment() const { return FALSE; }
+	virtual BOOL	isTempAttachment() const;
+
 	virtual void 	updateRadius() {};
 	virtual F32 	getVObjRadius() const; // default implemenation is mDrawable->getRadius()
 	
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f92fa0371e..f5918a0a5f 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5975,6 +5975,28 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const
 
 
 
+LLViewerObject *	LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) const
+{
+	for(attachment_map_t::const_iterator attachment_points_iter = mAttachmentPoints.begin();
+		attachment_points_iter != gAgentAvatarp->mAttachmentPoints.end();
+		++attachment_points_iter)
+	{
+		LLViewerJointAttachment* attachment = attachment_points_iter->second;
+		for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
+			 attachment_iter != attachment->mAttachedObjects.end();
+			 ++attachment_iter)
+		{
+			LLViewerObject *attached_object = (*attachment_iter);
+			if (attached_object &&
+				attached_object->getID() == target_id)
+			{
+				return attached_object;
+			}
+		}
+	}
+
+	return NULL;
+}
 
 
 // virtual
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 931e65b3ea..9d45a74ecc 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -731,6 +731,8 @@ public:
 	void				cleanupAttachedMesh( LLViewerObject* pVO );
 	static LLVOAvatar*  findAvatarFromAttachment(LLViewerObject* obj);
 	/*virtual*/ BOOL	isWearingWearableType(LLWearableType::EType type ) const;
+	LLViewerObject *	findAttachmentByID( const LLUUID & target_id ) const;
+
 protected:
 	LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object);
 	void 				lazyAttach();
-- 
cgit v1.2.3


From 93b3f1297ea5377257d14c5214790607e0b1af96 Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Mon, 21 Oct 2013 13:20:34 -0700
Subject: MAINT-3338 fix disable of particle glow on false suspicion of lying
 network data

---
 indra/llrender/llrendertarget.cpp | 48 +++++++++++++++++++++++++++------------
 indra/newview/lldrawpoolalpha.cpp |  4 +---
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index b82b370d6e..fe8110904d 100755
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -364,35 +364,55 @@ void LLRenderTarget::release()
 
 		sBytesAllocated -= mResX*mResY*4;
 	}
-	else if (mUseDepth && mFBO)
-	{ //detach shared depth buffer
+	else if (mFBO)
+	{
 		glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
-		if (mStencil)
-		{ //attached as a renderbuffer
-			glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
-			glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
-			mStencil = false;
+
+		if (mUseDepth)
+		{ //detach shared depth buffer
+			if (mStencil)
+			{ //attached as a renderbuffer
+				glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
+				glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
+				mStencil = false;
+			}
+			else
+			{ //attached as a texture
+				glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, LLTexUnit::getInternalType(mUsage), 0, 0);
+			}
+			mUseDepth = false;
 		}
-		else
-		{ //attached as a texture
-			glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, LLTexUnit::getInternalType(mUsage), 0, 0);
+	}
+
+	// Detach any extra color buffers (e.g. SRGB spec buffers)
+	//
+	if (mFBO && (mTex.size() > 1))
+	{		
+		S32 z;
+		for (z = mTex.size() - 1; z >= 1; z--)
+		{
+			sBytesAllocated -= mResX*mResY*4;
+			glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+z, LLTexUnit::getInternalType(mUsage), 0, 0);
+			stop_glerror();
+			LLImageGL::deleteTextures(1, &mTex[z]);
 		}
-		mUseDepth = false;
 	}
 
 	if (mFBO)
 	{
 		glDeleteFramebuffers(1, (GLuint *) &mFBO);
+		stop_glerror();
 		mFBO = 0;
 	}
 
 	if (mTex.size() > 0)
 	{
-		sBytesAllocated -= mResX*mResY*4*mTex.size();
-		LLImageGL::deleteTextures(mTex.size(), &mTex[0]);
+		sBytesAllocated -= mResX*mResY*4;
+		LLImageGL::deleteTextures(1, &mTex[0]);
+	}
+
 		mTex.clear();
 		mInternalFormat.clear();
-	}
 	
 	mResX = mResY = 0;
 
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 6c5d229dba..e27dc279f4 100755
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -382,9 +382,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
 			bool is_particle_or_hud_particle = group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_PARTICLE
 													  || group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE;
 
-			bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow.
-				// All particle systems seem to come off the wire with texture entries which claim that they glow.  This is probably a bug in the data.  Suppress.
-				!is_particle_or_hud_particle;
+			bool draw_glow_for_this_partition = mVertexShaderLevel > 0; // no shaders = no glow.
 
 			static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group");
 			LLFastTimer t(FTM_RENDER_ALPHA_GROUP_LOOP);
-- 
cgit v1.2.3


From 76908954b93708e80f115b1d4348d398748788db Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 23 Oct 2013 11:52:24 -0400
Subject: Added tag 3.6.9-release for changeset 70eda3721d36

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2efe658de2..c81c919d1a 100755
--- a/.hgtags
+++ b/.hgtags
@@ -467,3 +467,4 @@ fe4f7c5e9fd27e09d03deb1cc9ab3e5093f6309e 3.6.3-release
 bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release
 ae457ece77001767ae9613148c495e7b98cc0f4a 3.6.7-release
 d40c66e410741de7e90b1ed6dac28dd8a2d7e1f6 3.6.8-release
+70eda3721d36df3e00730629c42a1304e5bc65b8 3.6.9-release
-- 
cgit v1.2.3


From ea1e1b0925b386cf83178539b8eae9e25c573548 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 23 Oct 2013 12:15:35 -0400
Subject: increment viewer version to 3.6.10

---
 indra/newview/VIEWER_VERSION.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index cff2619cfb..c47e8b5872 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-3.6.9
+3.6.10
-- 
cgit v1.2.3


From 7b3e01709642856cebfae92397933cf7d31ce361 Mon Sep 17 00:00:00 2001
From: maksymsproductengine <maksymsproductengine@lindenlab.com>
Date: Tue, 13 Aug 2013 19:22:35 +0300
Subject: MAINT-2861 FIXED llAdjustSoundVolume causes animated textures on same
 object to reset to first frame

---
 indra/newview/llvovolume.cpp | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 17efc5482b..5205bc6987 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -334,15 +334,9 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
 				if (!mTextureAnimp)
 				{
 					mTextureAnimp = new LLViewerTextureAnim(this);
+					mTexAnimMode = 0;
 				}
-				else
-				{
-					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
-					{
-						mTextureAnimp->reset();
-					}
-				}
-				mTexAnimMode = 0;
+				
 				mTextureAnimp->unpackTAMessage(mesgsys, block_num);
 			}
 			else
-- 
cgit v1.2.3


From 4595978d59d905bc9ef95efd759eac8cb62b57c3 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Wed, 14 Aug 2013 20:02:31 +0100
Subject: removed momentary error message upon connecting to Facebook

---
 indra/newview/llfacebookconnect.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 0a4fefbd24..abfacdb93c 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -81,18 +81,18 @@ public:
 		{
 			if (tokens[0].asString() == "connect")
 			{
-				// connect to facebook
-				if (query_map.has("code"))
-				{
-                    LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
-				}
-
 				// this command probably came from the fbc_web browser, so close it
 				LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web");
 				if (fbc_web)
 				{
 					fbc_web->closeFloater();
 				}
+
+				// connect to facebook
+				if (query_map.has("code"))
+				{
+                    LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
+				}
 				return true;
 			}
 		}
-- 
cgit v1.2.3


From 6c45b3677ee06cd58056447a4b7b45fa78df8b74 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 24 Aug 2013 02:15:08 +0100
Subject: added Google Analytics query parameters to URLs for FBC photos and
 checkins for ACME-854

---
 indra/newview/llfloatersocial.cpp | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4c17d9e40d..2a74c8e3ea 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -55,6 +55,8 @@ static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsoci
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 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";
 
 std::string get_map_url()
 {
@@ -345,12 +347,19 @@ void LLSocialPhotoPanel::sendPhoto()
 	bool add_location = mLocationCheckbox->getValue().asBoolean();
 	if (add_location)
 	{
+		// Get the SLURL for the location
 		LLSLURL slurl;
 		LLAgentUI::buildSLURL(slurl);
+		std::string slurl_string = slurl.getSLURLString();
+
+		// Add query parameters so Google Analytics can track incoming clicks!
+		slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS;
+
+		// Add it to the caption (pretty crude, but we don't have a better option with photos)
 		if (caption.empty())
-			caption = slurl.getSLURLString();
+			caption = slurl_string;
 		else
-			caption = caption + " " + slurl.getSLURLString();
+			caption = caption + " " + slurl_string;
 	}
 
 	// Get the image
@@ -592,6 +601,9 @@ void LLSocialCheckinPanel::sendCheckin()
 	{
 		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 = gAgent.getRegion()->getName();
-- 
cgit v1.2.3


From 357ded33cf48247ce0a305419f9e42c87e19062d Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 29 Aug 2013 12:06:46 -0700
Subject: removing test code

---
 indra/newview/llparticipantlist.cpp | 15 ---------------
 indra/newview/llparticipantlist.h   |  1 -
 2 files changed, 16 deletions(-)

diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index b5c9f4a310..ee6893907e 100755
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -404,21 +404,6 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
 
 static LLFastTimer::DeclareTimer FTM_FOLDERVIEW_TEST("add test avatar agents");
 
-
-void LLParticipantList::addTestAvatarAgents()
-{
-	LLFastTimer _(FTM_FOLDERVIEW_TEST);
-
-	LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL;
-
-	for(int i = 0; i < 300; ++i)
-	{
-		addAvatarIDExceptAgent(LLUUID().generateNewID());
-	}
-
-	LL_INFOS("LLParticipantList") << "finished adding 300 users" << LL_ENDL;
-}
-
 void LLParticipantList::adjustParticipant(const LLUUID& speaker_id)
 {
 	LLPointer<LLSpeaker> speakerp = mSpeakerMgr->findSpeaker(speaker_id);
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 936e289c08..3a3ae76604 100755
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -50,7 +50,6 @@ public:
 	 * @param[in] avatar_id - Avatar UUID to be added into the list
 	 */
 	void addAvatarIDExceptAgent(const LLUUID& avatar_id);
-	void addTestAvatarAgents();
 
 	/**
 	 * Refreshes the participant list.
-- 
cgit v1.2.3


From ed828365b8a5371b1deadaa8cc1c2f1fdf729227 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Thu, 29 Aug 2013 16:05:49 -0700
Subject: ACME-866 User receives error when hitting Disconnect in Facebook
 floater, if access token was cleared manually on backend: Problem was that
 when the user was already disconnected the Facebook connection state was not
 being set to disconnected.

---
 indra/newview/llfacebookconnect.cpp | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index abfacdb93c..451c0f5767 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -190,17 +190,28 @@ public:
 		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
 	}
 
+	void setUserDisconnected()
+	{
+		// Clear data
+		LLFacebookConnect::instance().clearInfo();
+		LLFacebookConnect::instance().clearContent();
+		//Notify state change
+		LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+	}
+
 	virtual void completed(U32 status, const std::string& reason, const LLSD& content)
 	{
-		if (isGoodStatus(status))
+		if (isGoodStatus(status)) 
 		{
 			LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
-			
-			// Clear data
-			LLFacebookConnect::instance().clearInfo();
-			LLFacebookConnect::instance().clearContent();
-			//Notify state change
-            LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+			setUserDisconnected();
+
+		}
+		//User not found so already disconnected
+		else if(status == 404)
+		{
+			LL_DEBUGS("FacebookConnect") << "Already disconnected. content: " << content << LL_ENDL;
+			setUserDisconnected();
 		}
 		else
 		{
-- 
cgit v1.2.3


From 3ba9cf20486ac80276f262c57a9280dc875504eb Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Tue, 3 Sep 2013 19:11:20 -0700
Subject: ACME-789: Remove SLShareHost setting from settings.xml

---
 indra/newview/app_settings/settings.xml | 11 -----------
 indra/newview/llfacebookconnect.cpp     | 15 ---------------
 2 files changed, 26 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 098693eb98..b199929d91 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3533,17 +3533,6 @@
         <key>Value</key>
         <integer>0</integer>
     </map>
-    <key>SLShareHost</key>
-    <map>
-      <key>Comment</key>
-      <string>Host for contacting SL FB services</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>String</string>
-      <key>Value</key>
-      <string></string>
-    </map>  
     <key>FastCacheFetchEnabled</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 451c0f5767..9c70757278 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -32,7 +32,6 @@
 #include "llagent.h"
 #include "llcallingcard.h"			// for LLAvatarTracker
 #include "llcommandhandler.h"
-#include "llcontrol.h"
 #include "llhttpclient.h"
 #include "llnotificationsutil.h"
 #include "llurlaction.h"
@@ -49,8 +48,6 @@ boost::scoped_ptr<LLEventPump> LLFacebookConnect::sStateWatcher(new LLEventStrea
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sInfoWatcher(new LLEventStream("FacebookConnectInfo"));
 boost::scoped_ptr<LLEventPump> LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent"));
 
-extern LLControlGroup gSavedSettings;
-
 // 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)
 {
@@ -360,18 +357,6 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master)
 {
 	static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-    
-	//*TODO : Remove this code along with extern and llcontrol.h header
-	std::string host = gSavedSettings.getString("SLShareHost");
-    if (!host.empty())
-    {
-        sFacebookConnectUrl = host + "/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho
-    }
-    else
-    {
-        sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-    }
-    //End removable part
 
 	std::string url = sFacebookConnectUrl + route;
 	if (include_read_from_master && mReadFromMaster)
-- 
cgit v1.2.3


From fcdd0e578ca1ac7b025c5583df1c42bd286b07af Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 6 Sep 2013 10:04:41 -0700
Subject: ACME-903: Link the 'Learn about posting to Facebook' text to the
 proper KB article

---
 indra/newview/skins/default/xui/en/panel_social_account.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 882e410bdb..d7235396fe 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -69,7 +69,7 @@
       name="account_learn_more_label"
       top_pad="20"
       type="string">
-      [https://support.secondlife.com/ Learn about posting to Facebook]
+      [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2149711 Learn about posting to Facebook]
     </text>
   </panel>
 </panel>
-- 
cgit v1.2.3


From bf22b7150d2884fb68982764cd6a122d9c23909a Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Fri, 6 Sep 2013 18:26:21 -0700
Subject: ACME-905 : Get the FacebookConnect cap each time we need it (it's not
 that much)

---
 indra/newview/llfacebookconnect.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 9c70757278..611d18d6d6 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -356,9 +356,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master)
 {
-	static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect");
-
-	std::string url = sFacebookConnectUrl + route;
+	std::string url = gAgent.getRegion()->getCapability("FacebookConnect");
+	url += route;
+    
 	if (include_read_from_master && mReadFromMaster)
 	{
 		url += "?read_from_master=true";
-- 
cgit v1.2.3


From eaf287cc20efbad97fba17a65efd57eeba0f7278 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 9 Sep 2013 13:36:34 -0700
Subject: ACME-906 : Clean up xml from overzealous background color and opacity
 settings

---
 indra/newview/skins/default/xui/en/floater_social.xml | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 39df777d1b..426c5507e4 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-
 <floater
   positioning="cascading"
   can_close="true"
@@ -18,9 +17,6 @@
    width="304"
    visible="true"
    name="background"
-   background_visible="true"
-   bg_opaque_color="DkGray"
-   bg_alpha_color="DkGray_66"
    follows="all"
    top="0"
    left="0">
@@ -30,9 +26,6 @@
      tab_min_width="70"
      tab_height="30"
      tab_position="top"
-     background_visible="true"
-     bg_opaque_color="DkGray"
-     bg_alpha_color="DkGray_66"
      top="7"
      height="437"
      halign="center">
@@ -68,9 +61,6 @@
     <panel
      name="connection_status_panel"
      follows="left|bottom|right"
-     background_visible="true"
-     bg_opaque_color="DkGray"
-     bg_alpha_color="DkGray_66"
      height="24">
      <text
       name="connection_error_text"
-- 
cgit v1.2.3


From f53b2bd880875b5194b6d298e1aad7d8951db9f3 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 20 Sep 2013 14:11:07 -0700
Subject: ACME-902: Link the '?' button to the proper viewer-help article or
 articles

---
 indra/newview/skins/default/xui/en/floater_social.xml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 426c5507e4..b7ff374d5f 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -3,7 +3,7 @@
   positioning="cascading"
   can_close="true"
   can_resize="false"
-  help_topic="social floater"
+  help_topic="floater_social"
   layout="topleft"
   name="floater_social"
   save_rect="true"
@@ -34,28 +34,24 @@
        class="llsocialstatuspanel"
        follows="all"
        label="STATUS"
-       help_topic="panel_social_status"
        name="panel_social_status"/>
      <panel
        filename="panel_social_photo.xml"
        class="llsocialphotopanel"
        follows="all"
        label="PHOTO"
-       help_topic="panel_social_photo"
        name="panel_social_photo"/>
      <panel
        filename="panel_social_place.xml"
        class="llsocialcheckinpanel"
        follows="all"
        label="CHECK IN"
-       help_topic="panel_social_place"
        name="panel_social_place"/>
      <panel
        filename="panel_social_account.xml"
        class="llsocialaccountpanel"
        follows="all"
        label="ACCOUNT"
-       help_topic="panel_social_account"
        name="panel_social_account"/>     
     </tab_container>
     <panel
-- 
cgit v1.2.3


From 8881b47d22a7cd17824e8162e0658af71bbe3dea Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 22 Oct 2013 01:35:01 -0400
Subject: MAINT-3331: On update, remove com.secondlife.indra.viewer.savedState.

---
 .../updater/scripts/darwin/update_install.py       | 37 +++++++++++++++++++---
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/indra/viewer_components/updater/scripts/darwin/update_install.py b/indra/viewer_components/updater/scripts/darwin/update_install.py
index 2fc6fcdb29..10d507c9ef 100755
--- a/indra/viewer_components/updater/scripts/darwin/update_install.py
+++ b/indra/viewer_components/updater/scripts/darwin/update_install.py
@@ -17,6 +17,7 @@ $/LicenseInfo$
 import os
 import sys
 import cgitb
+from contextlib import contextmanager
 import errno
 import glob
 import plistlib
@@ -32,6 +33,11 @@ import Tkinter, tkMessageBox
 TITLE = "Second Life Viewer Updater"
 # Magic bundle identifier used by all Second Life viewer bundles
 BUNDLE_IDENTIFIER = "com.secondlife.indra.viewer"
+# Magic OS directory name that causes Cocoa viewer to crash on OS X 10.7.5
+# (see MAINT-3331)
+STATE_DIR = os.path.join(
+    os.environ["HOME"], "Library", "Saved Application State",
+    BUNDLE_IDENTIFIER + ".savedState")
 
 # Global handle to the MessageFrame so we can update message
 FRAME = None
@@ -136,6 +142,23 @@ def write_marker(markerfile, markertext):
         # try to log it -- otherwise shrug.
         log("%s exception: %s" % (err.__class__.__name__, err))
 
+# ****************************************************************************
+#   Utility
+# ****************************************************************************
+@contextmanager
+def allow_errno(errn):
+    """
+    Execute body of 'with' statement, accepting OSError with specific errno
+    'errn'. Propagate any other exception, or an OSError with any other errno.
+    """
+    try:
+        # run the body of the 'with' statement
+        yield
+    except OSError, err:
+        # unless errno == passed errn, re-raise the exception
+        if err.errno != errn:
+            raise
+
 # ****************************************************************************
 #   Main script logic
 # ****************************************************************************
@@ -158,12 +181,9 @@ def main(dmgfile, markerfile, markertext):
 
         # Move the old updater.log file out of the way
         logname = os.path.join(logsdir, "updater.log")
-        try:
+        # Nonexistence is okay. Anything else, not so much.
+        with allow_errno(errno.ENOENT):
             os.rename(logname, logname + ".old")
-        except OSError, err:
-            # Nonexistence is okay. Anything else, not so much.
-            if err.errno != errno.ENOENT:
-                raise
 
         # Open new updater.log.
         global LOGF
@@ -345,6 +365,13 @@ def main(dmgfile, markerfile, markertext):
             log("touch " + appdir)
             os.utime(appdir, None)      # set to current time
 
+            # MAINT-3331: remove STATE_DIR. Empirically, this resolves a
+            # persistent, mysterious crash after updating our viewer on an OS
+            # X 10.7.5 system.
+            log("rm -rf '%s'" % STATE_DIR)
+            with allow_errno(errno.ENOENT):
+                shutil.rmtree(STATE_DIR)
+
             command = ["open", appdir]
             log(' '.join(command))
             subprocess.check_call(command, stdout=LOGF, stderr=subprocess.STDOUT)
-- 
cgit v1.2.3


From d5877bc365292358eb4c9b8d14d1c8a1237ca5bd Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Mon, 28 Oct 2013 14:37:06 +0200
Subject: MAINT-3343 FIXED Expand/Collapse message pan only on left click.

---
 indra/newview/llconversationview.cpp | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 4f875cca20..82d3fe74c0 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -267,6 +267,23 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
     //This node (conversation) was selected and a child (participant) was not
     if(result && getRoot())
     {
+
+		if(getRoot()->getCurSelectedItem() == this)
+		{
+			LLConversationItem* item = dynamic_cast<LLConversationItem *>(getViewModelItem());
+			LLUUID session_id = item? item->getUUID() : LLUUID();
+
+			LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
+			if (im_container->isConversationsPaneCollapsed() && im_container->getSelectedSession() == session_id)
+			{
+				im_container->collapseMessagesPane(!im_container->isMessagesPaneCollapsed());
+			}
+			else
+			{
+				im_container->collapseMessagesPane(false);
+			}
+
+		}
 		selectConversationItem();
     }
 
@@ -316,14 +333,6 @@ void LLConversationViewSession::selectConversationItem()
 		LLUUID session_id = item? item->getUUID() : LLUUID();
 
 		LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
-		if (im_container->isConversationsPaneCollapsed() && im_container->getSelectedSession() == session_id)
-		{
-			im_container->collapseMessagesPane(!im_container->isMessagesPaneCollapsed());
-		}
-		else
-		{
-			im_container->collapseMessagesPane(false);
-		}
 		im_container->flashConversationItemWidget(session_id,false);
 		im_container->selectConversationPair(session_id, false);
 	}
-- 
cgit v1.2.3


From 3a57a67c5d386cfa6df004915ecb0104b3207e72 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 28 Oct 2013 17:15:57 -0700
Subject: ACME-1099 : Fix crash when getting the Facebook cap from a
 (potentially null) region

---
 indra/newview/llfacebookconnect.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 611d18d6d6..9a20ce8f1b 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -356,13 +356,18 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
 
 std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master)
 {
-	std::string url = gAgent.getRegion()->getCapability("FacebookConnect");
-	url += route;
+    std::string url("");
+    LLViewerRegion *regionp = gAgent.getRegion();
+    if (regionp)
+    {
+        url = regionp->getCapability("FacebookConnect");
+        url += route;
     
-	if (include_read_from_master && mReadFromMaster)
-	{
-		url += "?read_from_master=true";
-	}
+        if (include_read_from_master && mReadFromMaster)
+        {
+            url += "?read_from_master=true";
+        }
+    }
 	return url;
 }
 
-- 
cgit v1.2.3


From 71205580d956d06fbdababd83ffe52885742d304 Mon Sep 17 00:00:00 2001
From: maksymsproductengine <maksymsproductengine@lindenlab.com>
Date: Tue, 5 Nov 2013 04:23:12 +0200
Subject: MAINT-3376 FIXED Successive llSetTextureAnim calls fail in 3.6.10
 (283075) unless a different command (llSleep(0.01), llSay(0,"hello")) is
 placed between them.:  - fix for MAINT-2861 was reverted to resolve this
 issue;

---
 indra/newview/llvovolume.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 5205bc6987..8677c02829 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -334,8 +334,15 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
 				if (!mTextureAnimp)
 				{
 					mTextureAnimp = new LLViewerTextureAnim(this);
-					mTexAnimMode = 0;
 				}
+				else
+				{
+					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
+					{
+						mTextureAnimp->reset();
+					}
+				}
+				mTexAnimMode = 0;
 				
 				mTextureAnimp->unpackTAMessage(mesgsys, block_num);
 			}
-- 
cgit v1.2.3


From 976ad95977ab752231abf7f774e28ca167a6db39 Mon Sep 17 00:00:00 2001
From: Aura Linden <aura@lindenlab.com>
Date: Tue, 5 Nov 2013 13:01:25 -0800
Subject: Shot in the dark patch for MAINT-3353 backported from viewer-tiger

---
 indra/llwindow/llwindowcallbacks.cpp |  1 +
 indra/llwindow/llwindowmacosx.cpp    | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp
index 9712ae1d91..eadff8a6b4 100755
--- a/indra/llwindow/llwindowcallbacks.cpp
+++ b/indra/llwindow/llwindowcallbacks.cpp
@@ -122,6 +122,7 @@ void LLWindowCallbacks::handleResize(LLWindow *window, const S32 width, const S3
 
 void LLWindowCallbacks::handleFocus(LLWindow *window)
 {
+	 LL_WARNS("COCOA") << "Called handleFocus proto" << LL_ENDL;
 }
 
 void LLWindowCallbacks::handleFocusLost(LLWindow *window)
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index d5b62bd3a7..11c0b51086 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -331,7 +331,16 @@ void callMouseExit()
 
 void callWindowFocus()
 {
-	gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation);
+   if ( gWindowImplementation && gWindowImplementation->getCallbacks() )
+	{
+		gWindowImplementation->getCallbacks()->handleFocus (gWindowImplementation);
+	}
+	else
+	{
+		LL_WARNS("COCOA") << "Window Implementation or callbacks not yet initialized." << LL_ENDL;
+	}
+
+
 }
 
 void callWindowUnfocus()
-- 
cgit v1.2.3


From 9ad67587b776fc9e8727ad6b79ed328cccbfbf93 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 7 Nov 2013 16:18:17 -0600
Subject: DRTVWR-338 Make an inocuous change to get a new build number out of
 TeamCity

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1c532e957e..d9093c2a6d 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9861,7 +9861,7 @@
     <key>RenderUseVAO</key>
     <map>
       <key>Comment</key>
-      <string>[EXPERIMENTAL] Use GL Vertex Array Objects</string>
+      <string>[EXPERIMENTAL] Use GL Vertex Array Objects.</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
-- 
cgit v1.2.3


From 424e8687e443aad1b76be5ec54fee0ba9f22ef65 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 11 Nov 2013 15:25:46 -0500
Subject: Added tag 3.6.10-release for changeset 5b54b36862ff

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c81c919d1a..d598ff1f62 100755
--- a/.hgtags
+++ b/.hgtags
@@ -468,3 +468,4 @@ bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release
 ae457ece77001767ae9613148c495e7b98cc0f4a 3.6.7-release
 d40c66e410741de7e90b1ed6dac28dd8a2d7e1f6 3.6.8-release
 70eda3721d36df3e00730629c42a1304e5bc65b8 3.6.9-release
+5b54b36862ff8bc3b6935673c9d1c1f22ee8d521 3.6.10-release
-- 
cgit v1.2.3


From b8cafb8e850c9bc65f61202d6caba5725a33aef7 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 11 Nov 2013 15:26:19 -0500
Subject: increment viewer version to 3.6.11

---
 indra/newview/VIEWER_VERSION.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index c47e8b5872..e8b6c77dc9 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-3.6.10
+3.6.11
-- 
cgit v1.2.3


From ebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Mon, 11 Nov 2013 15:26:55 -0500
Subject: convert dos line endings

---
 indra/newview/llvovolume.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 8677c02829..dfac77857c 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -335,13 +335,13 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
 				{
 					mTextureAnimp = new LLViewerTextureAnim(this);
 				}
-				else
-				{
-					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
-					{
-						mTextureAnimp->reset();
-					}
-				}
+				else
+				{
+					if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH))
+					{
+						mTextureAnimp->reset();
+					}
+				}
 				mTexAnimMode = 0;
 				
 				mTextureAnimp->unpackTAMessage(mesgsys, block_num);
-- 
cgit v1.2.3