diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 7ca9b869a8581e1e48562b1f777b482998f54509..a8149a9a1dae6372f63f1d644ae28d8554e318f7 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -311,7 +311,7 @@ void LLButton::onCommit()
 	{
 		make_ui_sound("UISndClickRelease");
 	}
-	
+
 	if (mIsToggle)
 	{
 		toggleState();
@@ -613,8 +613,6 @@ void LLButton::draw()
 	static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true);
 	F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
 
-	bool flash = mFlashing && sEnableButtonFlashing;
-
 	bool pressed_by_keyboard = FALSE;
 	if (hasFocus())
 	{
@@ -642,6 +640,17 @@ void LLButton::draw()
 	LLColor4 glow_color;
 	LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA;
 	LLUIImage* imagep = NULL;
+
+    //  Cancel sticking of color, if the button is pressed,
+	//  or when a flashing of the previously selected button is ended
+	if (mFlashingTimer
+		&& ((selected && !mFlashingTimer->isFlashingInProgress()) || pressed))
+	{
+		mFlashing = false;
+	}
+
+	bool flash = mFlashing && sEnableButtonFlashing;
+
 	if (pressed && mDisplayPressedState)
 	{
 		imagep = selected ? mImagePressedSelected : mImagePressed;
@@ -697,8 +706,7 @@ void LLButton::draw()
 		imagep = mImageDisabled;
 	}
 
-	// Selected has a higher priority than flashing. If both are set, flashing is ignored.
-	if (mFlashing && !selected)
+	if (mFlashing)
 	{
 		// if button should flash and we have icon for flashing, use it as image for button
 		if(flash && mImageFlash)
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index e51efd48f5e8553f831d3f568db53433605faa23..903dd2a4073abe1df62fe7adc9208ccc69f4435d 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -547,27 +547,6 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask)
     LLFolderViewItem::onMouseLeave(x, y, mask);
 }
 
-BOOL LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask )
-{
-	LLConversationItem* item = NULL;
-	LLConversationViewSession* session_widget =
-			dynamic_cast<LLConversationViewSession *>(this->getParentFolder());
-	if (session_widget)
-	{
-	    item = dynamic_cast<LLConversationItem*>(session_widget->getViewModelItem());
-	}
-    LLUUID session_id = item? item->getUUID() : LLUUID();
-    BOOL result = LLFolderViewItem::handleMouseDown(x, y, mask);
-
-    if(result)
-    {
-        (LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"))->
-            selectConversationPair(session_id, false);
-    }
-
-	return result;
-}
-
 S32 LLConversationViewParticipant::getLabelXPos()
 {
     return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 74443e1d88a5fd2d0101fd96c6545793663bb6b8..5f6acfb9ab04d7f2a79d13e68150863132c14c96 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -132,8 +132,6 @@ class LLConversationViewParticipant : public LLFolderViewItem
     void addToFolder(LLFolderViewFolder* folder);
 	void addToSession(const LLUUID& session_id);
 
-    /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
-
     void onMouseEnter(S32 x, S32 y, MASK mask);
     void onMouseLeave(S32 x, S32 y, MASK mask);
 
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 2019a35faa7248702b23a6b9d4d3f05d13e2b5b5..f134dc2017e0aece8371a0c652a2b8a60ba3fa02 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -605,6 +605,12 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
 	LLMultiFloater::setVisible(visible);
 }
 
+void LLFloaterIMContainer::updateResizeLimits()
+{
+	LLMultiFloater::updateResizeLimits();
+	assignResizeLimits();
+}
+
 void LLFloaterIMContainer::collapseMessagesPane(bool collapse)
 {
 	if (mMessagesPane->isCollapsed() == collapse)
@@ -678,6 +684,7 @@ void LLFloaterIMContainer::collapseConversationsPane(bool collapse)
 		    {
 		    	widget->setOpen(false);
 		    }
+		    widget->requestArrange();
 }
 	}
 }
@@ -1101,12 +1108,25 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata)
 	uuid_vec_t uuids;
 	getParticipantUUIDs(uuids);
 
+	if ("conversation_log" == item)
+	{
+		return gSavedSettings.getBOOL("KeepConversationLogTranscripts");
+	}
+
+	//Enable Chat history item for ad-hoc and group conversations
+	if ("can_chat_history" == item)
+	{
+		if (getCurSelectedViewModelItem()->getType() != LLConversationItem::CONV_PARTICIPANT)
+		{
+			return isConversationLoggingAllowed();
+		}
+	}
 
-	// If nothing is selected, everything needs to be disabled
+	// If nothing is selected(and selected item is not group chat), everything needs to be disabled
 	if (uuids.size() <= 0)
-    {
-        return false;
-    }
+	{
+		return getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_GROUP;
+	}
 
 	if("can_activate_group" == item)
     {
@@ -1119,11 +1139,6 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata)
 
 bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_vec_t& uuids)
 {
-	if ("conversation_log" == item)
-	{
-		return gSavedSettings.getBOOL("KeepConversationLogTranscripts");
-	}
-	
 	// Extract the single select info
 	bool is_single_select = (uuids.size() == 1);
 	const LLUUID& single_id = uuids.front();
@@ -1422,11 +1437,10 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c
 	{
 		is_widget_selected = widget->isSelected();
 		new_selection = mConversationsRoot->getNextFromChild(widget);
-		if(new_selection == NULL)
+		if (!new_selection)
 		{
 			new_selection = mConversationsRoot->getPreviousFromChild(widget);
 		}
-
 		widget->destroyView();
 	}
 	
@@ -1438,14 +1452,20 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c
 	if (change_focus)
 	{
 		setFocus(TRUE);
-		if(new_selection != NULL)
+		if (new_selection)
 		{
 			if (mConversationsWidgets.size() == 1)
-				new_selection = new_selection->getParentFolder();
-			LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(new_selection->getViewModelItem());
-			if(vmi != NULL)
 			{
-				selectConversationPair(vmi->getUUID(), true);
+				// If only one widget is left, it has to be the Nearby Chat. Select it directly.
+				selectConversationPair(LLUUID(NULL), true);
+			}
+			else
+			{
+				LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(new_selection->getViewModelItem());
+				if (vmi)
+				{
+					selectConversationPair(vmi->getUUID(), true);
+				}
 			}
 		}
 	}
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index 09a24c010524df494333534d2e116e5d8983963a..0cd1b6759b7d1c20c0b989fe7cf481559415fbd4 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -60,6 +60,7 @@ class LLFloaterIMContainer
 	/*virtual*/ void onOpen(const LLSD& key);
 	/*virtual*/ void draw();
 	/*virtual*/ void setVisible(BOOL visible);
+	/*virtual*/ void updateResizeLimits();
 	void onCloseFloater(LLUUID& id);
 
 	/*virtual*/ void addFloater(LLFloater* floaterp, 
@@ -106,6 +107,8 @@ class LLFloaterIMContainer
     bool enableContextMenuItem(const std::string& item, uuid_vec_t& selectedIDS);
     void doToParticipants(const std::string& item, uuid_vec_t& selectedIDS);
 
+	void assignResizeLimits();
+
 private:
 	typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t;
 	avatarID_panel_map_t mSessions;
@@ -154,7 +157,6 @@ class LLFloaterIMContainer
 	void toggleAllowTextChat(const LLUUID& participant_uuid);
 	void toggleMute(const LLUUID& participant_id, U32 flags);
 	void openNearbyChat();
-	void assignResizeLimits();
 
 	LLButton* mExpandCollapseBtn;
 	LLButton* mStubCollapseBtn;
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index f5b657fa6064de76e957e51d17bfd1e41e726f7b..d4eb03f95d113d5c87213d1ff432e0f68c8d00b5 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -82,6 +82,13 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
 LLFloaterIMSessionTab::~LLFloaterIMSessionTab()
 {
 	delete mRefreshTimer;
+
+	// Select Nearby Chat session
+	LLFloaterIMContainer* container = LLFloaterReg::findTypedInstance<LLFloaterIMContainer>("im_container");
+	if (container)
+	{
+		container->selectConversationPair(LLUUID(NULL), true);
+	}
 }
 
 //static
@@ -322,7 +329,7 @@ void LLFloaterIMSessionTab::onFocusReceived()
 
 	LLTransientDockableFloater::onFocusReceived();
 
-	LLFloaterIMContainer* container = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
+	LLFloaterIMContainer* container = LLFloaterReg::findTypedInstance<LLFloaterIMContainer>("im_container");
 	if (container)
 	{
 		container->selectConversationPair(mSessionID, true);
@@ -606,8 +613,8 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar()
 	// prevent start conversation before its container
     LLFloaterIMContainer::getInstance();
 
-	bool is_torn_off = checkIfTornOff();
-	if (!is_torn_off)
+	bool is_not_torn_off = !checkIfTornOff();
+	if (is_not_torn_off)
 	{
 		hideAllStandardButtons();
 	}
@@ -616,7 +623,7 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar()
 
 	// Participant list should be visible only in torn off floaters.
 	bool is_participant_list_visible =
-			is_torn_off
+			!is_not_torn_off
 			&& gSavedSettings.getBOOL("IMShowControlPanel")
 			&& !mIsP2PChat;
 
@@ -624,22 +631,28 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar()
 
 	// Display collapse image (<<) if the floater is hosted
 	// or if it is torn off but has an open control panel.
-	bool is_expanded = !is_torn_off || is_participant_list_visible;
+	bool is_expanded = is_not_torn_off || is_participant_list_visible;
 	mExpandCollapseBtn->setImageOverlay(getString(is_expanded ? "collapse_icon" : "expand_icon"));
+	mExpandCollapseBtn->setToolTip(
+			is_not_torn_off?
+				getString("expcol_button_not_tearoff_tooltip") :
+				(is_expanded?
+					getString("expcol_button_tearoff_and_expanded_tooltip") :
+					getString("expcol_button_tearoff_and_collapsed_tooltip")));
 
 	// toggle floater's drag handle and title visibility
 	if (mDragHandle)
 	{
-		mDragHandle->setTitleVisible(is_torn_off);
+		mDragHandle->setTitleVisible(!is_not_torn_off);
 	}
 
 	// The button (>>) should be disabled for torn off P2P conversations.
-	mExpandCollapseBtn->setEnabled(!is_torn_off || !mIsP2PChat);
+	mExpandCollapseBtn->setEnabled(is_not_torn_off || !mIsP2PChat);
 
-	mTearOffBtn->setImageOverlay(getString(is_torn_off? "return_icon" : "tear_off_icon"));
-	mTearOffBtn->setToolTip(getString(!is_torn_off? "tooltip_to_separate_window" : "tooltip_to_main_window"));
+	mTearOffBtn->setImageOverlay(getString(is_not_torn_off? "tear_off_icon" : "return_icon"));
+	mTearOffBtn->setToolTip(getString(is_not_torn_off? "tooltip_to_separate_window" : "tooltip_to_main_window"));
 
-	mCloseBtn->setVisible(!is_torn_off && !mIsNearbyChat);
+	mCloseBtn->setVisible(is_not_torn_off && !mIsNearbyChat);
 
 	enableDisableCallBtn();
 
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 716e6fe7ba767d2f5bd29b8774e3c9cdc4ad959f..adc34cc9a4f4a3d750cab53391becc65ec721baa 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -159,7 +159,7 @@ void on_new_message(const LLSD& msg)
     LLUUID session_id = msg["session_id"].asUUID();
     LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
 
-    // determine action for this session
+    //  determine action for this session
 
     if (session_id.isNull())
     {
@@ -185,13 +185,14 @@ void on_new_message(const LLSD& msg)
         action = gSavedSettings.getString("NotificationGroupChatOptions");
     }
 
-    // do not show notification in "do not disturb" mode or it goes from agent
+    // do not show notification which goes from agent
     if (gAgent.getID() == participant_id)
     {
         return;
     }
 
     // execution of the action
+
     LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
     LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
 
@@ -210,7 +211,7 @@ void on_new_message(const LLSD& msg)
 
     if ("toast" == action)
     {
-        // Skip toasting if we have open window of IM with this session id
+        // Skip toasting and flashing if we have open window of IM with this session id
         if (session_floater
             && session_floater->isInVisibleChain()
             && session_floater->hasFocus()
@@ -221,12 +222,6 @@ void on_new_message(const LLSD& msg)
             return;
         }
 
-	    // Skip toasting for system messages and for nearby chat
-	    if (participant_id.isNull())
-        {
-            return;
-        }
-
         //User is not focused on conversation containing the message
         if(session_floater_not_focused)
         {
@@ -238,7 +233,8 @@ void on_new_message(const LLSD& msg)
                 gToolBarView->flashCommand(LLCommandId("chat"), true);
 
                 //Show IM toasts (upper right toasts)
-                if(session_id.notNull())
+                // Skip toasting for system messages and for nearby chat
+                if(session_id.notNull() && participant_id.notNull())
                 {
                     LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
                 }
diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml
index cf61348a66668d53bd77a7b4b7ad1f01ffff9b84..256e03c4d7df22dd9b34b4bf974b5e129f81980c 100644
--- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml
+++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml
@@ -5,7 +5,7 @@
  positioning="cascading"
  height="200"
  min_height="100"
- min_width="200"
+ min_width="230"
  layout="topleft"
  name="floater_conversation_log"
  save_rect="true"
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 9e2132dc3bf6696cf67865360ac609c91adfff4a..8f0574177f3a97981505e2afbf31ae4a37fc8f8f 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -49,6 +49,15 @@
   <floater.string
      name="end_call_button_tooltip"
      value="Close voice connection"/>
+   <floater.string
+     name="expcol_button_not_tearoff_tooltip"
+     value="Collapse this pane"/>
+   <floater.string
+     name="expcol_button_tearoff_and_expanded_tooltip"
+     value="Collapse participant list"/>
+   <floater.string
+     name="expcol_button_tearoff_and_collapsed_tooltip"
+     value="Expand participant list"/>
     <view
         follows="all"
         layout="topleft"