From 2ad421cef67b12fad0f854b252f9d4d4e9025fd4 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 24 Feb 2010 11:53:10 +0200 Subject: Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) Completed -- code improvements: updated condition to store really switched on indicators for future switching off. --HG-- branch : product-engine --- indra/newview/llspeakingindicatormanager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview/llspeakingindicatormanager.cpp') diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 3c660f4d6a..cc06179481 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -238,6 +238,7 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid); indicator_const_iterator it_indicator = it_range.first; bool was_found = false; + bool was_switched_on = false; for (; it_indicator != it_range.second; ++it_indicator) { was_found = true; @@ -251,17 +252,22 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea switch_current_on = indicator->getTargetSessionID() == session_id; LL_DEBUGS("SpeakingIndicator") << "Session: " << session_id << ", target: " << indicator->getTargetSessionID() << ", the same? = " << switch_current_on << LL_ENDL; } + was_switched_on = was_switched_on || switch_current_on; indicator->switchIndicator(switch_current_on); + } if (was_found) { LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; - // *TODO: it is possible non of the registered indicators are in the target session - // we can avoid of storing such UUID in the mSwitchedIndicatorsOn map in this case. - if (switch_on) + if (switch_on && !was_switched_on) + { + LL_DEBUGS("SpeakingIndicator") << "but non of them where switched on" << LL_ENDL; + } + + if (was_switched_on) { // store switched on indicator to be able switch it off mSwitchedIndicatorsOn.insert(*it_uuid); -- cgit v1.2.3