From e3963666fd54f5cb1b43bc70b77660079bad5ab5 Mon Sep 17 00:00:00 2001
From: dmitrykproductengine <none@none>
Date: Fri, 13 Sep 2013 14:40:22 +0300
Subject: MAINT-3133 FIXED Expand Nearby Chat participant list on first open of
 Conversations floater, per login session

---
 indra/newview/app_settings/settings_per_account.xml | 11 +++++++++++
 indra/newview/llfloaterimcontainer.cpp              | 19 +++++++++++++++++++
 indra/newview/llfloaterimcontainer.h                |  1 +
 3 files changed, 31 insertions(+)

(limited to 'indra')

diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index 636caf5ef3..500151c935 100755
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -77,6 +77,17 @@
         <key>Value</key>
             <integer>412</integer>
     </map>
+    <key>ConversationsParticipantListCollapsed</key>
+    <map>
+        <key>Comment</key>
+            <string>Stores the expanded/collapsed state of Nearby chat participant list</string>
+        <key>Persist</key>
+            <integer>1</integer>
+        <key>Type</key>
+            <string>Boolean</string>
+        <key>Value</key>
+            <integer>true</integer>
+    </map>   
     <key>InstantMessageLogPath</key>
         <map>
         <key>Comment</key>
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 2b4585cc47..3ef0cc63b1 100755
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -101,6 +101,7 @@ LLFloaterIMContainer::~LLFloaterIMContainer()
 
 	gSavedPerAccountSettings.setBOOL("ConversationsListPaneCollapsed", mConversationsPane->isCollapsed());
 	gSavedPerAccountSettings.setBOOL("ConversationsMessagePaneCollapsed", mMessagesPane->isCollapsed());
+	gSavedPerAccountSettings.setBOOL("ConversationsParticipantListCollapsed", !isParticipantListExpanded());
 
 	if (!LLSingleton<LLIMMgr>::destroyed())
 	{
@@ -250,6 +251,11 @@ BOOL LLFloaterIMContainer::postBuild()
 	// Init the sort order now that the root had been created
 	setSortOrder(LLConversationSort(gSavedSettings.getU32("ConversationSortOrder")));
 	
+	//We should expand nearby chat participants list for the new user
+	if(gAgent.isFirstLogin() || !gSavedPerAccountSettings.getBOOL("ConversationsParticipantListCollapsed"))
+	{
+		expandConversation();
+	}
 	// Keep the xml set title around for when we have to overwrite it
 	mGeneralTitle = getTitle();
 	
@@ -2082,6 +2088,19 @@ void LLFloaterIMContainer::expandConversation()
 		}
 	}
 }
+bool LLFloaterIMContainer::isParticipantListExpanded()
+{
+	bool is_expanded = false;
+	if(!mConversationsPane->isCollapsed())
+	{
+		LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(get_ptr_in_map(mConversationsWidgets,getSelectedSession()));
+		if (widget)
+		{
+			is_expanded = widget->isOpen();
+		}
+	}
+	return is_expanded;
+}
 
 // By default, if torn off session is currently frontmost, LLFloater::isFrontmost() will return FALSE, which can lead to some bugs
 // So LLFloater::isFrontmost() is overriden here to check both selected session and the IM floater itself
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index a118ab51d2..5d88b7881a 100755
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -172,6 +172,7 @@ private:
 	void toggleAllowTextChat(const LLUUID& participant_uuid);
 	void toggleMute(const LLUUID& participant_id, U32 flags);
 	void openNearbyChat();
+	bool isParticipantListExpanded();
 
 	LLButton* mExpandCollapseBtn;
 	LLButton* mStubCollapseBtn;
-- 
cgit v1.2.3