From 8016e73cc0a2a27062fae27e609535e002eef362 Mon Sep 17 00:00:00 2001
From: Leyla Farazha <leyla@lindenlab.com>
Date: Thu, 9 Jul 2009 22:30:15 +0000
Subject: [PATCH] svn merge -r126726:126727
 svn+ssh://svn.lindenlab.com/linden/branches/skinning/skinning-15/ DEV-35109 
 Nav bar does not record teleports taken by any method other than typing into
 nav bar DEV-35117  Hard to open local chat, needs bottom bar widget for now
 hiding test IM floaters

---
 indra/newview/llimpanel.cpp                     |  2 +-
 indra/newview/lllocationhistory.cpp             | 17 +++++++++++++++++
 indra/newview/llnavigationbar.cpp               |  3 ---
 .../skins/default/xui/en/floater_im_session.xml |  1 +
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index e5b05d9f515..9bf147584a6 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -2074,7 +2074,7 @@ void LLIMFloater::show(const LLUUID& session_id, S32 center_x)
 		floater->setVisible(false);
 	}
 
-	floater->setVisibleAndFrontmost(true);
+	//floater->setVisibleAndFrontmost(true);
 
 	floater->updateMessages(session_id);
 
diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp
index 179eca2532b..43512372b13 100644
--- a/indra/newview/lllocationhistory.cpp
+++ b/indra/newview/lllocationhistory.cpp
@@ -37,11 +37,28 @@
 #include <iomanip> // for std::setw()
 
 #include "llui.h"
+#include "llagent.h"
+#include "llslurl.h"
+#include "llviewerregion.h"
+#include "llviewerparcelmgr.h"
+
+
+void addLocationHistory()
+{	
+	LLVector3 position = gAgent.getPositionAgent();
+	std::string region_name = gAgent.getRegion()->getName();
+	std::string location = LLSLURL::buildSLURL(region_name, position.mV[VX], 
+		                                       position.mV[VY], position.mV[VZ]);
+	LLLocationHistory* lh = LLLocationHistory::getInstance();
+	lh->addItem(location);
+	lh->save();
+}
 
 LLLocationHistory::LLLocationHistory() :
 	mFilename("typed_locations.txt"),
 	mLoadedCallback(NULL)
 {
+	LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(addLocationHistory);
 }
 
 void LLLocationHistory::addItem(std::string item)
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index b4a6e63de81..df43b069c8e 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -415,10 +415,7 @@ void LLNavigationBar::onRegionNameResponse(
 	S32 selected_item = mCmbLocation->getCurrentIndex();
 	if (selected_item == -1) // user has typed text
 	{
-		LLLocationHistory* lh = LLLocationHistory::getInstance();
 		mCmbLocation->add(typed_location);
-		lh->addItem(typed_location);
-		lh->save();
 	}
 
 	// Teleport to the location.
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 7c95fcd96a3..0856a787f39 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -7,6 +7,7 @@
  left="0"
  name="panel_im"
  top="0"
+ visible="false" 
  width="300">
   <text_editor
    enabled="false"
-- 
GitLab