diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-02-25 18:24:07 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-02-25 18:24:07 -0800 |
commit | 9b05fecbf6b3d65dae5a010fc35821dc116a44d0 (patch) | |
tree | 9c0df85bb3a8b5c4e58655179e1b29ee31594cfc /indra/newview/llcallfloater.cpp | |
parent | 5ed6e0720af1b6cdf1a983e2c040eeb5d8ae33ba (diff) | |
parent | db4e46e93d06c03520cb7c781b8e41b6d374414d (diff) |
automated merge from trunk
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1640081ee6..7ac9153b21 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -163,6 +163,8 @@ BOOL LLCallFloater::postBuild() //chrome="true" hides floater caption if (mDragHandle) mDragHandle->setTitleVisible(TRUE); + + updateSession(); return TRUE; } @@ -245,8 +247,7 @@ void LLCallFloater::updateSession() } } - const LLUUID& session_id = voice_channel->getSessionID(); - LL_DEBUGS("Voice") << "Set speaker manager for session: " << session_id << LL_ENDL; + const LLUUID& session_id = voice_channel ? voice_channel->getSessionID() : LLUUID::null; LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); if (im_session) @@ -566,33 +567,46 @@ void LLCallFloater::updateParticipantsVoiceState() if (!found) { - // 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)) - { - setState(item, STATE_LEFT); + updateNotInVoiceParticipantState(item); + } + } +} - LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); - if (speaker.isNull()) - { - continue; - } +void LLCallFloater::updateNotInVoiceParticipantState(LLAvatarListItem* item) +{ + LLUUID participant_id = item->getAvatarId(); + ESpeakerState current_state = getState(participant_id); - 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)) - { - setState(item, STATE_INVITED); - } - else + 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()) { - llwarns << "Unsupported (" << getState(participant_id) << ") state: " << item->getAvatarName() << LL_ENDL; + speaker->mHasLeftCurrentCall = TRUE; } } + 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); + break; + default: + // for possible new future states. + llwarns << "Unsupported (" << getState(participant_id) << ") state for: " << item->getAvatarName() << llendl; + break; } } |