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

Work on normal bug EXT-3434 There is no difference between invited and left...

Work on normal bug EXT-3434 	There is no difference between invited and left participants in a Group call (Voice Controls)
-- added doxygen comments in header
-- replaced collecting of voice participants' uuids, added helpful & removed unused code comments in cpp

--HG--
branch : product-engine
parent 45e0b595
No related branches found
No related tags found
No related merge requests found
...@@ -482,28 +482,10 @@ void LLCallFloater::updateParticipantsVoiceState() ...@@ -482,28 +482,10 @@ void LLCallFloater::updateParticipantsVoiceState()
std::vector<LLUUID> speakers_list; std::vector<LLUUID> speakers_list;
// Get a list of participants from VoiceClient // Get a list of participants from VoiceClient
LLVoiceClient::participantMap *map = gVoiceClient->getParticipantList(); std::vector<LLUUID> speakers_uuids;
if (!map) return; get_voice_participants_uuids(speakers_uuids);
for (LLVoiceClient::participantMap::const_iterator iter = map->begin();
iter != map->end(); ++iter)
{
LLUUID id = (*iter).second->mAvatarID;
// if ( id != gAgent.getID() )
{
speakers_list.push_back(id);
/*
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (mAvatarList->getItemByValue(id));
if (item)
{
setState(item, STATE_JOINED);
}
*/
}
}
// Updating the status for each participant. // Updating the status for each participant already in list.
std::vector<LLPanel*> items; std::vector<LLPanel*> items;
mAvatarList->getItems(items); mAvatarList->getItems(items);
std::vector<LLPanel*>::const_iterator std::vector<LLPanel*>::const_iterator
...@@ -518,14 +500,14 @@ void LLCallFloater::updateParticipantsVoiceState() ...@@ -518,14 +500,14 @@ void LLCallFloater::updateParticipantsVoiceState()
const LLUUID participant_id = item->getAvatarId(); const LLUUID participant_id = item->getAvatarId();
bool found = false; bool found = false;
std::vector<LLUUID>::iterator speakers_iter = std::find(speakers_list.begin(), speakers_list.end(), participant_id); std::vector<LLUUID>::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id);
lldebugs << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << llendl; lldebugs << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << llendl;
// If an avatarID assigned to a panel is found in a speakers list // If an avatarID assigned to a panel is found in a speakers list
// obtained from VoiceClient we assign the JOINED status to the owner // obtained from VoiceClient we assign the JOINED status to the owner
// of this avatarID. // of this avatarID.
if (speakers_iter != speakers_list.end()) if (speakers_iter != speakers_uuids.end())
{ {
setState(item, STATE_JOINED); setState(item, STATE_JOINED);
...@@ -534,15 +516,15 @@ void LLCallFloater::updateParticipantsVoiceState() ...@@ -534,15 +516,15 @@ void LLCallFloater::updateParticipantsVoiceState()
continue; continue;
speaker->mHasLeftCurrentCall = FALSE; speaker->mHasLeftCurrentCall = FALSE;
speakers_list.erase(speakers_iter); speakers_uuids.erase(speakers_iter);
found = true; found = true;
} }
// 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 (!found) 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)) if ((getState(participant_id) == STATE_JOINED))
{ {
setState(item, STATE_LEFT); setState(item, STATE_LEFT);
...@@ -553,6 +535,9 @@ void LLCallFloater::updateParticipantsVoiceState() ...@@ -553,6 +535,9 @@ void LLCallFloater::updateParticipantsVoiceState()
speaker->mHasLeftCurrentCall = TRUE; 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)) else if ((getState(participant_id) != STATE_LEFT))
{ {
setState(item, STATE_INVITED); setState(item, STATE_INVITED);
...@@ -592,18 +577,14 @@ void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state) ...@@ -592,18 +577,14 @@ void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state)
switch (state) switch (state)
{ {
case STATE_INVITED: case STATE_INVITED:
// status_str = "INVITED"; // *TODO: localize
new_desc.setStyle(LLFontGL::NORMAL); new_desc.setStyle(LLFontGL::NORMAL);
break; break;
case STATE_JOINED: case STATE_JOINED:
// status_str = "JOINED"; // *TODO: localize
new_desc.setStyle(LLFontGL::NORMAL); new_desc.setStyle(LLFontGL::NORMAL);
break; break;
case STATE_LEFT: case STATE_LEFT:
{ {
// status_str = "HAS LEFT CALL"; // *TODO: localize
new_desc.setStyle(LLFontGL::ITALIC); new_desc.setStyle(LLFontGL::ITALIC);
} }
break; break;
default: default:
......
...@@ -106,6 +106,13 @@ class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver ...@@ -106,6 +106,13 @@ class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver
* Refreshes participant list according to current Voice Channel * Refreshes participant list according to current Voice Channel
*/ */
void refreshPartisipantList(); void refreshPartisipantList();
/**
* Handles event on avatar list is refreshed after it was marked dirty.
*
* It sets initial participants voice states (once after the first refreshing)
* and updates voice states each time anybody is joined/left voice chat in session.
*/
void onAvatarListRefreshed(); void onAvatarListRefreshed();
...@@ -114,7 +121,21 @@ class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver ...@@ -114,7 +121,21 @@ class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver
void setModeratorMutedVoice(bool moderator_muted); void setModeratorMutedVoice(bool moderator_muted);
void updateAgentModeratorState(); void updateAgentModeratorState();
/**
* Sets initial participants voice states in avatar list (Invited, Joined, Has Left).
*
* @see refreshPartisipantList()
* @see onAvatarListRefreshed()
* @see mInitParticipantsVoiceState
*/
void initParticipantsVoiceState(); void initParticipantsVoiceState();
/**
* Updates participants voice states in avatar list (Invited, Joined, Has Left).
*
* @see onAvatarListRefreshed()
* @see onChanged()
*/
void updateParticipantsVoiceState(); void updateParticipantsVoiceState();
void setState(LLAvatarListItem* item, ESpeakerState state); void setState(LLAvatarListItem* item, ESpeakerState state);
...@@ -141,6 +162,15 @@ class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver ...@@ -141,6 +162,15 @@ class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver
LLOutputMonitorCtrl* mSpeakingIndicator; LLOutputMonitorCtrl* mSpeakingIndicator;
bool mIsModeratorMutedVoice; bool mIsModeratorMutedVoice;
/**
* Flag indicated that participants voice states should be initialized.
*
* It is used due to Avatar List has delayed refreshing after it content is changed.
* Real initializing is performed when Avatar List is first time refreshed.
*
* @see onAvatarListRefreshed()
* @see initParticipantsVoiceState()
*/
bool mInitParticipantsVoiceState; bool mInitParticipantsVoiceState;
boost::signals2::connection mAvatarListRefreshConnection; boost::signals2::connection mAvatarListRefreshConnection;
......
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