summaryrefslogtreecommitdiff
path: root/indra/newview/llcallfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r--indra/newview/llcallfloater.cpp86
1 files changed, 59 insertions, 27 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index d4c8adadc6..8cb240c7c2 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -43,6 +43,7 @@
#include "llavatariconctrl.h"
#include "llavatarlist.h"
#include "llbottomtray.h"
+#include "lldraghandle.h"
#include "llimfloater.h"
#include "llfloaterreg.h"
#include "llparticipantlist.h"
@@ -51,6 +52,7 @@
#include "lltransientfloatermgr.h"
#include "llviewerwindow.h"
#include "llvoicechannel.h"
+#include "llviewerparcelmgr.h"
static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids);
void reshape_floater(LLCallFloater* floater, S32 delta_height);
@@ -158,6 +160,13 @@ BOOL LLCallFloater::postBuild()
connectToChannel(LLVoiceChannel::getCurrentVoiceChannel());
+ setIsChrome(true);
+ //chrome="true" hides floater caption
+ if (mDragHandle)
+ mDragHandle->setTitleVisible(TRUE);
+
+ updateSession();
+
return TRUE;
}
@@ -240,7 +249,7 @@ void LLCallFloater::updateSession()
}
}
- const LLUUID& session_id = voice_channel->getSessionID();
+ const LLUUID& session_id = voice_channel ? voice_channel->getSessionID() : LLUUID::null;
lldebugs << "Set speaker manager for session: " << session_id << llendl;
LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id);
@@ -562,33 +571,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() << llendl;
+ 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;
}
}
@@ -710,11 +732,11 @@ void LLCallFloater::updateState(const LLVoiceChannel::EState& new_state)
}
else
{
- reset();
+ reset(new_state);
}
}
-void LLCallFloater::reset()
+void LLCallFloater::reset(const LLVoiceChannel::EState& new_state)
{
// lets forget states from the previous session
// for timers...
@@ -727,8 +749,18 @@ void LLCallFloater::reset()
mParticipants = NULL;
mAvatarList->clear();
- // update floater to show Loading while waiting for data.
- mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
+ // "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)
+ {
+ mAvatarList->setNoItemsCommentText(getString("no_one_near"));
+ }
+ else
+ {
+ // update floater to show Loading while waiting for data.
+ mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
+ }
mAvatarList->setVisible(TRUE);
mNonAvatarCaller->setVisible(FALSE);