diff options
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index eecbea39fc..da4f2be567 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -301,8 +301,10 @@ void LLCallFloater::updateSession() refreshParticipantList(); updateAgentModeratorState(); - //show floater for voice calls - if (!is_local_chat) + //show floater for voice calls & only in CONNECTED to voice channel state + if (!is_local_chat && + voice_channel && + LLVoiceChannel::STATE_CONNECTED == voice_channel->getState()) { LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); bool show_me = !(im_floater && im_floater->getVisible()); @@ -331,6 +333,7 @@ void LLCallFloater::refreshParticipantList() { mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT); mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1)); + mParticipants->setSortOrder(LLParticipantList::E_SORT_BY_RECENT_SPEAKERS); if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager) { @@ -675,8 +678,7 @@ void LLCallFloater::resetVoiceRemoveTimers() void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) { - bool delete_it = true; - mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id, delete_it); + mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id); } bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) @@ -718,7 +720,15 @@ void LLCallFloater::connectToChannel(LLVoiceChannel* channel) void LLCallFloater::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { - updateState(new_state); + // check is voice operational and if it doesn't work hide VCP (EXT-4397) + if(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()) + { + updateState(new_state); + } + else + { + closeFloater(); + } } void LLCallFloater::updateState(const LLVoiceChannel::EState& new_state) @@ -747,18 +757,26 @@ void LLCallFloater::reset(const LLVoiceChannel::EState& new_state) mParticipants = NULL; mAvatarList->clear(); - // "loading" is shown in parcel with disabled voice only when state is "ringing" - // to avoid showing it in nearby chat vcp all the time- "no_one_near" is now shown there (EXT-4648) - bool show_loading = LLVoiceChannel::STATE_RINGING == new_state; - if(!show_loading && !LLViewerParcelMgr::getInstance()->allowAgentVoice() && mVoiceType == VC_LOCAL_CHAT) + // These ifs were added instead of simply showing "loading" to make VCP work correctly in parcels + // with disabled voice (EXT-4648 and EXT-4649) + if (!LLViewerParcelMgr::getInstance()->allowAgentVoice() && LLVoiceChannel::STATE_HUNG_UP == new_state) { + // hides "Leave Call" when call is ended in parcel with disabled voice- hiding usually happens in + // updateSession() which won't be called here because connect to nearby voice never happens + childSetVisible("leave_call_btn_panel", false); + // setting title to nearby chat an "no one near..." text- because in region with disabled + // voice we won't have chance to really connect to nearby, so VCP is changed here manually + setTitle(getString("title_nearby")); mAvatarList->setNoItemsCommentText(getString("no_one_near")); } - else + // "loading" is shown only when state is "ringing" to avoid showing it in nearby chat vcp + // of parcels with disabled voice all the time- "no_one_near" is now shown there (EXT-4648) + else if (new_state == LLVoiceChannel::STATE_RINGING) { // update floater to show Loading while waiting for data. mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); } + mAvatarList->setVisible(TRUE); mNonAvatarCaller->setVisible(FALSE); |