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 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 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 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 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 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 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 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 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 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 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 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 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 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 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