From dbc37f6ca74dba6c6d5194e0397d5cfe6f570c1d Mon Sep 17 00:00:00 2001
From: MaximB ProductEngine <mberezhnoy@productengine.com>
Date: Thu, 15 Nov 2012 10:38:21 +0200
Subject: [PATCH] CHUI-397 (Delay in removing names from participant list in
 nearby chat) CHUI-440 (Nearby chat participant list does not clear after
 teleport when conversation floater is closed/minimized) fixed

---
 indra/llui/llfolderviewitem.h        |  1 +
 indra/newview/llconversationview.cpp | 14 +++++++++++++-
 indra/newview/llspeakers.cpp         |  8 ++++++++
 indra/newview/llspeakers.h           |  3 +++
 4 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index b157aabdcf7..152ca242e16 100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -118,6 +118,7 @@ class LLFolderViewItem : public LLView
 
 	// For now assuming all colors are the same in derived classes.
 	static LLUIColor			sFgColor;
+	static LLUIColor			sFgDisabledColor;
 	static LLUIColor			sHighlightBgColor;
 	static LLUIColor			sHighlightFgColor;
 	static LLUIColor			sFocusOutlineColor;
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 53392ac3729..d1649a93b11 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -409,6 +409,7 @@ BOOL LLConversationViewParticipant::postBuild()
 void LLConversationViewParticipant::draw()
 {
     static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+	static LLUIColor sFgDisabledColor = LLUIColorTable::instance().getColor("MenuItemDisabledColor", DEFAULT_WHITE);
     static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
     static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
     static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
@@ -421,7 +422,18 @@ void LLConversationViewParticipant::draw()
 
     F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
     F32 text_left = (F32)getLabelXPos();
-    LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor;
+	
+	LLColor4 color;
+	LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance();
+
+	if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID))
+	{
+		color = sFgDisabledColor;
+	}
+	else
+	{
+		color = mIsSelected ? sHighlightFgColor : sFgColor;
+	}
 
     drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
     drawLabel(font, text_left, y, color, right_x);
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 5036334bdd1..88f29d75874 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -254,6 +254,10 @@ bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_
 	return true;
 }
 
+bool LLSpeakersDelayActionsStorage::isTimerStarted(const LLUUID& speaker_id)
+{
+	return (mActionTimersMap.size() > 0) && (mActionTimersMap.find(speaker_id) != mActionTimersMap.end());
+}
 
 //
 // ModerationResponder
@@ -603,6 +607,10 @@ const LLUUID LLSpeakerMgr::getSessionID()
 	return mVoiceChannel->getSessionID(); 
 }
 
+bool LLSpeakerMgr::isSpeakerToBeRemoved(const LLUUID& speaker_id)
+{
+	return mSpeakerDelayRemover && mSpeakerDelayRemover->isTimerStarted(speaker_id);
+}
 
 void LLSpeakerMgr::setSpeakerTyping(const LLUUID& speaker_id, BOOL typing)
 {
diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h
index 8ab08661d3d..7d518fe07b4 100644
--- a/indra/newview/llspeakers.h
+++ b/indra/newview/llspeakers.h
@@ -193,6 +193,8 @@ class LLSpeakersDelayActionsStorage
 	void unsetActionTimer(const LLUUID& speaker_id);
 
 	void removeAllTimers();
+
+	bool isTimerStarted(const LLUUID& speaker_id);
 private:
 	/**
 	 * Callback of the each instance of LLSpeakerActionTimer.
@@ -237,6 +239,7 @@ class LLSpeakerMgr : public LLOldEvents::LLObservable
 	void getSpeakerList(speaker_list_t* speaker_list, BOOL include_text);
 	LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; }
 	const LLUUID getSessionID();
+	bool isSpeakerToBeRemoved(const LLUUID& speaker_id);
 
 	/**
 	 * Removes avaline speaker.
-- 
GitLab