Skip to content
Snippets Groups Projects
Commit 1f8fb3f3 authored by Mike Antipov's avatar Mike Antipov
Browse files

Work on major bug EXT-5562 (Misleading Active Voice Indicators in Group Chat...

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
parent d5a0fd79
No related branches found
No related tags found
No related merge requests found
...@@ -152,6 +152,8 @@ void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_i ...@@ -152,6 +152,8 @@ void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_i
ensureInstanceDoesNotExist(speaking_indicator); ensureInstanceDoesNotExist(speaking_indicator);
speaking_indicator->setTargetSessionID(session_id);
speaking_indicator_value_t value_type(speaker_id, speaking_indicator); speaking_indicator_value_t value_type(speaker_id, speaking_indicator);
mSpeakingIndicators.insert(value_type); mSpeakingIndicators.insert(value_type);
...@@ -222,6 +224,13 @@ void SpeakingIndicatorManager::onChange() ...@@ -222,6 +224,13 @@ void SpeakingIndicatorManager::onChange()
void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on) 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(); speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin();
for (; it_uuid != speakers_uuids.end(); ++it_uuid) for (; it_uuid != speakers_uuids.end(); ++it_uuid)
{ {
...@@ -233,13 +242,24 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea ...@@ -233,13 +242,24 @@ void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& spea
{ {
was_found = true; was_found = true;
LLSpeakingIndicator* indicator = (*it_indicator).second; 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) if (was_found)
{ {
LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; 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)
{ {
// store switched on indicator to be able switch it off // store switched on indicator to be able switch it off
......
...@@ -38,7 +38,18 @@ ...@@ -38,7 +38,18 @@
class LLSpeakingIndicator class LLSpeakingIndicator
{ {
public: public:
virtual ~LLSpeakingIndicator(){}
virtual void switchIndicator(bool switch_on) = 0; 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. // See EXT-3976.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment