From 212e21f3526d7d979a0950cc3c8c7ddaceef6cdc Mon Sep 17 00:00:00 2001
From: AlexanderP ProductEngine <apaschenko@productengine.com>
Date: Tue, 12 Mar 2013 15:43:07 +0200
Subject: [PATCH] CHUI-847 Fixed [CHUIBUG]Collapse Participant List, operates
 on all torn off chats: make flag mIsPartListExpanded for saving of the
 participant list panel expand/collapse state

---
 indra/newview/llfloaterimsessiontab.cpp | 15 +++++++++++----
 indra/newview/llfloaterimsessiontab.h   |  1 +
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 85b25afe435..5fc7f46ca33 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
@@ -269,6 +271,12 @@ BOOL LLFloaterIMSessionTab::postBuild()
 	mRefreshTimer->setTimerExpirySec(0);
 	mRefreshTimer->start();
 	initBtns();
+
+	if (mIsParticipantListExpanded != gSavedSettings.getBOOL("IMShowControlPanel"))
+	{
+		LLFloaterIMSessionTab::onSlide(this);
+	}
+
 	return result;
 }
 
@@ -638,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);
@@ -769,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 d55b021df7f..e8ae5574127 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;
 
-- 
GitLab