summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-01-26 12:13:01 +0200
committerMike Antipov <mantipov@productengine.com>2010-01-26 12:13:01 +0200
commitb15bebb34853cb839100c48f5b28d52e60660c13 (patch)
tree8710cd3d20152c7ef013f210d4db999634b4fcaa /indra/newview
parent6a3e89c34ab6db1120f2409a830ff561543a7fce (diff)
Fixed low bug EXT-4637 (Remove Warning flood from the VCP)
-- refactoring: replaced "if-else" conditions with the "switch" statement. For now all existent for now states are processed. VCP functionality was not changed. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llcallfloater.cpp41
1 files changed, 25 insertions, 16 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index ba50d0454e..1e713dade8 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -576,29 +576,38 @@ void LLCallFloater::updateParticipantsVoiceState()
void LLCallFloater::updateNotInVoiceParticipantState(LLAvatarListItem* item)
{
LLUUID participant_id = item->getAvatarId();
- // If an avatarID is not found in a speakers list from VoiceClient and
- // a panel with this ID has a JOINED status this means that this person
- // HAS LEFT the call.
- if ((getState(participant_id) == STATE_JOINED))
+ ESpeakerState current_state = getState(participant_id);
+
+ switch (current_state)
{
+ case STATE_JOINED:
+ // If an avatarID is not found in a speakers list from VoiceClient and
+ // a panel with this ID has a JOINED status this means that this person
+ // HAS LEFT the call.
setState(item, STATE_LEFT);
- LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(participant_id);
- if (speaker.notNull())
{
- speaker->mHasLeftCurrentCall = TRUE;
+ LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(participant_id);
+ if (speaker.notNull())
+ {
+ speaker->mHasLeftCurrentCall = TRUE;
+ }
}
- }
- // If an avatarID is not found in a speakers list from VoiceClient and
- // a panel with this ID has a LEFT status this means that this person
- // HAS ENTERED session but it is not in voice chat yet. So, set INVITED status
- else if ((getState(participant_id) != STATE_LEFT))
- {
+ break;
+ case STATE_INVITED:
+ case STATE_LEFT:
+ // nothing to do. These states should not be changed.
+ break;
+ case STATE_UNKNOWN:
+ // If an avatarID is not found in a speakers list from VoiceClient and
+ // a panel with this ID has an UNKNOWN status this means that this person
+ // HAS ENTERED session but it is not in voice chat yet. So, set INVITED status
setState(item, STATE_INVITED);
- }
- else
- {
+ break;
+ default:
+ // for possible new future states.
llwarns << "Unsupported (" << getState(participant_id) << ") state for: " << item->getAvatarName() << llendl;
+ break;
}
}