diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 647512eb2edff26b935ea737bdf98ef86cfddd10..8772779645a693dbb3393e5b3996c431a66eedd9 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -599,6 +599,11 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
 		if(!fgi)
 		{
 			fgi = mFontFreetype->getGlyphInfo(wch);
+
+			if (NULL == fgi)
+			{
+				return 0;
+			}
 		}
 
 		// account for glyphs that run beyond the starting point for the next glyphs
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index a1b6d61cdabbf2175354f4e7fe1be078f9113168..c4ec1edc7370595ab71516a39c7f721a363cd033 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1919,6 +1919,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
 	registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url));
 	registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url));
 	registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url));
+	registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url));
 	registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url));
 	registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url));
 	registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url));
@@ -2337,7 +2338,6 @@ const LLWString& LLTextBase::getWText() const
 S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, bool hit_past_end_of_line) const
 {
 	// Figure out which line we're nearest to.
-	LLRect visible_region = getVisibleDocumentRect();
 	LLRect doc_rect = mDocumentView->getRect();
 
 	S32 doc_y = local_y - doc_rect.mBottom;
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 2f120479d9ff401ff8af91713fe24f8bc095c4cf..d5e08fa29b681f4ebbbf9ea16e1ad313405200de 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2515,7 +2515,6 @@ void LLTextEditor::updateSegments()
 		mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
 
 		clearSegments();
-		segment_set_t::iterator insert_it = mSegments.begin();
 		for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
 		{
 			insertSegment(*list_it);
diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp
index fd872eca4bfe4a633abf8a21229b6c7d125c1908..f51aeaec1315b56e1fa4c560cd4fc4a6305ce201 100644
--- a/indra/llui/llurlaction.cpp
+++ b/indra/llui/llurlaction.cpp
@@ -24,7 +24,6 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
-
 #include "linden_common.h"
 
 #include "llurlaction.h"
@@ -32,6 +31,7 @@
 #include "llwindow.h"
 #include "llurlregistry.h"
 
+
 // global state for the callback functions
 LLUrlAction::url_callback_t 		LLUrlAction::sOpenURLCallback;
 LLUrlAction::url_callback_t 		LLUrlAction::sOpenURLInternalCallback;
@@ -158,16 +158,33 @@ void LLUrlAction::showProfile(std::string url)
 	}
 }
 
-void LLUrlAction::sendIM(std::string url)
+std::string LLUrlAction::getUserID(std::string url)
 {
 	LLURI uri(url);
 	LLSD path_array = uri.pathArray();
+	std::string id_str;
 	if (path_array.size() == 4)
 	{
-		std::string id_str = path_array.get(2).asString();
-		if (LLUUID::validate(id_str))
-		{
-			executeSLURL("secondlife:///app/agent/" + id_str + "/im");
-		}
+		id_str = path_array.get(2).asString();
 	}
+	return id_str;
 }
+
+void LLUrlAction::sendIM(std::string url)
+{
+	std::string id_str = getUserID(url);
+	if (LLUUID::validate(id_str))
+	{
+		executeSLURL("secondlife:///app/agent/" + id_str + "/im");
+	}
+}
+
+void LLUrlAction::addFriend(std::string url)
+{
+	std::string id_str = getUserID(url);
+	if (LLUUID::validate(id_str))
+	{
+		executeSLURL("secondlife:///app/agent/" + id_str + "/requestfriend");
+	}
+}
+
diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h
index f5f2ceba728daa686544c0b9976de3e650947ac8..e31cd71a20769acd176ab616a3ce37160a93c6d9 100644
--- a/indra/llui/llurlaction.h
+++ b/indra/llui/llurlaction.h
@@ -76,7 +76,9 @@ class LLUrlAction
 
 	/// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile
 	static void showProfile(std::string url);
+	static std::string getUserID(std::string url);
 	static void sendIM(std::string url);
+	static void addFriend(std::string url);
 
 	/// specify the callbacks to enable this class's functionality
 	typedef boost::function<void (const std::string&)> url_callback_t;
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index ce063a9887a777d58d0671f010226cc79da6b250..b513a52ff7c56c360c3f04af6edfdd900bb16201 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -193,7 +193,7 @@ static void on_avatar_name_cache_start_im(const LLUUID& agent_id,
 // static
 void LLAvatarActions::startIM(const LLUUID& id)
 {
-	if (id.isNull())
+	if (id.isNull() || gAgent.getID() == id)
 		return;
 
 	LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_cache_start_im, _1, _2));
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 0152571e20f67789366d0502bc944c874296e52d..53926c1fef6de4e531d81fe8b137362430853ae7 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -58,7 +58,7 @@
 #include "llworld.h"
 #include "lluiconstants.h"
 #include "llstring.h"
-
+#include "llurlaction.h"
 #include "llviewercontrol.h"
 
 static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history");
@@ -156,6 +156,17 @@ class LLChatHistoryHeader: public LLPanel
 			LLFloaterSidePanelContainer::showPanel("people", "panel_people",
 				LLSD().with("people_panel_tab_name", "blocked_panel").with("blocked_to_select", getAvatarId()));
 		}
+		else if (level == "map")
+		{
+			std::string url = "secondlife://" + mObjectData["slurl"].asString();
+			LLUrlAction::showLocationOnMap(url);
+		}
+		else if (level == "teleport")
+		{
+			std::string url = "secondlife://" + mObjectData["slurl"].asString();
+			LLUrlAction::teleportToLocation(url);
+		}
+
 	}
 
 	void onAvatarIconContextMenuItemClicked(const LLSD& userdata)
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index b202cfc9d3f46b1abac996f8ce69e573c7532bc7..5ab108b39fbc3279120a71c3933d9bdcd2c44ca2 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -390,7 +390,7 @@ bool LLConversationLogList::isActionEnabled(const LLSD& userdata)
 	{
 		return is_p2p && LLAvatarActions::canOfferTeleport(selected_id);
 	}
-	else if ("can_show_on_map")
+	else if ("can_show_on_map" == command_name)
 	{
 		return is_p2p && ((LLAvatarTracker::instance().isBuddyOnline(selected_id) && is_agent_mappable(selected_id)) || gAgent.isGodlike());
 	}
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 009fce0a92a4d35c4ef59c5830a9f58c299db29e..c74ce24872f87d9125f7720f7f015cba4ac6c31b 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -139,6 +139,8 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32
 		items.push_back(std::string("remove_friend"));
 		items.push_back(std::string("invite_to_group"));
 		items.push_back(std::string("separator_invite_to_group"));
+		if (static_cast<LLConversationItem*>(mParent)->getType() == CONV_SESSION_NEARBY)
+			items.push_back(std::string("zoom_in"));
 		items.push_back(std::string("map"));
 		items.push_back(std::string("share"));
 		items.push_back(std::string("pay"));
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 5f1b3dcfb11517a6295ce5389e084e6e93a02264..1607a681c719df44f8fee422e7c1b3613a95787e 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1026,6 +1026,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
 		{
 			LLAvatarActions::inviteToGroup(userID);
 		}
+		else if ("zoom_in" == command)
+		{
+			handle_zoom_to_object(userID);
+		}
 		else if ("map" == command)
 		{
 			LLAvatarActions::showOnMap(userID);
@@ -1217,7 +1221,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
 	}
 
 	// Handle all other options
-	if (("can_invite" == item) || ("can_chat_history" == item) || ("can_share" == item) || ("can_pay" == item))
+	if (("can_invite" == item) || ("can_chat_history" == item) || ("can_share" == item) || ("can_pay" == item) || ("can_zoom_in" == item))
 	{
 		// Those menu items are enable only if a single avatar is selected
 		return is_single_select;
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index cfee5001a6d30e9348681fb9edc1deee7402fc80..eb1a1f54ed4231778a9d404ad92899d30a88880c 100644
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -274,7 +274,7 @@ void LLFloaterIMNearbyChat::onTearOffClicked()
 	LLFloaterIMSessionTab::onTearOffClicked();
 
 	// see CHUI-170: Save torn-off state of the nearby chat between sessions
-	BOOL in_the_multifloater = !isTornOff();
+	BOOL in_the_multifloater = (BOOL)getHost();
 	gSavedSettings.setBOOL("NearbyChatIsNotTornOff", in_the_multifloater);
 }
 
@@ -297,8 +297,10 @@ void LLFloaterIMNearbyChat::onClose(bool app_quitting)
 void LLFloaterIMNearbyChat::onClickCloseBtn()
 {
 	if (!isTornOff())
+	{
 		return;
-	onTearOffClicked();
+	}
+	LLFloaterIMSessionTab::onTearOffClicked();
 	
 	LLFloaterIMContainer *im_box = LLFloaterIMContainer::findInstance();
 	if (im_box)
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index faeb8607128833710b63021e45a0cad2350ab9db..9fd22b15372ebabf148f66bfc965ffe9235aacf1 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -61,6 +61,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
   , mRefreshTimer(new LLTimer())
   , mIsHostAttached(false)
   , mHasVisibleBeenInitialized(false)
+  , mIsParticipantListExpanded(true)
 {
     setAutoFocus(FALSE);
 	mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
@@ -180,6 +181,7 @@ void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id)
 				// LLFloater::mLastHostHandle = floater_container (a "future" host)
 				conversp->setHost(floater_container);
 				conversp->setHost(NULL);
+
 				conversp->forceReshape();
 			}
 			// Added floaters share some state (like sort order) with their host
@@ -253,6 +255,7 @@ BOOL LLFloaterIMSessionTab::postBuild()
     p.root = NULL;
     p.use_ellipses = true;
     p.options_menu = "menu_conversation.xml";
+    p.name = "root";
 	mConversationsRoot = LLUICtrlFactory::create<LLFolderView>(p);
     mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar);
 	// Attach that root to the scroller
@@ -268,6 +271,12 @@ BOOL LLFloaterIMSessionTab::postBuild()
 	mRefreshTimer->setTimerExpirySec(0);
 	mRefreshTimer->start();
 	initBtns();
+
+	if (mIsParticipantListExpanded != (bool)gSavedSettings.getBOOL("IMShowControlPanel"))
+	{
+		LLFloaterIMSessionTab::onSlide(this);
+	}
+
 	return result;
 }
 
@@ -637,7 +646,7 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar()
 	// Participant list should be visible only in torn off floaters.
 	bool is_participant_list_visible =
 			!is_not_torn_off
-			&& gSavedSettings.getBOOL("IMShowControlPanel")
+			&& mIsParticipantListExpanded
 			&& !mIsP2PChat;
 
 	mParticipantListPanel->setVisible(is_participant_list_visible);
@@ -768,9 +777,8 @@ void LLFloaterIMSessionTab::onSlide(LLFloaterIMSessionTab* self)
 
 			// Expand/collapse the IM control panel
 			self->mParticipantListPanel->setVisible(expand);
-
-			gSavedSettings.setBOOL("IMShowControlPanel", expand);
-
+            gSavedSettings.setBOOL("IMShowControlPanel", expand);
+            self->mIsParticipantListExpanded = expand;
 			self->mExpandCollapseBtn->setImageOverlay(self->getString(expand ? "collapse_icon" : "expand_icon"));
 		}
 	}
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index d55b021df7f3110867bbcf7ce6ca74be385f8b9d..e8ae5574127fba3cd1999002cefdd9bff60064aa 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -138,6 +138,7 @@ class LLFloaterIMSessionTab
 
 	bool mIsNearbyChat;
 	bool mIsP2PChat;
+	bool mIsParticipantListExpanded;
 
 	LLIMModel::LLIMSession* mSession;
 
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b308a820b2e1c5b26c42065c1a8781383b1efdb1..a28af2101b8e1a4ac021ed799ff7595c860f7443 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -443,6 +443,8 @@ BOOL LLFloaterPreference::postBuild()
 	std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
 	setCacheLocation(cache_location);
 
+	getChild<LLUICtrl>("log_path_string")->setEnabled(FALSE); // make it read-only but selectable
+
 	getChild<LLComboBox>("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this));
 
 	getChild<LLComboBox>("FriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"FriendIMOptions"));
@@ -1572,7 +1574,6 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
 	getChildView("send_im_to_email")->setEnabled(TRUE);
 	getChild<LLUICtrl>("send_im_to_email")->setValue(im_via_email);
 	getChildView("favorites_on_login_check")->setEnabled(TRUE);
-	getChildView("log_path_string")->setEnabled(FALSE);// LineEditor becomes readonly in this case.
 	getChildView("log_path_button")->setEnabled(TRUE);
 	getChildView("chat_font_size")->setEnabled(TRUE);
 }
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 699e36db4f72454f015dff6113eea9a680ee983b..cd47a0c171bfcedcb18aa4387573fd24895506e5 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -286,6 +286,10 @@ void on_new_message(const LLSD& msg)
 				//Surface conversations floater
 				LLFloaterReg::showInstance("im_container");
 				im_box->collapseMessagesPane(false);
+				if (session_floater && session_floater->isMinimized())
+				{
+					LLFloater::onClickMinimize(session_floater);
+				}
 			}
 
             //If in DND mode, allow notification to be stored so upon DND exit 
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index c5283404f13e64ce8f1429873201fbdda8fc1152..4138558bad150b4414f45eceb37845ab78a49c6c 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -611,10 +611,10 @@ BOOL LLPanelPeople::postBuild()
 	mGroupList->setNoItemsMsg(getString("no_groups_msg"));
 	mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg"));
 
-	mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
-	mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
-	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
-	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+	mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyPeopleContextMenu);
+	mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+	mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
 
 	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);
 	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false);
@@ -1143,7 +1143,10 @@ void LLPanelPeople::onGearButtonClicked(LLUICtrl* btn)
 	uuid_vec_t selected_uuids;
 	getCurrentItemIDs(selected_uuids);
 	// Spawn at bottom left corner of the button.
-	LLPanelPeopleMenus::gNearbyMenu.show(btn, selected_uuids, 0, 0);
+	if (getActiveTabName() == NEARBY_TAB_NAME)
+		LLPanelPeopleMenus::gNearbyPeopleContextMenu.show(btn, selected_uuids, 0, 0);
+	else
+		LLPanelPeopleMenus::gPeopleContextMenu.show(btn, selected_uuids, 0, 0);
 }
 
 void LLPanelPeople::onImButtonClicked()
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 47d6b49a50606cc6558118d7999f72dc51eba4b1..aa14b74869408c8c3f2ccfaf490f7534b6c2580e 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -39,15 +39,17 @@
 #include "llcallingcard.h"			// for LLAvatarTracker
 #include "lllogchat.h"
 #include "llviewermenu.h"			// for gMenuHolder
+#include "llconversationmodel.h"
 
 namespace LLPanelPeopleMenus
 {
 
-NearbyMenu gNearbyMenu;
+PeopleContextMenu gPeopleContextMenu;
+NearbyPeopleContextMenu gNearbyPeopleContextMenu;
 
-//== NearbyMenu ===============================================================
+//== PeopleContextMenu ===============================================================
 
-LLContextMenu* NearbyMenu::createMenu()
+LLContextMenu* PeopleContextMenu::createMenu()
 {
 	// set up the callbacks for all of the avatar menu items
 	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
@@ -64,7 +66,8 @@ LLContextMenu* NearbyMenu::createMenu()
 		registrar.add("Avatar.RemoveFriend",	boost::bind(&LLAvatarActions::removeFriendDialog, 		id));
 		registrar.add("Avatar.IM",				boost::bind(&LLAvatarActions::startIM,					id));
 		registrar.add("Avatar.Call",			boost::bind(&LLAvatarActions::startCall,				id));
-		registrar.add("Avatar.OfferTeleport",	boost::bind(&NearbyMenu::offerTeleport,					this));
+		registrar.add("Avatar.OfferTeleport",	boost::bind(&PeopleContextMenu::offerTeleport,			this));
+		registrar.add("Avatar.ZoomIn",			boost::bind(&handle_zoom_to_object,						id));
 		registrar.add("Avatar.ShowOnMap",		boost::bind(&LLAvatarActions::showOnMap,				id));
 		registrar.add("Avatar.Share",			boost::bind(&LLAvatarActions::share,					id));
 		registrar.add("Avatar.Pay",				boost::bind(&LLAvatarActions::pay,						id));
@@ -72,33 +75,72 @@ LLContextMenu* NearbyMenu::createMenu()
 		registrar.add("Avatar.InviteToGroup",	boost::bind(&LLAvatarActions::inviteToGroup,			id));
 		registrar.add("Avatar.Calllog",			boost::bind(&LLAvatarActions::viewChatHistory,			id));
 
-		enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem,	this, _2));
-		enable_registrar.add("Avatar.CheckItem",  boost::bind(&NearbyMenu::checkContextMenuItem,	this, _2));
+		enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2));
+		enable_registrar.add("Avatar.CheckItem",  boost::bind(&PeopleContextMenu::checkContextMenuItem,	this, _2));
 
 		// create the context menu from the XUI
 		menu = createFromFile("menu_people_nearby.xml");
+		buildContextMenu(*menu, 0x0);
 	}
 	else
 	{
 		// Set up for multi-selected People
 
 		// registrar.add("Avatar.AddFriend",	boost::bind(&LLAvatarActions::requestFriendshipDialog,	mUUIDs)); // *TODO: unimplemented
-		registrar.add("Avatar.IM",			boost::bind(&LLAvatarActions::startConference,			mUUIDs, LLUUID::null));
-		registrar.add("Avatar.Call",		boost::bind(&LLAvatarActions::startAdhocCall,			mUUIDs, LLUUID::null));
-		registrar.add("Avatar.OfferTeleport",	boost::bind(&NearbyMenu::offerTeleport,					this));
-		registrar.add("Avatar.RemoveFriend",boost::bind(&LLAvatarActions::removeFriendsDialog,		mUUIDs));
+		registrar.add("Avatar.IM",				boost::bind(&LLAvatarActions::startConference,			mUUIDs, LLUUID::null));
+		registrar.add("Avatar.Call",			boost::bind(&LLAvatarActions::startAdhocCall,			mUUIDs, LLUUID::null));
+		registrar.add("Avatar.OfferTeleport",	boost::bind(&PeopleContextMenu::offerTeleport,			this));
+		registrar.add("Avatar.RemoveFriend",	boost::bind(&LLAvatarActions::removeFriendsDialog,		mUUIDs));
 		// registrar.add("Avatar.Share",		boost::bind(&LLAvatarActions::startIM,					mUUIDs)); // *TODO: unimplemented
-		// registrar.add("Avatar.Pay",		boost::bind(&LLAvatarActions::pay,						mUUIDs)); // *TODO: unimplemented
-		enable_registrar.add("Avatar.EnableItem",	boost::bind(&NearbyMenu::enableContextMenuItem,	this, _2));
+		// registrar.add("Avatar.Pay",			boost::bind(&LLAvatarActions::pay,						mUUIDs)); // *TODO: unimplemented
+		
+		enable_registrar.add("Avatar.EnableItem",	boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2));
 
 		// create the context menu from the XUI
 		menu = createFromFile("menu_people_nearby_multiselect.xml");
+		buildContextMenu(*menu, ITEM_IN_MULTI_SELECTION);
 	}
 
     return menu;
 }
 
-bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
+void PeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
+{
+    menuentry_vec_t items;
+    menuentry_vec_t disabled_items;
+	
+	if (flags & ITEM_IN_MULTI_SELECTION)
+	{
+		items.push_back(std::string("add_friends"));
+		items.push_back(std::string("remove_friends"));
+		items.push_back(std::string("im"));
+		items.push_back(std::string("call"));
+		items.push_back(std::string("share"));
+		items.push_back(std::string("pay"));
+		items.push_back(std::string("offer_teleport"));
+	}
+	else 
+	{
+		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("voice_call"));
+		items.push_back(std::string("chat_history"));
+		items.push_back(std::string("separator_chat_history"));
+		items.push_back(std::string("add_friend"));
+		items.push_back(std::string("remove_friend"));
+		items.push_back(std::string("invite_to_group"));
+		items.push_back(std::string("separator_invite_to_group"));
+		items.push_back(std::string("map"));
+		items.push_back(std::string("share"));
+		items.push_back(std::string("pay"));
+		items.push_back(std::string("block_unblock"));
+	}
+
+    hide_context_entries(menu, items, disabled_items);
+}
+
+bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
 {
 	if(gAgent.getID() == mUUIDs.front())
 	{
@@ -186,14 +228,15 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
 		return LLLogChat::isTranscriptExist(mUUIDs.front());
 	}
 	else if (item == std::string("can_im") || item == std::string("can_invite") ||
-	         item == std::string("can_share") || item == std::string("can_pay"))
+	         item == std::string("can_share") || item == std::string("can_pay") ||
+			 item == std::string("can_zoom_in"))
 	{
 		return true;
 	}
 	return false;
 }
 
-bool NearbyMenu::checkContextMenuItem(const LLSD& userdata)
+bool PeopleContextMenu::checkContextMenuItem(const LLSD& userdata)
 {
 	std::string item = userdata.asString();
 	const LLUUID& id = mUUIDs.front();
@@ -206,11 +249,50 @@ bool NearbyMenu::checkContextMenuItem(const LLSD& userdata)
 	return false;
 }
 
-void NearbyMenu::offerTeleport()
+void PeopleContextMenu::offerTeleport()
 {
 	// boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(),
 	// so we have to use a wrapper.
 	LLAvatarActions::offerTeleport(mUUIDs);
 }
 
+//== NearbyPeopleContextMenu ===============================================================
+
+void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
+{
+    menuentry_vec_t items;
+    menuentry_vec_t disabled_items;
+	
+	if (flags & ITEM_IN_MULTI_SELECTION)
+	{
+		items.push_back(std::string("add_friends"));
+		items.push_back(std::string("remove_friends"));
+		items.push_back(std::string("im"));
+		items.push_back(std::string("call"));
+		items.push_back(std::string("share"));
+		items.push_back(std::string("pay"));
+		items.push_back(std::string("offer_teleport"));
+	}
+	else 
+	{
+		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("voice_call"));
+		items.push_back(std::string("chat_history"));
+		items.push_back(std::string("separator_chat_history"));
+		items.push_back(std::string("add_friend"));
+		items.push_back(std::string("remove_friend"));
+		items.push_back(std::string("invite_to_group"));
+		items.push_back(std::string("separator_invite_to_group"));
+		items.push_back(std::string("zoom_in"));
+		items.push_back(std::string("map"));
+		items.push_back(std::string("share"));
+		items.push_back(std::string("pay"));
+		items.push_back(std::string("block_unblock"));
+	}
+
+    hide_context_entries(menu, items, disabled_items);
+}
+
 } // namespace LLPanelPeopleMenus
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index d51eaec7167a9b80c905796e6196a9fb5d999f63..0a1dcef303f65cc55096adb79d18f1858a3f0df3 100644
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -33,19 +33,33 @@ namespace LLPanelPeopleMenus
 {
 
 /**
- * Menu used in the nearby people list.
+ * Menu used in the people lists.
  */
-class NearbyMenu : public LLListContextMenu
+class PeopleContextMenu : public LLListContextMenu
 {
 public:
 	/*virtual*/ LLContextMenu* createMenu();
+
+protected:
+	virtual void buildContextMenu(class LLMenuGL& menu, U32 flags);
+
 private:
 	bool enableContextMenuItem(const LLSD& userdata);
 	bool checkContextMenuItem(const LLSD& userdata);
 	void offerTeleport();
 };
 
-extern NearbyMenu gNearbyMenu;
+/**
+ * Menu used in the nearby people list.
+ */
+class NearbyPeopleContextMenu : public PeopleContextMenu
+{
+protected:
+	/*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
+};
+
+extern PeopleContextMenu gPeopleContextMenu;
+extern NearbyPeopleContextMenu gNearbyPeopleContextMenu;
 
 } // namespace LLPanelPeopleMenus
 
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 2340436a01f7f00a2527937379160e9b6124a1e1..a13c793899e56498dd2938f54a346555b676d53a 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2382,7 +2382,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 	    LLPostponedNotification::add<LLPostponedIMSystemTipNotification>(params, from_id, false);
 		break;
 
-	case IM_NOTHING_SPECIAL: 
+	case IM_NOTHING_SPECIAL:	// p2p IM
 		// Don't show dialog, just do IM
 		if (!gAgent.isGodlike()
 				&& gAgent.getRegion()->isPrelude() 
@@ -2783,47 +2783,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 	}
 	break;
 	
-	case IM_SESSION_SEND:
-	{
-		if (is_do_not_disturb)
-		{
-			return;
-		}
-
-		// Only show messages if we have a session open (which
-		// should happen after you get an "invitation"
-		if ( !gIMMgr->hasSession(session_id) )
-		{
-			return;
-		}
-
-		// standard message, not from system
-		std::string saved;
-		if(offline == IM_OFFLINE)
-		{
-			saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
-		}
-		buffer = saved + message;
-		BOOL is_this_agent = FALSE;
-		if(from_id == gAgentID)
-		{
-			is_this_agent = TRUE;
-		}
-		gIMMgr->addMessage(
-			session_id,
-			from_id,
-			name,
-			buffer,
-			IM_OFFLINE == offline,
-			ll_safe_string((char*)binary_bucket),
-			IM_SESSION_INVITE,
-			parent_estate_id,
-			region_id,
-			position,
-			true);
-	}
-	break;
-
 	case IM_FROM_TASK:
 		{
 			if (is_do_not_disturb && !is_owned_by_me)
@@ -2922,6 +2881,76 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			LLPostponedNotification::add<LLPostponedServerObjectNotification>(params, from_id, from_group);
 		}
 		break;
+
+	case IM_SESSION_SEND:		// ad-hoc or group IMs
+
+		// Only show messages if we have a session open (which
+		// should happen after you get an "invitation"
+		if ( !gIMMgr->hasSession(session_id) )
+		{
+			return;
+		}
+
+		else if (offline == IM_ONLINE && is_do_not_disturb)
+		{
+
+			// return a standard "do not disturb" message, but only do it to online IM 
+			// (i.e. not other auto responses and not store-and-forward IM)
+			if (!gIMMgr->hasSession(session_id))
+			{
+				// if there is not a panel for this conversation (i.e. it is a new IM conversation
+				// initiated by the other party) then...
+				send_do_not_disturb_message(msg, from_id, session_id);
+			}
+
+			// now store incoming IM in chat history
+
+			buffer = message;
+	
+			LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
+
+			// add to IM panel, but do not bother the user
+			gIMMgr->addMessage(
+				session_id,
+				from_id,
+				name,
+				buffer,
+				IM_OFFLINE == offline,
+				ll_safe_string((char*)binary_bucket),
+				IM_SESSION_INVITE,
+				parent_estate_id,
+				region_id,
+				position,
+				true);
+		}
+		else
+		{
+			// standard message, not from system
+			std::string saved;
+			if(offline == IM_OFFLINE)
+			{
+				saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
+			}
+
+			buffer = saved + message;
+
+			LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
+
+			gIMMgr->addMessage(
+				session_id,
+				from_id,
+				name,
+				buffer,
+				IM_OFFLINE == offline,
+				ll_safe_string((char*)binary_bucket),
+				IM_SESSION_INVITE,
+				parent_estate_id,
+				region_id,
+				position,
+				true);
+		}
+		break;
+
 	case IM_FROM_TASK_AS_ALERT:
 		if (is_do_not_disturb && !is_owned_by_me)
 		{
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index fd5c86b3cae38d7516e29e6d3fa679c15777e00d..5a13ef0a592f136d7e6c45845ac323a11e82a4fa 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -89,7 +89,14 @@
         <on_click function="Avatar.DoToSelected" parameter="invite_to_group" />
         <on_enable function="Avatar.EnableItem" parameter="can_invite" />
     </menu_item_call>
-    <menu_item_separator layout="topleft" name="separator_invite_to_group"/>		
+    <menu_item_separator layout="topleft" name="separator_invite_to_group"/>
+    <menu_item_call
+     label="Zoom In"
+     layout="topleft"
+     name="zoom_in">
+      <on_click function="Avatar.DoToSelected" parameter="zoom_in" />
+      <on_enable function="Avatar.EnableItem" parameter="can_zoom_in" />
+    </menu_item_call>
     <menu_item_call
      label="Map"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_im_conversation.xml b/indra/newview/skins/default/xui/en/menu_im_conversation.xml
index 8882d0a7d8ed5ce8ff757c7c5dc6a698fe0b7d00..43287c6ec36e8fe6313c0f5c493d29a976232748 100644
--- a/indra/newview/skins/default/xui/en/menu_im_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_im_conversation.xml
@@ -49,6 +49,13 @@
     </menu_item_call>
     <menu_item_separator
      layout="topleft"/>
+    <menu_item_call
+       label="Zoom In"
+       layout="topleft"
+       name="zoom_in">
+      <on_click function="Avatar.DoToSelected" parameter="zoom_in" />
+      <on_enable function="Avatar.EnableItem" parameter="can_zoom_in" />
+    </menu_item_call>
     <menu_item_call
      label="Map"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_object_icon.xml b/indra/newview/skins/default/xui/en/menu_object_icon.xml
index 0c8a2af0028cf74c0b862b5cc39820cb6f512e76..2d4f1792c29892eb818a0639629d7790b2dff46d 100644
--- a/indra/newview/skins/default/xui/en/menu_object_icon.xml
+++ b/indra/newview/skins/default/xui/en/menu_object_icon.xml
@@ -24,4 +24,22 @@
          function="ObjectIcon.Action"
          parameter="block" />
     </menu_item_call>
+    <menu_item_separator
+     layout="topleft" />
+    <menu_item_call
+     label="Show on Map"
+     layout="topleft"
+     name="show_on_map">
+        <menu_item_call.on_click
+         function="ObjectIcon.Action" 
+         parameter="map" />
+    </menu_item_call>
+    <menu_item_call
+     label="Teleport to Object Location"
+     layout="topleft"
+     name="teleport_to_object">
+        <menu_item_call.on_click
+         function="ObjectIcon.Action"
+         parameter="teleport" />
+    </menu_item_call>
 </menu>
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 60a6c985147e9df58232d3b950fe9baf45caa200..3abb5f7bc8ca3a8a142da8c254d20a47e0de3475 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <context_menu
  layout="topleft"
- name="Avatar Context Menu">
+ name="Nearby People Context Menu">
     <menu_item_call
      label="View Profile"
      layout="topleft"
-     name="View Profile">
+     name="view_profile">
         <menu_item_call.on_click
          function="Avatar.Profile" />
     </menu_item_call>
     <menu_item_call
      label="IM"
      layout="topleft"
-     name="IM">
+     name="im">
         <menu_item_call.on_click
          function="Avatar.IM" />
         <menu_item_call.on_enable
@@ -21,7 +21,7 @@
     </menu_item_call>
     <menu_item_call
     label="Offer Teleport"
-    name="teleport">
+    name="offer_teleport">
       <menu_item_call.on_click
        function="Avatar.OfferTeleport"/>
       <menu_item_call.on_enable
@@ -31,7 +31,7 @@
     <menu_item_call
      label="Voice call"
      layout="topleft"
-     name="Call">
+     name="voice_call">
         <menu_item_call.on_click
          function="Avatar.Call" />
         <menu_item_call.on_enable
@@ -42,18 +42,18 @@
     <menu_item_call
      label="View chat history..."
      layout="topleft"
-     name="Chat history">
+     name="chat_history">
         <menu_item_call.on_click
          function="Avatar.Calllog" />
         <menu_item_call.on_enable
       	 function="Avatar.EnableItem"
          parameter="can_callog"/>
     </menu_item_call>
-    <menu_item_separator />
+    <menu_item_separator name="separator_chat_history"/>
     <menu_item_call
      label="Add Friend"
      layout="topleft"
-     name="Add Friend">
+     name="add_friend">
         <menu_item_call.on_click
          function="Avatar.AddFriend" />
         <menu_item_call.on_visible
@@ -63,7 +63,7 @@
     <menu_item_call
      label="Remove Friend"
      layout="topleft"
-     name="Remove Friend">
+     name="remove_friend">
         <menu_item_call.on_click
          function="Avatar.RemoveFriend" />
         <menu_item_call.on_enable
@@ -73,18 +73,28 @@
     <menu_item_call
      label="Invite to group..."
      layout="topleft"
-     name="Invite">
+     name="invite_to_group">
         <menu_item_call.on_click
          function="Avatar.InviteToGroup" />
         <menu_item_call.on_enable
       	 function="Avatar.EnableItem"
          parameter="can_invite"/>
     </menu_item_call>
-    <menu_item_separator />
+    <menu_item_separator name="separator_invite_to_group"/>
+    <menu_item_call
+     label="Zoom In"
+     layout="topleft"
+     name="zoom_in">
+      <menu_item_call.on_click
+       function="Avatar.ZoomIn" />
+      <menu_item_call.on_enable
+       function="Avatar.EnableItem"
+       parameter="can_zoom_in"/>
+    </menu_item_call>
     <menu_item_call
      label="Map"
      layout="topleft"
-     name="Map">
+     name="map">
         <menu_item_call.on_click
          function="Avatar.ShowOnMap" />
         <menu_item_call.on_enable
@@ -94,7 +104,7 @@
     <menu_item_call
      label="Share"
      layout="topleft"
-     name="Share">
+     name="share">
         <menu_item_call.on_click
          function="Avatar.Share" />
         <menu_item_call.on_enable
@@ -104,7 +114,7 @@
     <menu_item_call
      label="Pay"
      layout="topleft"
-     name="Pay">
+     name="pay">
         <menu_item_call.on_click
          function="Avatar.Pay" />
         <menu_item_call.on_enable
@@ -114,7 +124,7 @@
     <menu_item_check
      label="Block/Unblock"
      layout="topleft"
-     name="Block/Unblock">
+     name="block_unblock">
         <menu_item_check.on_click
          function="Avatar.BlockUnblock" />
         <menu_item_check.on_check
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml
index 5d58a9d28957813d94ef9cf42c71bbc375b03a65..5f973088fdda3ad89a31eee676b2945d4786fbb5 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml
@@ -6,7 +6,7 @@
      enabled="false"
      label="Add Friends"
      layout="topleft"
-     name="Add Friends">
+     name="add_friends">
         <on_click
          function="Avatar.AddFriends" />
         <on_enable
@@ -16,7 +16,7 @@
     <menu_item_call
      label="Remove Friends"
      layout="topleft"
-     name="Remove Friend">
+     name="remove_friends">
         <menu_item_call.on_click
          function="Avatar.RemoveFriend" />
         <menu_item_call.on_enable
@@ -26,7 +26,7 @@
     <menu_item_call
      label="IM"
      layout="topleft"
-     name="IM">
+     name="im">
         <on_click
          function="Avatar.IM" />
     </menu_item_call>
@@ -34,7 +34,7 @@
      enabled="false"
      label="Call"
      layout="topleft"
-     name="Call">
+     name="call">
         <on_click
          function="Avatar.Call" />
         <on_enable
@@ -45,7 +45,7 @@
      enabled="false"
      label="Share"
      layout="topleft"
-     name="Share">
+     name="share">
         <on_click
          function="Avatar.Share" />
     </menu_item_call>
@@ -53,13 +53,13 @@
      enabled="false"
      label="Pay"
      layout="topleft"
-     name="Pay">
+     name="pay">
         <on_click
          function="Avatar.Pay" />
     </menu_item_call>
     <menu_item_call
     label="Offer Teleport"
-    name="teleport">
+    name="offer_teleport">
       <menu_item_call.on_click
        function="Avatar.OfferTeleport"/>
       <menu_item_call.on_enable
diff --git a/indra/newview/skins/default/xui/en/menu_url_agent.xml b/indra/newview/skins/default/xui/en/menu_url_agent.xml
index 88ae441bd387550080e9db490afdaa29f9048bc0..7cd56f257a82808d1a31f4c978c618c6bd78a218 100644
--- a/indra/newview/skins/default/xui/en/menu_url_agent.xml
+++ b/indra/newview/skins/default/xui/en/menu_url_agent.xml
@@ -1,20 +1,27 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <context_menu
  layout="topleft"
- name="Url Popup">
+ name="Url Popup">  
     <menu_item_call
-     label="Send IM"
+     label="View Profile"
      layout="topleft"
      name="show_agent">
+        <menu_item_call.on_click
+         function="Url.ShowProfile" />         
+    </menu_item_call>
+    <menu_item_call
+     label="Send IM..."
+     layout="topleft"
+     name="send_im">
         <menu_item_call.on_click
          function="Url.SendIM" />        
     </menu_item_call>
     <menu_item_call
-     label="Show Resident Profile"
+     label="Add Friend..."
      layout="topleft"
-     name="show_agent">
+     name="add_friend">
         <menu_item_call.on_click
-         function="Url.ShowProfile" />
+         function="Url.AddFriend" />        
     </menu_item_call>
     <menu_item_separator
      layout="topleft" />
diff --git a/indra/newview/skins/default/xui/en/menu_url_objectim.xml b/indra/newview/skins/default/xui/en/menu_url_objectim.xml
index 35c2269b0d1a5f9d941c533504eecb5129fcd831..87ab58e622e70dcd717cee5fd35b2b2584b54674 100644
--- a/indra/newview/skins/default/xui/en/menu_url_objectim.xml
+++ b/indra/newview/skins/default/xui/en/menu_url_objectim.xml
@@ -3,7 +3,7 @@
  layout="topleft"
  name="Url Popup">
     <menu_item_call
-     label="Show Object Information"
+     label="Object Profile..."
      layout="topleft"
      name="show_object">
         <menu_item_call.on_click
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
index 9db3816c92d2aade6bb67178946aa1da33977043..bd096ebb885c1b7055c28769a7c7dff28d644718 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
@@ -429,7 +429,6 @@
     </text>
   
     <line_editor
-    	enabled="false"
         control_name="InstantMessageLogPath"
         border_style="line"
         border_thickness="1"