diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index fad25048a..7a2349d05 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -295,6 +295,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( mLogLabel(log_label), mQueuedMsgsForInit(), mOtherParticipantUUID(other_participant_id), + mInitialTargetIDs(ids), mDialog(dialog), mTyping(false), mTypingLineStartIndex(0), diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 1fddf5603..a13918f9c 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -148,6 +148,7 @@ protected: void removeDynamicFocus(); private: + friend class LLSpeakerMgr; // Called by UI methods. void onSendMsg(); @@ -214,6 +215,7 @@ private: // inventory folder ==> first target id in list // 911 ==> sender LLUUID mOtherParticipantUUID; + uuid_vec_t mInitialTargetIDs; EInstantMessage mDialog; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 2135fd9fb..653d4347c 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -561,6 +561,9 @@ void LLSpeakerMgr::update(BOOL resort_ok) void LLSpeakerMgr::updateSpeakerList() { + // Always add the current agent (it has to be there...). Will do nothing if already there. + setSpeaker({ gAgentID, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE }); + // Are we bound to the currently active voice channel? if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) { @@ -633,21 +636,19 @@ void LLSpeakerMgr::updateSpeakerList() mSpeakerListUpdated = true; } } - /* Singu TODO: LLIMModel::LLIMSession - else if (mSpeakers.size() == 0) + else if (floater && mSpeakers.size() == 0) { // For all other session type (ad-hoc, P2P, avaline), we use the initial participants targets list - for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it) + for (const auto& id : floater->mInitialTargetIDs) { // Add buddies if they are on line, add any other avatar. - if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it)) + if (!LLAvatarTracker::instance().isBuddy(id) || LLAvatarTracker::instance().isBuddyOnline(id)) { - setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + setSpeaker({ id, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE }); } } mSpeakerListUpdated = true; } - */ else { // The list has been updated the normal way (i.e. by a ChatterBoxSessionAgentListUpdates received from the server) @@ -655,8 +656,6 @@ void LLSpeakerMgr::updateSpeakerList() } } } - // Always add the current agent (it has to be there...). Will do nothing if already there. - setSpeaker({ gAgentID, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE }); } void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp)