From 40e9c253fc6888e3e1b150dc265d79652e9ec26c Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Mon, 21 Dec 2009 14:43:09 +0200 Subject: additional commit to major task EXT-3509 User's own name should appear in the Group chat participant list 1. agent will be appear in ad-hoc conference too. 2. Disabling block/unblock yourself. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 20739d2401..7ca49928da 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -280,7 +280,7 @@ void LLCallFloater::refreshPartisipantList() if (!non_avatar_caller) { - mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList); + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT); if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager) { -- cgit v1.2.3 From 4b9c365b442acfd662086a8ce23209f8f7a7afc2 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 18 Dec 2009 14:00:00 +0200 Subject: Renamed method to reflect what it does --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 7ca49928da..1acdb96da6 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -162,6 +162,7 @@ void LLCallFloater::onChange() if (NULL == mPaticipants) return; mPaticipants->refreshVoiceState(); + } @@ -243,7 +244,7 @@ void LLCallFloater::updateSession() childSetVisible("leave_call_btn", !is_local_chat); refreshPartisipantList(); - updateModeratorState(); + updateAgentModeratorState(); //show floater for voice calls if (!is_local_chat) @@ -366,7 +367,7 @@ void LLCallFloater::setModeratorMutedVoice(bool moderator_muted) mSpeakingIndicator->setIsMuted(moderator_muted); } -void LLCallFloater::updateModeratorState() +void LLCallFloater::updateAgentModeratorState() { std::string name; gCacheName->getFullName(gAgentID, name); -- cgit v1.2.3 From 0d6af2a01d64c44a3874446c5c9a4ede71d8a98e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 21 Dec 2009 19:45:20 +0200 Subject: Additional commit for EXT-3581: the code of updating of speakers order is moved to a separate method --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1acdb96da6..2521bde8fa 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -153,6 +153,10 @@ void LLCallFloater::draw() setModeratorMutedVoice(is_moderator_muted); } + // Need to resort the participant list if it's in sort by recent speaker order. + if (mPaticipants) + mPaticipants->updateRecentSpeakersOrder(); + LLDockableFloater::draw(); } -- cgit v1.2.3 From 7bfb8ec0503d7c31d9241b2e95f103fa66b14e1e Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 21 Dec 2009 20:42:34 +0200 Subject: Work on normal bug EXT-3434 There is no difference between invited and left participants in a Group call (Voice Controls) -- implemented decorating of left participants in voice chat via italic font style (draft, harcoded) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 235 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 232 insertions(+), 3 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 2521bde8fa..fe4f0c5525 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -89,6 +89,7 @@ LLCallFloater::LLCallFloater(const LLSD& key) , mAgentPanel(NULL) , mSpeakingIndicator(NULL) , mIsModeratorMutedVoice(false) +, mInitParticipantsVoiceState(false) { mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); LLVoiceClient::getInstance()->addObserver(this); @@ -100,6 +101,8 @@ LLCallFloater::~LLCallFloater() delete mPaticipants; mPaticipants = NULL; + mAvatarListRefreshConnection.disconnect(); + // Don't use LLVoiceClient::getInstance() here // singleton MAY have already been destroyed. if(gVoiceClient) @@ -114,6 +117,8 @@ BOOL LLCallFloater::postBuild() { LLDockableFloater::postBuild(); mAvatarList = getChild("speakers_list"); + mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLCallFloater::onAvatarListRefreshed, this)); + childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); mNonAvatarCaller = getChild("non_avatar_caller"); @@ -165,8 +170,7 @@ void LLCallFloater::onChange() { if (NULL == mPaticipants) return; - mPaticipants->refreshVoiceState(); - + updateParticipantsVoiceState(); } @@ -291,7 +295,23 @@ void LLCallFloater::refreshPartisipantList() { mAvatarList->setNoItemsCommentText(getString("no_one_near")); } - mPaticipants->refreshVoiceState(); + + // we have to made delayed initialization of voice state of participant list. + // it will be performed after first LLAvatarList refreshing in the onAvatarListRefreshed(). + mInitParticipantsVoiceState = true; + } +} + +void LLCallFloater::onAvatarListRefreshed() +{ + if (mInitParticipantsVoiceState) + { + initParticipantsVoiceState(); + mInitParticipantsVoiceState = false; + } + else + { + updateParticipantsVoiceState(); } } @@ -393,4 +413,213 @@ void LLCallFloater::updateAgentModeratorState() } mAgentPanel->childSetValue("user_text", name); } + +void get_voice_participants_uuids(std::vector& speakers_uuids) +{ + // Get a list of participants from VoiceClient + LLVoiceClient::participantMap *voice_map = gVoiceClient->getParticipantList(); + if (voice_map) + { + for (LLVoiceClient::participantMap::const_iterator iter = voice_map->begin(); + iter != voice_map->end(); ++iter) + { + LLUUID id = (*iter).second->mAvatarID; + speakers_uuids.push_back(id); + } + } +} + +void LLCallFloater::initParticipantsVoiceState() +{ + // Set initial status for each participant in the list. + std::vector items; + mAvatarList->getItems(items); + std::vector::const_iterator + it = items.begin(), + it_end = items.end(); + + + std::vector speakers_uuids; + get_voice_participants_uuids(speakers_uuids); + + for(; it != it_end; ++it) + { + LLAvatarListItem *item = dynamic_cast(*it); + + if (!item) continue; + + LLUUID speaker_id = item->getAvatarId(); + + std::vector::const_iterator speaker_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), speaker_id); + + // If an avatarID assigned to a panel is found in a speakers list + // obtained from VoiceClient we assign the JOINED status to the owner + // of this avatarID. + if (speaker_iter != speakers_uuids.end()) + { + setState(item, STATE_JOINED); + } + else + { + LLPointer speakerp = mSpeakerManager->findSpeaker(speaker_id); + // If someone has already left the call before, we create his + // avatar row panel with HAS_LEFT status and remove it after + // the timeout, otherwise we create a panel with INVITED status + if (speakerp.notNull() && speakerp.get()->mHasLeftCurrentCall) + { + setState(item, STATE_LEFT); + } + else + { + setState(item, STATE_INVITED); + } + } + } +} + +void LLCallFloater::updateParticipantsVoiceState() +{ + std::vector speakers_list; + + // Get a list of participants from VoiceClient + LLVoiceClient::participantMap *map = gVoiceClient->getParticipantList(); + if (!map) return; + + 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 (mAvatarList->getItemByValue(id)); + if (item) + { + setState(item, STATE_JOINED); + } +*/ + + } + } + + // Updating the status for each participant. + std::vector items; + mAvatarList->getItems(items); + std::vector::const_iterator + it = items.begin(), + it_end = items.end(); + + for(; it != it_end; ++it) + { + LLAvatarListItem *item = dynamic_cast(*it); + if (!item) continue; + + const LLUUID participant_id = item->getAvatarId(); + bool found = false; + + std::vector::iterator speakers_iter = std::find(speakers_list.begin(), speakers_list.end(), participant_id); + + lldebugs << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << llendl; + + // If an avatarID assigned to a panel is found in a speakers list + // obtained from VoiceClient we assign the JOINED status to the owner + // of this avatarID. + if (speakers_iter != speakers_list.end()) + { + setState(item, STATE_JOINED); + + LLPointer speaker = mSpeakerManager->findSpeaker(participant_id); + if (speaker.isNull()) + continue; + speaker->mHasLeftCurrentCall = FALSE; + + speakers_list.erase(speakers_iter); + 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 ((getState(participant_id) == STATE_JOINED)) + { + setState(item, STATE_LEFT); + + LLPointer speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); + if (speaker.isNull()) + continue; + + speaker->mHasLeftCurrentCall = TRUE; + } + else if ((getState(participant_id) != STATE_LEFT)) + { + setState(item, STATE_INVITED); + } + +/* + // If there is already a started timer for the current panel don't do anything. + bool no_timer_for_current_panel = true; + if (mTimersMap.size() > 0) + { + timers_map::iterator found_it = mTimersMap.find(participant_id); + if (found_it != mTimersMap.end()) + { + no_timer_for_current_panel = false; + } + } + + if (no_timer_for_current_panel) + { + // Starting a timer to remove an avatar row panel after timeout + // *TODO Make the timeout period adjustable + mTimersMap.insert(timer_pair(participant_id, new LLAvatarRowRemoveTimer(this->getHandle(), 10, participant_id))); + } +*/ + } + } + +} + +void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state) +{ + setState(item->getAvatarId(), state); + + LLStyle::Params speaker_style; + LLFontDescriptor new_desc(speaker_style.font()->getFontDesc()); + + switch (state) + { + case STATE_INVITED: +// status_str = "INVITED"; // *TODO: localize + new_desc.setStyle(LLFontGL::NORMAL); + break; + case STATE_JOINED: +// status_str = "JOINED"; // *TODO: localize + new_desc.setStyle(LLFontGL::NORMAL); + break; + case STATE_LEFT: + { + // status_str = "HAS LEFT CALL"; // *TODO: localize + new_desc.setStyle(LLFontGL::ITALIC); + + } + break; + default: + llwarns << "Unrecognized avatar panel state (" << state << ")" << llendl; + break; + } + + LLFontGL* new_font = LLFontGL::getFont(new_desc); + speaker_style.font = new_font; + item->setStyle(speaker_style); + +// if () + { + // found speaker is in voice, mark him as online + item->setOnline(STATE_JOINED == state); + } +} + //EOF -- cgit v1.2.3