From be66b520571aa89feefc8e1dad6dbc622521f124 Mon Sep 17 00:00:00 2001
From: Mike Antipov <mantipov@productengine.com>
Date: Fri, 26 Mar 2010 16:44:43 +0200
Subject: [PATCH] Fixed normal bug EXT-6448 (People -> My Friends list has
 overlapping text at the top covering the first few contacts.)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Unfortunately I was unable to reproduce this bug. But I have some idea about the reason of it.
Decision to show or not the help text based on count of people in Inventory/Calling Cards/Friends/All list. So, if this list is empty even if Resident has some friend (and at least one of them is online) both help text & online list were shown at the same time.

The reason of why Friends/All can be empty in inventory can be clean cachу & slow connection to upload it from the server. But I could not reproduce it.

So, the fix is to check both all friends & online friends lists to prevent overlaping in the future.

Reviewed by Vadim at https://codereview.productengine.com/secondlife/r/118/

--HG--
branch : product-engine
---
 indra/newview/llpanelpeople.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2025bd52dc4..325157a0645 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -672,11 +672,6 @@ void LLPanelPeople::updateFriendList()
 		lldebugs << "Friends Cards were not found" << llendl;
 	}
 
-	// show special help text for just created account to help found friends. EXT-4836
-	static LLTextBox* no_friends_text = getChild<LLTextBox>("no_friends_msg");
-	no_friends_text->setVisible(all_friendsp.size() == 0);
-
-
 	LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
 	for (; buddy_it != all_buddies.end(); ++buddy_it)
 	{
@@ -685,6 +680,14 @@ void LLPanelPeople::updateFriendList()
 			online_friendsp.push_back(buddy_id);
 	}
 
+	// show special help text for just created account to help found friends. EXT-4836
+	static LLTextBox* no_friends_text = getChild<LLTextBox>("no_friends_msg");
+
+	// Seems sometimes all_friends can be empty because of issue with Inventory loading (clear cache, slow connection...)
+	// So, lets check all lists to avoid overlapping the text with online list. See EXT-6448.
+	bool any_friend_exists = (all_friendsp.size() > 0) || (online_friendsp.size() > 0);
+	no_friends_text->setVisible(!any_friend_exists);
+
 	/*
 	 * Avatarlists  will be hidden by showFriendsAccordionsIfNeeded(), if they do not have items.
 	 * But avatarlist can be updated only if it is visible @see LLAvatarList::draw();   
-- 
GitLab