From 0969315be48db3acf210abfacd4f0eaa381b2d27 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 14 Jan 2010 21:12:03 +0200 Subject: Fixed normal bug EXT-4216 ( Avatars looks active in group voice chat when relogin after has left voice chat) - improved LLCallFloater::validateSpeaker callback to process participants has left group voice chat --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c0efb85b51..6317a6a392 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -724,13 +724,28 @@ void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) { - if (mVoiceType != VC_LOCAL_CHAT) - return true; + bool is_valid = true; + switch (mVoiceType) + { + case VC_LOCAL_CHAT: + { + // A nearby chat speaker is considered valid it it's known to LLVoiceClient (i.e. has enabled voice). + std::vector speakers; + get_voice_participants_uuids(speakers); + is_valid = std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); + } + break; + case VC_GROUP_CHAT: + // if participant had left this call before do not allow add her again. See EXT-4216. + // but if she Join she will be added into the list from the LLCallFloater::onChange() + is_valid = STATE_LEFT != getState(speaker_id); + break; + default: + // do nothing. required for Linux build + break; + } - // A nearby chat speaker is considered valid it it's known to LLVoiceClient (i.e. has enabled voice). - std::vector speakers; - get_voice_participants_uuids(speakers); - return std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); + return is_valid; } void LLCallFloater::connectToChannel(LLVoiceChannel* channel) -- cgit v1.2.3