Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat Window, when Speakers are in Spatial Chat Only)

- updated code to store target session id for which registered indicator should be shown and process it while switching indicators on.

--HG--
branch : product-engine
master
Mike Antipov 2010-02-23 15:33:10 +02:00
parent d5a0fd7997
commit 1f8fb3f3ba
2 changed files with 32 additions and 1 deletions

View File

@ -152,6 +152,8 @@ void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_i
ensureInstanceDoesNotExist(speaking_indicator);
speaking_indicator->setTargetSessionID(session_id);
speaking_indicator_value_t value_type(speaker_id, speaking_indicator);
mSpeakingIndicators.insert(value_type);
@ -222,6 +224,13 @@ void SpeakingIndicatorManager::onChange()
void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on)
{
LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
LLUUID session_id;
if (voice_channel)
{
session_id = voice_channel->getSessionID();
}
speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin();
for (; it_uuid != speakers_uuids.end(); ++it_uuid)
{
@ -233,13 +242,24 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea
{
was_found = true;
LLSpeakingIndicator* indicator = (*it_indicator).second;
indicator->switchIndicator(switch_on);
BOOL switch_current_on = switch_on;
// we should show indicator for specified voice session only if this is current channel. EXT-5562.
if (switch_current_on && indicator->getTargetSessionID().notNull())
{
switch_current_on = indicator->getTargetSessionID() == session_id;
}
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)
{
// store switched on indicator to be able switch it off

View File

@ -38,7 +38,18 @@
class LLSpeakingIndicator
{
public:
virtual ~LLSpeakingIndicator(){}
virtual void switchIndicator(bool switch_on) = 0;
void setTargetSessionID(const LLUUID& session_id) { mTargetSessionID = session_id; }
const LLUUID& getTargetSessionID() { return mTargetSessionID; }
private:
/**
* session UUID for which indicator should be shown only.
* If it is set, registered indicator will be shown only in voice channel
* which has the same session id (EXT-5562).
*/
LLUUID mTargetSessionID;
};
// See EXT-3976.