From f5fc2a9c3af23cc1aaf74e432eb3690d8d376d89 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 19 Sep 2012 17:59:37 -0700 Subject: CHUI-340 : WIP : Update time stamp for IM and voice utterance --- indra/newview/llspeakers.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 07d2f1ad6f..f50ae28421 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -84,6 +84,19 @@ bool LLSpeaker::isInVoiceChannel() return mStatus <= LLSpeaker::STATUS_VOICE_ACTIVE || mStatus == LLSpeaker::STATUS_MUTED; } +LLSpeakerUpdateSpeakerEvent::LLSpeakerUpdateSpeakerEvent(LLSpeaker* source) +: LLEvent(source, "Speaker update speaker event"), +mSpeakerID (source->mID) +{ +} + +LLSD LLSpeakerUpdateSpeakerEvent::getValue() +{ + LLSD ret; + ret["id"] = mSpeakerID; + return ret; +} + LLSpeakerUpdateModeratorEvent::LLSpeakerUpdateModeratorEvent(LLSpeaker* source) : LLEvent(source, "Speaker add moderator event"), mSpeakerID (source->mID), @@ -374,6 +387,8 @@ void LLSpeakerMgr::update(BOOL resort_ok) { speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); speakerp->mHasSpoken = TRUE; + llinfos << "Merov debug : LLSpeakerMgr::update, session = " << getSessionID() << ", uuid = " << speaker_id << ", date = " << LLFrameTimer::getElapsedSeconds() << llendl; + speakerp->fireEvent(new LLSpeakerUpdateSpeakerEvent(speakerp), "update_speaker"); } speakerp->mStatus = LLSpeaker::STATUS_SPEAKING; // interpolate between active color and full speaking color based on power of speech output @@ -548,6 +563,8 @@ void LLSpeakerMgr::speakerChatted(const LLUUID& speaker_id) { speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); speakerp->mHasSpoken = TRUE; + llinfos << "Merov debug : LLSpeakerMgr::speakerChatted, session = " << getSessionID() << ", uuid = " << speaker_id << ", date = " << LLFrameTimer::getElapsedSeconds() << llendl; + speakerp->fireEvent(new LLSpeakerUpdateSpeakerEvent(speakerp), "update_speaker"); } } -- cgit v1.3 From bb8820c70b6dc50524fa8e35a4a14b3cb66bf26c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 20 Sep 2012 13:22:21 -0700 Subject: CHUI-340 : WIP : Fix the event firing from LLSpeakerMgr to LLParticipantList --- indra/newview/llspeakers.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index f50ae28421..2d2b5202e0 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -86,7 +86,7 @@ bool LLSpeaker::isInVoiceChannel() LLSpeakerUpdateSpeakerEvent::LLSpeakerUpdateSpeakerEvent(LLSpeaker* source) : LLEvent(source, "Speaker update speaker event"), -mSpeakerID (source->mID) + mSpeakerID (source->mID) { } @@ -387,8 +387,7 @@ void LLSpeakerMgr::update(BOOL resort_ok) { speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); speakerp->mHasSpoken = TRUE; - llinfos << "Merov debug : LLSpeakerMgr::update, session = " << getSessionID() << ", uuid = " << speaker_id << ", date = " << LLFrameTimer::getElapsedSeconds() << llendl; - speakerp->fireEvent(new LLSpeakerUpdateSpeakerEvent(speakerp), "update_speaker"); + fireEvent(new LLSpeakerUpdateSpeakerEvent(speakerp), "update_speaker"); } speakerp->mStatus = LLSpeaker::STATUS_SPEAKING; // interpolate between active color and full speaking color based on power of speech output @@ -563,8 +562,7 @@ void LLSpeakerMgr::speakerChatted(const LLUUID& speaker_id) { speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); speakerp->mHasSpoken = TRUE; - llinfos << "Merov debug : LLSpeakerMgr::speakerChatted, session = " << getSessionID() << ", uuid = " << speaker_id << ", date = " << LLFrameTimer::getElapsedSeconds() << llendl; - speakerp->fireEvent(new LLSpeakerUpdateSpeakerEvent(speakerp), "update_speaker"); + fireEvent(new LLSpeakerUpdateSpeakerEvent(speakerp), "update_speaker"); } } -- cgit v1.3 From 815884e0d49620db8f9f60fc629a26ad2c666749 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 15 Oct 2012 14:27:47 -0700 Subject: MAINT-1551 : WIP : Trace IM messaging in and out. --- indra/newview/lleventpoll.cpp | 38 +++++++++++++++++++++++--------------- indra/newview/llimfloater.cpp | 4 +++- indra/newview/llimview.cpp | 7 +++++++ indra/newview/llspeakers.cpp | 4 ++++ indra/newview/llvoicechannel.cpp | 2 ++ 5 files changed, 39 insertions(+), 16 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 4f4d9a40b4..1cf3de8ef0 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -37,6 +37,7 @@ #include "llviewerregion.h" #include "message.h" #include "lltrans.h" +#include "llsdserialize.h" namespace { @@ -109,14 +110,14 @@ namespace const std::string& pollURL, const LLHost& sender) { LLHTTPClient::ResponderPtr result = new LLEventPollResponder(pollURL, sender); - llinfos << "LLEventPollResponder::start <" << sCount << "> " + llinfos << "Merov debug : LLEventPollResponder::start <" << sCount << "> " << pollURL << llendl; return result; } void LLEventPollResponder::stop() { - llinfos << "LLEventPollResponder::stop <" << mCount << "> " + llinfos << "Merov debug : LLEventPollResponder::stop <" << mCount << "> " << mPollURL << llendl; // there should be a way to stop a LLHTTPClient request in progress mDone = true; @@ -134,17 +135,17 @@ namespace LLViewerRegion *regionp = gAgent.getRegion(); if (!regionp) { - llerrs << "LLEventPoll initialized before region is added." << llendl; + llinfos << "Merov debug : LLEventPoll initialized before region is added." << llendl; } mSender = sender.getIPandPort(); - llinfos << "LLEventPoll initialized with sender " << mSender << llendl; + llinfos << "Merov debug : LLEventPoll initialized with sender " << mSender << llendl; makeRequest(); } LLEventPollResponder::~LLEventPollResponder() { stop(); - lldebugs << "LLEventPollResponder::~Impl <" << mCount << "> " + llinfos << "Merov debug : LLEventPollResponder::~Impl <" << mCount << "> " << mPollURL << llendl; } @@ -154,6 +155,7 @@ namespace const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + llinfos << "Merov debug : LLEventPollResponder::completedRaw, status = " << status << ", reason = " << reason << llendl; if (status == HTTP_BAD_GATEWAY) { // These errors are not parsable as LLSD, @@ -172,8 +174,12 @@ namespace request["ack"] = mAcknowledge; request["done"] = mDone; - lldebugs << "LLEventPollResponder::makeRequest <" << mCount << "> ack = " - << LLSDXMLStreamer(mAcknowledge) << llendl; + llinfos << "Merov debug : viewer->sim : LLEventPollResponder::makeRequest <" << mCount + << "> ack = " << LLSDXMLStreamer(mAcknowledge) + << ", error = " << mErrorCount + << ", sender = " << mSender + << ", url = " << mPollURL + << ", done = " << mDone << llendl; LLHTTPClient::post(mPollURL, request, this); } @@ -183,12 +189,14 @@ namespace LLSD message; message["sender"] = mSender; message["body"] = content["body"]; + llinfos << "Merov debug : sim->viewer : LLEventPollResponder::handleMessage, msg_name = " << msg_name << ", message = " << LLSDOStreamer(message) << llendl; LLMessageSystem::dispatch(msg_name, message); } //virtual void LLEventPollResponder::error(U32 status, const std::string& reason) { + llinfos << "Merov debug : LLEventPollResponder::error, status = " << status << ", reason = " << reason << llendl; if (mDone) return; // A HTTP_BAD_GATEWAY (502) error is our standard timeout response @@ -207,11 +215,11 @@ namespace + mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC , this); - llwarns << "Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl; + llinfos << "Merov debug : Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl; } else { - llwarns << "LLEventPollResponder::error: <" << mCount << "> got " + llinfos << "Merov debug : LLEventPollResponder::error: <" << mCount << "> got " << status << ": " << reason << (mDone ? " -- done" : "") << llendl; stop(); @@ -227,7 +235,7 @@ namespace // continue running. if(gAgent.getRegion() && gAgent.getRegion()->getHost().getIPandPort() == mSender) { - llwarns << "Forcing disconnect due to stalled main region event poll." << llendl; + llinfos << "Merov debug : Forcing disconnect due to stalled main region event poll." << llendl; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection")); } } @@ -236,8 +244,8 @@ namespace //virtual void LLEventPollResponder::result(const LLSD& content) { - lldebugs << "LLEventPollResponder::result <" << mCount << ">" - << (mDone ? " -- done" : "") << llendl; + llinfos << "Merov debug : LLEventPollResponder::result <" << mCount << "> " + << (mDone ? " -- done" : "") << ", content = " << LLSDOStreamer(content) << llendl; if (mDone) return; @@ -246,7 +254,7 @@ namespace if (!content.get("events") || !content.get("id")) { - llwarns << "received event poll with no events or id key" << llendl; + llinfos << "Merov debug : received event poll with no events or id key" << llendl; makeRequest(); return; } @@ -256,11 +264,11 @@ namespace if(mAcknowledge.isUndefined()) { - llwarns << "LLEventPollResponder: id undefined" << llendl; + llinfos << "Merov debug : LLEventPollResponder: id undefined" << llendl; } // was llinfos but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG - lldebugs << "LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id " + llinfos << "Merov debug : LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id " << LLSDXMLStreamer(mAcknowledge) << ")" << llendl; LLSD::array_const_iterator i = events.beginArray(); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 467f48600a..47e091a57c 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -59,6 +59,7 @@ #include "llviewerchat.h" #include "llnotificationmanager.h" #include "llautoreplace.h" +#include "llsdserialize.h" floater_showed_signal_t LLIMFloater::sIMFloaterShowedSignal; @@ -1208,11 +1209,12 @@ BOOL LLIMFloater::inviteToSession(const uuid_vec_t& ids) } data["method"] = "invite"; data["session-id"] = mSessionID; + llinfos << "Merov debug : viewer->sim : LLIMFloater::inviteToSession, session id = " << mSessionID << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data,new LLSessionInviteResponder(mSessionID)); } else { - llinfos << "LLIMFloater::inviteToSession -" + llinfos << "Merov debug : LLIMFloater::inviteToSession -" << " no need to invite agents for " << mDialog << llendl; // successful add, because everyone that needed to get added diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b45903835a..398584e005 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -63,6 +63,7 @@ #include "lltoolbarview.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" +#include "llsdserialize.h" const static std::string ADHOC_NAME_SUFFIX(" Conference"); @@ -1316,6 +1317,7 @@ bool LLIMModel::sendStartSession( data["params"] = agents; + llinfos << "Merov debug : viewer-> sim : LLIMModel::sendStartSession, session id = " << temp_session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -2253,6 +2255,7 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload LLSD data; data["method"] = "accept invitation"; data["session-id"] = session_id; + llinfos << "Merov debug : viewer-> sim : LLIncomingCallDialog::processCallResponse, accept, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -2293,6 +2296,7 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload LLSD data; data["method"] = "decline invitation"; data["session-id"] = session_id; + llinfos << "Merov debug : viewer-> sim : LLIncomingCallDialog::processCallResponse, decline, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -2346,6 +2350,7 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) LLSD data; data["method"] = "accept invitation"; data["session-id"] = session_id; + llinfos << "Merov debug : viewer-> sim : inviteUserResponse, accept, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -2381,6 +2386,7 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) LLSD data; data["method"] = "decline invitation"; data["session-id"] = session_id; + llinfos << "Merov debug : viewer-> sim : inviteUserResponse, decline, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -3345,6 +3351,7 @@ public: LLSD data; data["method"] = "accept invitation"; data["session-id"] = session_id; + llinfos << "Merov debug : viewer-> sim : LLViewerChatterBoxInvitation, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 2d2b5202e0..19b99fef11 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -36,6 +36,7 @@ #include "llviewerobjectlist.h" #include "llvoavatar.h" #include "llworld.h" +#include "llsdserialize.h" const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f); const LLColor4 ACTIVE_COLOR(0.5f, 0.5f, 0.5f, 1.f); @@ -785,6 +786,7 @@ void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id) //current value represents ability to type, so invert data["params"]["mute_info"]["text"] = !speakerp->mModeratorMutedText; + llinfos << "Merov debug : viewer->sim : LLIMSpeakerMgr::toggleAllowTextChat, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data, new ModerationResponder(getSessionID())); } @@ -809,6 +811,7 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu data["params"]["mute_info"] = LLSD::emptyMap(); data["params"]["mute_info"]["voice"] = !unmute; + llinfos << "Merov debug : viewer->sim : LLIMSpeakerMgr::moderateVoiceParticipant, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -851,6 +854,7 @@ void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallo data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); data["params"]["update_info"]["moderated_mode"]["voice"] = disallow_voice; + llinfos << "Merov debug : viewer->sim : LLIMSpeakerMgr::moderateVoiceSession, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data, new ModerationResponder(session_id)); } diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index ceff75a0cc..62a43333dd 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -35,6 +35,7 @@ #include "llrecentpeople.h" #include "llviewercontrol.h" #include "llvoicechannel.h" +#include "llsdserialize.h" LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; @@ -539,6 +540,7 @@ void LLVoiceChannelGroup::getChannelInfo() LLSD data; data["method"] = "call"; data["session-id"] = mSessionID; + llinfos << "Merov debug : viewer-> sim : LLVoiceChannelGroup::getChannelInfo, session id = " << mSessionID << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data, new LLVoiceCallCapResponder(mSessionID)); -- cgit v1.3 From a8c443feb21d5fe486e9a30649089633ae3f6e22 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 15 Oct 2012 14:29:57 -0700 Subject: MAINT-1551 : WIP : More IM comm tracing and attempt to fix --- indra/newview/llavataractions.cpp | 11 +++++++++-- indra/newview/lleventpoll.cpp | 31 +++++++++++++++++-------------- indra/newview/llspeakers.cpp | 2 ++ 3 files changed, 28 insertions(+), 16 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 3326103d03..f7f5c04ef9 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -296,10 +296,17 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float } const std::string title = LLTrans::getString("conference-title"); LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], id_array, false, floater_id); - if (session_id != LLUUID::null) + + if (session_id == LLUUID::null) { - LLIMFloater::show(session_id); + return; } + + LLIMFloater::show(session_id); +// gIMMgr->processAgentListUpdates(session_id, LLSD()); + gIMMgr->startCall(session_id,LLVoiceChannel::OUTGOING_CALL); + gIMMgr->endCall(session_id); + make_ui_sound("UISndStartIM"); } diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 4f4d9a40b4..a5aa014a74 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -109,14 +109,14 @@ namespace const std::string& pollURL, const LLHost& sender) { LLHTTPClient::ResponderPtr result = new LLEventPollResponder(pollURL, sender); - llinfos << "LLEventPollResponder::start <" << sCount << "> " + llinfos << "Merov debug : LLEventPollResponder::start <" << sCount << "> " << pollURL << llendl; return result; } void LLEventPollResponder::stop() { - llinfos << "LLEventPollResponder::stop <" << mCount << "> " + llinfos << "Merov debug : LLEventPollResponder::stop <" << mCount << "> " << mPollURL << llendl; // there should be a way to stop a LLHTTPClient request in progress mDone = true; @@ -137,14 +137,14 @@ namespace llerrs << "LLEventPoll initialized before region is added." << llendl; } mSender = sender.getIPandPort(); - llinfos << "LLEventPoll initialized with sender " << mSender << llendl; + llinfos << "Merov debug : LLEventPoll initialized with sender " << mSender << llendl; makeRequest(); } LLEventPollResponder::~LLEventPollResponder() { stop(); - lldebugs << "LLEventPollResponder::~Impl <" << mCount << "> " + llinfos << "Merov debug : LLEventPollResponder::~Impl <" << mCount << "> " << mPollURL << llendl; } @@ -154,11 +154,13 @@ namespace const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { + llinfos << "Merov debug : LLEventPollResponder::completedRaw url <" << mPollURL << ">, status = " << status << ", reason = " << reason << llendl; if (status == HTTP_BAD_GATEWAY) { // These errors are not parsable as LLSD, // which LLHTTPClient::Responder::completedRaw will try to do. - completed(status, reason, LLSD()); + //completed(status, reason, LLSD()); + error(status, reason); } else { @@ -172,8 +174,7 @@ namespace request["ack"] = mAcknowledge; request["done"] = mDone; - lldebugs << "LLEventPollResponder::makeRequest <" << mCount << "> ack = " - << LLSDXMLStreamer(mAcknowledge) << llendl; + llinfos << "Merov debug : LLEventPollResponder::makeRequest <" << mCount << "> ack = " << LLSDXMLStreamer(mAcknowledge) << llendl; LLHTTPClient::post(mPollURL, request, this); } @@ -183,6 +184,7 @@ namespace LLSD message; message["sender"] = mSender; message["body"] = content["body"]; + llinfos << "Merov debug : LLEventPollResponder::handleMessage, msg_name = " << msg_name << ", message = " << LLSDOStreamer(message) << llendl; LLMessageSystem::dispatch(msg_name, message); } @@ -190,6 +192,7 @@ namespace void LLEventPollResponder::error(U32 status, const std::string& reason) { if (mDone) return; + llinfos << "Merov debug : LLEventPollResponder::error, status = " << status << ", reason = " << reason << llendl; // A HTTP_BAD_GATEWAY (502) error is our standard timeout response // we get this when there are no events. @@ -207,11 +210,11 @@ namespace + mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC , this); - llwarns << "Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl; + llinfos << "Merov debug : Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl; } else { - llwarns << "LLEventPollResponder::error: <" << mCount << "> got " + llinfos << "Merov debug : LLEventPollResponder::error: <" << mCount << "> got " << status << ": " << reason << (mDone ? " -- done" : "") << llendl; stop(); @@ -227,7 +230,7 @@ namespace // continue running. if(gAgent.getRegion() && gAgent.getRegion()->getHost().getIPandPort() == mSender) { - llwarns << "Forcing disconnect due to stalled main region event poll." << llendl; + llinfos << "Merov debug : Forcing disconnect due to stalled main region event poll." << llendl; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection")); } } @@ -236,7 +239,7 @@ namespace //virtual void LLEventPollResponder::result(const LLSD& content) { - lldebugs << "LLEventPollResponder::result <" << mCount << ">" + llinfos << "Merov debug : LLEventPollResponder::result <" << mCount << ">" << (mDone ? " -- done" : "") << llendl; if (mDone) return; @@ -246,7 +249,7 @@ namespace if (!content.get("events") || !content.get("id")) { - llwarns << "received event poll with no events or id key" << llendl; + llinfos << "Merov debug : received event poll with no events or id key" << llendl; makeRequest(); return; } @@ -256,11 +259,11 @@ namespace if(mAcknowledge.isUndefined()) { - llwarns << "LLEventPollResponder: id undefined" << llendl; + llinfos << "Merov debug : LLEventPollResponder: id undefined" << llendl; } // was llinfos but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG - lldebugs << "LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id " + llinfos << "Merov debug : LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id " << LLSDXMLStreamer(mAcknowledge) << ")" << llendl; LLSD::array_const_iterator i = events.beginArray(); diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 2d2b5202e0..92149ee50a 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -286,6 +286,7 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin mSpeakers.insert(std::make_pair(speakerp->mID, speakerp)); mSpeakersSorted.push_back(speakerp); LL_DEBUGS("Speakers") << "Added speaker " << id << llendl; + //llinfos << "Merov debug : setSpeaker, add, id = " << id << ", name = " << name << llendl; fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "add"); } else @@ -306,6 +307,7 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin } else { + llinfos << "Merov debug : setSpeaker, speaker not found? id = " << id << ", name = " << name << llendl; LL_WARNS("Speakers") << "Speaker " << id << " not found" << llendl; } } -- cgit v1.3 From 1557bffb5630158430946abd600218be89e3590e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 15 Oct 2012 19:44:14 -0700 Subject: MAINT-1551 : WIP : Added a hack : send an accept invitation message so to trigger the sending of the agent list. --- indra/newview/llavataractions.cpp | 4 +- indra/newview/llspeakers.cpp | 126 +++++++++++++++++++++++++++----------- indra/newview/llspeakers.h | 2 + 3 files changed, 93 insertions(+), 39 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f7f5c04ef9..600df31c8b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -304,8 +304,8 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float LLIMFloater::show(session_id); // gIMMgr->processAgentListUpdates(session_id, LLSD()); - gIMMgr->startCall(session_id,LLVoiceChannel::OUTGOING_CALL); - gIMMgr->endCall(session_id); +// gIMMgr->startCall(session_id,LLVoiceChannel::OUTGOING_CALL); +// gIMMgr->endCall(session_id); make_ui_sound("UISndStartIM"); } diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 2e26eabb71..11d1b563ac 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -256,6 +256,64 @@ bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_ } +// +// ModerationResponder +// + +class ModerationResponder : public LLHTTPClient::Responder +{ +public: + ModerationResponder(const LLUUID& session_id) + { + mSessionID = session_id; + } + + virtual void error(U32 status, const std::string& reason) + { + llwarns << status << ": " << reason << llendl; + + if ( gIMMgr ) + { + //403 == you're not a mod + //should be disabled if you're not a moderator + if ( 403 == status ) + { + gIMMgr->showSessionEventError( + "mute", + "not_a_mod_error", + mSessionID); + } + else + { + gIMMgr->showSessionEventError( + "mute", + "generic_request_error", + mSessionID); + } + } + } + +private: + LLUUID mSessionID; +}; + +class UpdateResponder : public LLHTTPClient::Responder +{ +public: + UpdateResponder(const LLUUID& session_id) + { + mSessionID = session_id; + } + + virtual void error(U32 status, const std::string& reason) + { + llinfos << "Merov debug : UpdateResponder error, status = " << status << ": " << reason << llendl; + } + +private: + LLUUID mSessionID; +}; + // // LLSpeakerMgr // @@ -483,6 +541,37 @@ void LLSpeakerMgr::updateSpeakerList() } } + else + { + // Check if the list is empty, except if it's Nearby Chat (session_id NULL). + LLUUID session_id = getSessionID(); + if ((mSpeakers.size() == 0) && (!session_id.isNull())) + { + llinfos << "Merov debug : LLSpeakerMgr::updateSpeakerList: No speakers in " << session_id << llendl; + // MAINT-1551 : If the list is empty for too long, we should send a message to the sim so that + // it sends the participant list again. + updateSession(); + } + } +} + +void LLSpeakerMgr::updateSession() +{ + std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + LLSD data; + data["method"] = "accept invitation"; +// data["method"] = "session update"; + data["session-id"] = getSessionID(); +// data["params"] = LLSD::emptyMap(); + +// data["params"]["update_info"] = LLSD::emptyMap(); + +// data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); +// data["params"]["update_info"]["moderated_mode"]["voice"] = false; + + llinfos << "Merov debug : viewer->sim : LLSpeakerMgr::updateSession, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; + + LLHTTPClient::post(url, data, new UpdateResponder(getSessionID())); } void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) @@ -736,43 +825,6 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) } } -class ModerationResponder : public LLHTTPClient::Responder -{ -public: - ModerationResponder(const LLUUID& session_id) - { - mSessionID = session_id; - } - - virtual void error(U32 status, const std::string& reason) - { - llwarns << status << ": " << reason << llendl; - - if ( gIMMgr ) - { - //403 == you're not a mod - //should be disabled if you're not a moderator - if ( 403 == status ) - { - gIMMgr->showSessionEventError( - "mute", - "not_a_mod_error", - mSessionID); - } - else - { - gIMMgr->showSessionEventError( - "mute", - "generic_request_error", - mSessionID); - } - } - } - -private: - LLUUID mSessionID; -}; - void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id) { LLPointer speakerp = findSpeaker(speaker_id); diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 8ab08661d3..671b3fb341 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -258,6 +258,8 @@ protected: void setSpeakerNotInChannel(LLSpeaker* speackerp); bool removeSpeaker(const LLUUID& speaker_id); + void updateSession(); + typedef std::map > speaker_map_t; speaker_map_t mSpeakers; -- cgit v1.3 From d60609e0096bc7ede9edde1ba6d103f5f860af0d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 17 Oct 2012 12:26:40 -0700 Subject: MAINT-1551 : WIP : More tests to elicit a correct answer from the backbone server --- indra/newview/llimview.cpp | 1 + indra/newview/llspeakers.cpp | 52 +++++++++++++++++++++++++++++++++++--------- indra/newview/llspeakers.h | 2 ++ 3 files changed, 45 insertions(+), 10 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 398584e005..e6f93aa9be 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -238,6 +238,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& //we need to wait for session initialization for outgoing ad-hoc and group chat session //correct session id for initiated ad-hoc chat will be received from the server + // Merov : MAINT-1551 : We need to read that mInitialTargetIDs when initializing the conversation if (!LLIMModel::getInstance()->sendStartSession(mSessionID, mOtherParticipantID, mInitialTargetIDs, mType)) { diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 11d1b563ac..217efdf4af 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -307,7 +307,7 @@ public: virtual void error(U32 status, const std::string& reason) { - llinfos << "Merov debug : UpdateResponder error, status = " << status << ": " << reason << llendl; + llinfos << "Merov debug : UpdateResponder error, on " << mSessionID << ", status = " << status << ": " << reason << llendl; } private: @@ -322,8 +322,11 @@ LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : mVoiceChannel(channelp) , mVoiceModerated(false) , mModerateModeHandledFirstTime(false) +, mSessionUpdated(false) +, mSessionID() { static LLUICachedControl remove_delay ("SpeakerParticipantRemoveDelay", 10.0); +// mSessionID = getSessionID(); mSpeakerDelayRemover = new LLSpeakersDelayActionsStorage(boost::bind(&LLSpeakerMgr::removeSpeaker, this, _1), remove_delay); } @@ -547,7 +550,7 @@ void LLSpeakerMgr::updateSpeakerList() LLUUID session_id = getSessionID(); if ((mSpeakers.size() == 0) && (!session_id.isNull())) { - llinfos << "Merov debug : LLSpeakerMgr::updateSpeakerList: No speakers in " << session_id << llendl; + //llinfos << "Merov debug : LLSpeakerMgr::updateSpeakerList: No speakers in " << session_id << llendl; // MAINT-1551 : If the list is empty for too long, we should send a message to the sim so that // it sends the participant list again. updateSession(); @@ -557,21 +560,50 @@ void LLSpeakerMgr::updateSpeakerList() void LLSpeakerMgr::updateSession() { + // We perform this update if is has never been done or if the session id changed (which happens in ad-hoc sessions) + if (mSessionUpdated && (mSessionID == getSessionID())) + return; + std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); LLSD data; - data["method"] = "accept invitation"; -// data["method"] = "session update"; + +// That doesn't work apparently because we are not in the invite list so we get error 500 +// data["method"] = "accept invitation"; +// data["session-id"] = getSessionID(); + +// That doesn't work because we're not a moderator on an IM session so our request is rejected as such (error 403) + data["method"] = "session update"; + data["session-id"] = getSessionID(); + data["params"] = LLSD::emptyMap(); + data["params"]["update_info"] = LLSD::emptyMap(); + data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); + data["params"]["update_info"]["moderated_mode"]["voice"] = false; + +// That doesn't work, we eventually time out (error 502)... +// data["method"] = "call"; +// data["session-id"] = getSessionID(); + + data["params"] = LLSD::emptyArray(); +// for (int i = 0; i < count; i++) +// { +// data["params"].append(ids[i]); +// } + data["params"].append(gAgentID); + data["method"] = "invite"; data["session-id"] = getSessionID(); -// data["params"] = LLSD::emptyMap(); - -// data["params"]["update_info"] = LLSD::emptyMap(); - -// data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); -// data["params"]["update_info"]["moderated_mode"]["voice"] = false; llinfos << "Merov debug : viewer->sim : LLSpeakerMgr::updateSession, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data, new UpdateResponder(getSessionID())); + + // bit of extra in the case of invite being sent + data.clear(); + data["method"] = "accept invitation"; + data["session-id"] = getSessionID(); + LLHTTPClient::post(url, data, new UpdateResponder(getSessionID())); + + mSessionUpdated = true; + mSessionID = getSessionID(); } void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 671b3fb341..8a80c4619e 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -259,6 +259,8 @@ protected: bool removeSpeaker(const LLUUID& speaker_id); void updateSession(); + bool mSessionUpdated; + LLUUID mSessionID; typedef std::map > speaker_map_t; speaker_map_t mSpeakers; -- cgit v1.3 From 1006e2fd259d5f8136ca933eba8d57c8a980bf31 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 17 Oct 2012 17:14:44 -0700 Subject: CHUI-422 : Update the ad-hoc conversation with the known list of on line agents without waiting for server message (which often doesn't come...). --- indra/newview/llavataractions.cpp | 3 -- indra/newview/lleventpoll.cpp | 42 +++++++----------- indra/newview/llimview.cpp | 3 +- indra/newview/llspeakers.cpp | 92 ++++++--------------------------------- indra/newview/llspeakers.h | 4 -- 5 files changed, 32 insertions(+), 112 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 600df31c8b..7322b3bb0b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -303,9 +303,6 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float } LLIMFloater::show(session_id); -// gIMMgr->processAgentListUpdates(session_id, LLSD()); -// gIMMgr->startCall(session_id,LLVoiceChannel::OUTGOING_CALL); -// gIMMgr->endCall(session_id); make_ui_sound("UISndStartIM"); } diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 27f79dda2c..4f4d9a40b4 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -37,7 +37,6 @@ #include "llviewerregion.h" #include "message.h" #include "lltrans.h" -#include "llsdserialize.h" namespace { @@ -110,14 +109,14 @@ namespace const std::string& pollURL, const LLHost& sender) { LLHTTPClient::ResponderPtr result = new LLEventPollResponder(pollURL, sender); - llinfos << "Merov debug : LLEventPollResponder::start <" << sCount << "> " + llinfos << "LLEventPollResponder::start <" << sCount << "> " << pollURL << llendl; return result; } void LLEventPollResponder::stop() { - llinfos << "Merov debug : LLEventPollResponder::stop <" << mCount << "> " + llinfos << "LLEventPollResponder::stop <" << mCount << "> " << mPollURL << llendl; // there should be a way to stop a LLHTTPClient request in progress mDone = true; @@ -135,17 +134,17 @@ namespace LLViewerRegion *regionp = gAgent.getRegion(); if (!regionp) { - llinfos << "Merov debug : LLEventPoll initialized before region is added." << llendl; + llerrs << "LLEventPoll initialized before region is added." << llendl; } mSender = sender.getIPandPort(); - llinfos << "Merov debug : LLEventPoll initialized with sender " << mSender << llendl; + llinfos << "LLEventPoll initialized with sender " << mSender << llendl; makeRequest(); } LLEventPollResponder::~LLEventPollResponder() { stop(); - llinfos << "Merov debug : LLEventPollResponder::~Impl <" << mCount << "> " + lldebugs << "LLEventPollResponder::~Impl <" << mCount << "> " << mPollURL << llendl; } @@ -155,13 +154,11 @@ namespace const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { - llinfos << "Merov debug : LLEventPollResponder::completedRaw url <" << mPollURL << ">, status = " << status << ", reason = " << reason << llendl; if (status == HTTP_BAD_GATEWAY) { // These errors are not parsable as LLSD, // which LLHTTPClient::Responder::completedRaw will try to do. - //completed(status, reason, LLSD()); - error(status, reason); + completed(status, reason, LLSD()); } else { @@ -175,12 +172,8 @@ namespace request["ack"] = mAcknowledge; request["done"] = mDone; - llinfos << "Merov debug : viewer->sim : LLEventPollResponder::makeRequest <" << mCount - << "> ack = " << LLSDXMLStreamer(mAcknowledge) - << ", error = " << mErrorCount - << ", sender = " << mSender - << ", url = " << mPollURL - << ", done = " << mDone << llendl; + lldebugs << "LLEventPollResponder::makeRequest <" << mCount << "> ack = " + << LLSDXMLStreamer(mAcknowledge) << llendl; LLHTTPClient::post(mPollURL, request, this); } @@ -190,16 +183,13 @@ namespace LLSD message; message["sender"] = mSender; message["body"] = content["body"]; - llinfos << "Merov debug : sim->viewer : LLEventPollResponder::handleMessage, msg_name = " << msg_name << ", message = " << LLSDOStreamer(message) << llendl; LLMessageSystem::dispatch(msg_name, message); } //virtual void LLEventPollResponder::error(U32 status, const std::string& reason) { - llinfos << "Merov debug : LLEventPollResponder::error, status = " << status << ", reason = " << reason << llendl; if (mDone) return; - llinfos << "Merov debug : LLEventPollResponder::error, status = " << status << ", reason = " << reason << llendl; // A HTTP_BAD_GATEWAY (502) error is our standard timeout response // we get this when there are no events. @@ -217,11 +207,11 @@ namespace + mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC , this); - llinfos << "Merov debug : Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl; + llwarns << "Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl; } else { - llinfos << "Merov debug : LLEventPollResponder::error: <" << mCount << "> got " + llwarns << "LLEventPollResponder::error: <" << mCount << "> got " << status << ": " << reason << (mDone ? " -- done" : "") << llendl; stop(); @@ -237,7 +227,7 @@ namespace // continue running. if(gAgent.getRegion() && gAgent.getRegion()->getHost().getIPandPort() == mSender) { - llinfos << "Merov debug : Forcing disconnect due to stalled main region event poll." << llendl; + llwarns << "Forcing disconnect due to stalled main region event poll." << llendl; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection")); } } @@ -246,8 +236,8 @@ namespace //virtual void LLEventPollResponder::result(const LLSD& content) { - llinfos << "Merov debug : LLEventPollResponder::result <" << mCount << "> " - << (mDone ? " -- done" : "") << ", content = " << LLSDOStreamer(content) << llendl; + lldebugs << "LLEventPollResponder::result <" << mCount << ">" + << (mDone ? " -- done" : "") << llendl; if (mDone) return; @@ -256,7 +246,7 @@ namespace if (!content.get("events") || !content.get("id")) { - llinfos << "Merov debug : received event poll with no events or id key" << llendl; + llwarns << "received event poll with no events or id key" << llendl; makeRequest(); return; } @@ -266,11 +256,11 @@ namespace if(mAcknowledge.isUndefined()) { - llinfos << "Merov debug : LLEventPollResponder: id undefined" << llendl; + llwarns << "LLEventPollResponder: id undefined" << llendl; } // was llinfos but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG - llinfos << "Merov debug : LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id " + lldebugs << "LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id " << LLSDXMLStreamer(mAcknowledge) << ")" << llendl; LLSD::array_const_iterator i = events.beginArray(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index e6f93aa9be..b5f22731f1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -238,7 +238,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& //we need to wait for session initialization for outgoing ad-hoc and group chat session //correct session id for initiated ad-hoc chat will be received from the server - // Merov : MAINT-1551 : We need to read that mInitialTargetIDs when initializing the conversation if (!LLIMModel::getInstance()->sendStartSession(mSessionID, mOtherParticipantID, mInitialTargetIDs, mType)) { @@ -1301,6 +1300,7 @@ bool LLIMModel::sendStartSession( else if ( dialog == IM_SESSION_CONFERENCE_START ) { LLSD agents; + agents.append(gAgent.getID()); for (int i = 0; i < (S32) ids.size(); i++) { agents.append(ids[i]); @@ -1319,6 +1319,7 @@ bool LLIMModel::sendStartSession( data["params"] = agents; llinfos << "Merov debug : viewer-> sim : LLIMModel::sendStartSession, session id = " << temp_session_id << ", data = " << LLSDOStreamer(data) << llendl; + llinfos << "Merov debug : Extra info for LLIMModel::sendStartSession, other_participant_id = " << other_participant_id << ", agent id = " << gAgent.getID() << llendl; LLHTTPClient::post( url, data, diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 217efdf4af..64477765e1 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -36,7 +36,6 @@ #include "llviewerobjectlist.h" #include "llvoavatar.h" #include "llworld.h" -#include "llsdserialize.h" const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f); const LLColor4 ACTIVE_COLOR(0.5f, 0.5f, 0.5f, 1.f); @@ -297,23 +296,6 @@ private: LLUUID mSessionID; }; -class UpdateResponder : public LLHTTPClient::Responder -{ -public: - UpdateResponder(const LLUUID& session_id) - { - mSessionID = session_id; - } - - virtual void error(U32 status, const std::string& reason) - { - llinfos << "Merov debug : UpdateResponder error, on " << mSessionID << ", status = " << status << ": " << reason << llendl; - } - -private: - LLUUID mSessionID; -}; - // // LLSpeakerMgr // @@ -322,11 +304,8 @@ LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : mVoiceChannel(channelp) , mVoiceModerated(false) , mModerateModeHandledFirstTime(false) -, mSessionUpdated(false) -, mSessionID() { static LLUICachedControl remove_delay ("SpeakerParticipantRemoveDelay", 10.0); -// mSessionID = getSessionID(); mSpeakerDelayRemover = new LLSpeakersDelayActionsStorage(boost::bind(&LLSpeakerMgr::removeSpeaker, this, _1), remove_delay); } @@ -348,7 +327,6 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin mSpeakers.insert(std::make_pair(speakerp->mID, speakerp)); mSpeakersSorted.push_back(speakerp); LL_DEBUGS("Speakers") << "Added speaker " << id << llendl; - //llinfos << "Merov debug : setSpeaker, add, id = " << id << ", name = " << name << llendl; fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "add"); } else @@ -369,7 +347,6 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin } else { - llinfos << "Merov debug : setSpeaker, speaker not found? id = " << id << ", name = " << name << llendl; LL_WARNS("Speakers") << "Speaker " << id << " not found" << llendl; } } @@ -550,62 +527,24 @@ void LLSpeakerMgr::updateSpeakerList() LLUUID session_id = getSessionID(); if ((mSpeakers.size() == 0) && (!session_id.isNull())) { - //llinfos << "Merov debug : LLSpeakerMgr::updateSpeakerList: No speakers in " << session_id << llendl; - // MAINT-1551 : If the list is empty for too long, we should send a message to the sim so that - // it sends the participant list again. - updateSession(); + // If the list is empty, we update it with whatever was used to initiate the call so that it doesn't stay empty too long. + // *TODO: Fix the server side code that sometimes forgets to send back the list of agents after a chat started + // (IOW, fix why we get no ChatterBoxSessionAgentListUpdates message after the initial ChatterBoxSessionStartReply) + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); + for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it) + { + // We only add avatars that are on line + if (LLAvatarTracker::instance().isBuddyOnline(*it)) + { + setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + } + } + // Also add the current agent + setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } } } -void LLSpeakerMgr::updateSession() -{ - // We perform this update if is has never been done or if the session id changed (which happens in ad-hoc sessions) - if (mSessionUpdated && (mSessionID == getSessionID())) - return; - - std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); - LLSD data; - -// That doesn't work apparently because we are not in the invite list so we get error 500 -// data["method"] = "accept invitation"; -// data["session-id"] = getSessionID(); - -// That doesn't work because we're not a moderator on an IM session so our request is rejected as such (error 403) - data["method"] = "session update"; - data["session-id"] = getSessionID(); - data["params"] = LLSD::emptyMap(); - data["params"]["update_info"] = LLSD::emptyMap(); - data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); - data["params"]["update_info"]["moderated_mode"]["voice"] = false; - -// That doesn't work, we eventually time out (error 502)... -// data["method"] = "call"; -// data["session-id"] = getSessionID(); - - data["params"] = LLSD::emptyArray(); -// for (int i = 0; i < count; i++) -// { -// data["params"].append(ids[i]); -// } - data["params"].append(gAgentID); - data["method"] = "invite"; - data["session-id"] = getSessionID(); - - llinfos << "Merov debug : viewer->sim : LLSpeakerMgr::updateSession, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; - - LLHTTPClient::post(url, data, new UpdateResponder(getSessionID())); - - // bit of extra in the case of invite being sent - data.clear(); - data["method"] = "accept invitation"; - data["session-id"] = getSessionID(); - LLHTTPClient::post(url, data, new UpdateResponder(getSessionID())); - - mSessionUpdated = true; - mSessionID = getSessionID(); -} - void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) { speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; @@ -872,7 +811,6 @@ void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id) //current value represents ability to type, so invert data["params"]["mute_info"]["text"] = !speakerp->mModeratorMutedText; - llinfos << "Merov debug : viewer->sim : LLIMSpeakerMgr::toggleAllowTextChat, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data, new ModerationResponder(getSessionID())); } @@ -897,7 +835,6 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu data["params"]["mute_info"] = LLSD::emptyMap(); data["params"]["mute_info"]["voice"] = !unmute; - llinfos << "Merov debug : viewer->sim : LLIMSpeakerMgr::moderateVoiceParticipant, session id = " << getSessionID() << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post( url, data, @@ -940,7 +877,6 @@ void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallo data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); data["params"]["update_info"]["moderated_mode"]["voice"] = disallow_voice; - llinfos << "Merov debug : viewer->sim : LLIMSpeakerMgr::moderateVoiceSession, session id = " << session_id << ", data = " << LLSDOStreamer(data) << llendl; LLHTTPClient::post(url, data, new ModerationResponder(session_id)); } diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 8a80c4619e..8ab08661d3 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -258,10 +258,6 @@ protected: void setSpeakerNotInChannel(LLSpeaker* speackerp); bool removeSpeaker(const LLUUID& speaker_id); - void updateSession(); - bool mSessionUpdated; - LLUUID mSessionID; - typedef std::map > speaker_map_t; speaker_map_t mSpeakers; -- cgit v1.3 From e6a7133ef1fa1760e0bfb53f5b14e7b6e76da0f5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 19 Oct 2012 13:57:40 -0700 Subject: CHUI-422 : Add invited non buddies to the initial set of speakers --- indra/newview/llspeakers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 64477765e1..46fd8c1290 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -533,8 +533,8 @@ void LLSpeakerMgr::updateSpeakerList() LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it) { - // We only add avatars that are on line - if (LLAvatarTracker::instance().isBuddyOnline(*it)) + // Allow to set buddies if they are on line. Allow any other avatar. + if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it)) { setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } -- cgit v1.3 From 4ec5ee63e28a427d88dfc0329151eacaf375fdb6 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Wed, 7 Nov 2012 12:07:52 +0200 Subject: CHUI-450 (Your own name does not appear in nearby chat participant list if voice chat disabled) Added audio module initialization without faking mVoiceEnabled value --- indra/newview/llspeakers.cpp | 2 +- indra/newview/llvoicevivox.cpp | 42 +++++++++++++++++------------------------- indra/newview/llvoicevivox.h | 2 ++ 3 files changed, 20 insertions(+), 26 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 46fd8c1290..726199b7aa 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -504,7 +504,7 @@ void LLSpeakerMgr::update(BOOL resort_ok) void LLSpeakerMgr::updateSpeakerList() { // are we bound to the currently active voice channel? - if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) + if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel)) { std::set participants; LLVoiceClient::getInstance()->getParticipantList(participants); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f236123ef1..839de395a7 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -291,6 +291,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mCaptureDeviceDirty(false), mRenderDeviceDirty(false), mSpatialCoordsDirty(false), + mIsInitialized(false), mMuteMic(false), mMuteMicDirty(false), @@ -394,15 +395,7 @@ const LLVoiceVersionInfo& LLVivoxVoiceClient::getVersion() void LLVivoxVoiceClient::updateSettings() { - if(!mAudioSession) - { - // If audio module is not initialized, pretend that voice is enabled, thus letting state machine to take a full cycle - setVoiceEnabled(true); - } - else - { - setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); - } + setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); setEarLocation(gSavedSettings.getS32("VoiceEarLocation")); std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); @@ -528,7 +521,7 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries) { LLViewerRegion *region = gAgent.getRegion(); - if ( region && mVoiceEnabled ) + if ( region && (mVoiceEnabled || !mIsInitialized)) { std::string url = region->getCapability("ProvisionVoiceAccountRequest"); @@ -699,7 +692,7 @@ void LLVivoxVoiceClient::stateMachine() setVoiceEnabled(false); } - if(mVoiceEnabled) + if(mVoiceEnabled || !mIsInitialized) { updatePosition(); } @@ -744,7 +737,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateDisabled case stateDisabled: - if(mTuningMode || (mVoiceEnabled && !mAccountName.empty())) + if(mTuningMode || ((mVoiceEnabled || !mIsInitialized) && !mAccountName.empty())) { setState(stateStart); } @@ -899,7 +892,7 @@ void LLVivoxVoiceClient::stateMachine() mTuningExitState = stateIdle; setState(stateMicTuningStart); } - else if(!mVoiceEnabled) + else if(!mVoiceEnabled && mIsInitialized) { // We never started up the connector. This will shut down the daemon. setState(stateConnectorStopped); @@ -1093,7 +1086,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStart case stateConnectorStart: - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // We were never logged in. This will shut down the connector. setState(stateLoggedOut); @@ -1111,7 +1104,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStarted case stateConnectorStarted: // connector handle received - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // We were never logged in. This will shut down the connector. setState(stateLoggedOut); @@ -1255,7 +1248,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateCreatingSessionGroup case stateCreatingSessionGroup: - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // *TODO: Question: is this the right way out of this state setState(stateSessionTerminated); @@ -1271,7 +1264,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateRetrievingParcelVoiceInfo case stateRetrievingParcelVoiceInfo: // wait until parcel voice info is received. - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // if a terminate request has been received, // bail and go to the stateSessionTerminated @@ -1291,7 +1284,7 @@ void LLVivoxVoiceClient::stateMachine() // Otherwise, if you log in but don't join a proximal channel (such as when your login location has voice disabled), your friends list won't sync. sendFriendsListUpdates(); - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // TODO: Question: Is this the right way out of this state? setState(stateSessionTerminated); @@ -1372,7 +1365,7 @@ void LLVivoxVoiceClient::stateMachine() } // joinedAudioSession() will transition from here to stateSessionJoined. - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // User bailed out during connect -- jump straight to teardown. setState(stateSessionTerminated); @@ -1419,7 +1412,7 @@ void LLVivoxVoiceClient::stateMachine() notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED); } - else if(!mVoiceEnabled) + else if(!mVoiceEnabled && mIsInitialized) { // User bailed out during connect -- jump straight to teardown. setState(stateSessionTerminated); @@ -1439,7 +1432,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateRunning case stateRunning: // steady state // Disabling voice or disconnect requested. - if(!mVoiceEnabled || mSessionTerminateRequested) + if(!mVoiceEnabled && mIsInitialized || mSessionTerminateRequested) { leaveAudioSession(); } @@ -1487,8 +1480,7 @@ void LLVivoxVoiceClient::stateMachine() sendPositionalUpdate(); } - // Now that audio module is fully initialized, check for actual mVoiceEnabled value - updateSettings(); + mIsInitialized = true; } break; @@ -1522,7 +1514,7 @@ void LLVivoxVoiceClient::stateMachine() // Always reset the terminate request flag when we get here. mSessionTerminateRequested = false; - if(mVoiceEnabled && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) { // Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state). setState(stateNoChannel); @@ -1550,7 +1542,7 @@ void LLVivoxVoiceClient::stateMachine() mAccountHandle.clear(); cleanUp(); - if(mVoiceEnabled && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) { // User was logged out, but wants to be logged in. Send a new login request. setState(stateNeedsLogin); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 1142a1a49c..f2a3a7d3dd 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -741,6 +741,8 @@ private: std::string mRenderDevice; bool mCaptureDeviceDirty; bool mRenderDeviceDirty; + + bool mIsInitialized; bool checkParcelChanged(bool update = false); -- cgit v1.3 From ff1dab1792f8d8ba6681e59978383304e25dabe2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 9 Nov 2012 17:19:03 -0800 Subject: CHUI-450 : Fixed how the list of speakers is updated, always add the agent avatar in it, takes voice activation into account --- indra/newview/llfloaterimcontainer.cpp | 4 ++-- indra/newview/llspeakers.cpp | 26 +++++++++++--------------- 2 files changed, 13 insertions(+), 17 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index b20d19d0fd..2789b78c2d 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1126,7 +1126,7 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool /* widget processing */ if (select_widget) { - LLFolderViewItem* widget = mConversationsWidgets[session_id]; + LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,session_id); if (widget && widget->getParentFolder()) { widget->getParentFolder()->setSelection(widget, FALSE, FALSE); @@ -1539,7 +1539,7 @@ void LLFloaterIMContainer::openNearbyChat() //(which it should be...), open it so to make the list of participants visible. This happens to be the most common case when opening the Chat floater. if(mConversationsItems.size() == 1) { - LLConversationViewSession* nearby_chat = dynamic_cast(mConversationsWidgets[LLUUID()]); + LLConversationViewSession* nearby_chat = dynamic_cast(get_ptr_in_map(mConversationsWidgets,LLUUID())); if (nearby_chat) { nearby_chat->setOpen(TRUE); diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 726199b7aa..5036334bdd 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -503,27 +503,23 @@ void LLSpeakerMgr::update(BOOL resort_ok) void LLSpeakerMgr::updateSpeakerList() { - // are we bound to the currently active voice channel? - if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel)) - { - std::set participants; - LLVoiceClient::getInstance()->getParticipantList(participants); - // add new participants to our list of known speakers - for (std::set::iterator participant_it = participants.begin(); - participant_it != participants.end(); - ++participant_it) + // Are we bound to the currently active voice channel? + if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) + { + std::set participants; + LLVoiceClient::getInstance()->getParticipantList(participants); + // If we are, add all voice client participants to our list of known speakers + for (std::set::iterator participant_it = participants.begin(); participant_it != participants.end(); ++participant_it) { setSpeaker(*participant_it, LLVoiceClient::getInstance()->getDisplayName(*participant_it), LLSpeaker::STATUS_VOICE_ACTIVE, (LLVoiceClient::getInstance()->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL)); - - } } else { - // Check if the list is empty, except if it's Nearby Chat (session_id NULL). + // If not, check if the list is empty, except if it's Nearby Chat (session_id NULL). LLUUID session_id = getSessionID(); if ((mSpeakers.size() == 0) && (!session_id.isNull())) { @@ -533,16 +529,16 @@ void LLSpeakerMgr::updateSpeakerList() LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it) { - // Allow to set buddies if they are on line. Allow any other avatar. + // Add buddies if they are on line, add any other avatar. if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it)) { setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } } - // Also add the current agent - setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } } + // Finally, always add the current agent (it has to be there no matter what...) + setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) -- cgit v1.3 From dbc37f6ca74dba6c6d5194e0397d5cfe6f570c1d Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Thu, 15 Nov 2012 10:38:21 +0200 Subject: CHUI-397 (Delay in removing names from participant list in nearby chat) CHUI-440 (Nearby chat participant list does not clear after teleport when conversation floater is closed/minimized) fixed --- indra/llui/llfolderviewitem.h | 1 + indra/newview/llconversationview.cpp | 14 +++++++++++++- indra/newview/llspeakers.cpp | 8 ++++++++ indra/newview/llspeakers.h | 3 +++ 4 files changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index b157aabdcf..152ca242e1 100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -118,6 +118,7 @@ protected: // For now assuming all colors are the same in derived classes. static LLUIColor sFgColor; + static LLUIColor sFgDisabledColor; static LLUIColor sHighlightBgColor; static LLUIColor sHighlightFgColor; static LLUIColor sFocusOutlineColor; diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 53392ac372..d1649a93b1 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -409,6 +409,7 @@ BOOL LLConversationViewParticipant::postBuild() void LLConversationViewParticipant::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static LLUIColor sFgDisabledColor = LLUIColorTable::instance().getColor("MenuItemDisabledColor", DEFAULT_WHITE); static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); @@ -421,7 +422,18 @@ void LLConversationViewParticipant::draw() F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; F32 text_left = (F32)getLabelXPos(); - LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; + + LLColor4 color; + LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance(); + + if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID)) + { + color = sFgDisabledColor; + } + else + { + color = mIsSelected ? sHighlightFgColor : sFgColor; + } drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); drawLabel(font, text_left, y, color, right_x); diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 5036334bdd..88f29d7587 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -254,6 +254,10 @@ bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_ return true; } +bool LLSpeakersDelayActionsStorage::isTimerStarted(const LLUUID& speaker_id) +{ + return (mActionTimersMap.size() > 0) && (mActionTimersMap.find(speaker_id) != mActionTimersMap.end()); +} // // ModerationResponder @@ -603,6 +607,10 @@ const LLUUID LLSpeakerMgr::getSessionID() return mVoiceChannel->getSessionID(); } +bool LLSpeakerMgr::isSpeakerToBeRemoved(const LLUUID& speaker_id) +{ + return mSpeakerDelayRemover && mSpeakerDelayRemover->isTimerStarted(speaker_id); +} void LLSpeakerMgr::setSpeakerTyping(const LLUUID& speaker_id, BOOL typing) { diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 8ab08661d3..7d518fe07b 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -193,6 +193,8 @@ public: void unsetActionTimer(const LLUUID& speaker_id); void removeAllTimers(); + + bool isTimerStarted(const LLUUID& speaker_id); private: /** * Callback of the each instance of LLSpeakerActionTimer. @@ -237,6 +239,7 @@ public: void getSpeakerList(speaker_list_t* speaker_list, BOOL include_text); LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; } const LLUUID getSessionID(); + bool isSpeakerToBeRemoved(const LLUUID& speaker_id); /** * Removes avaline speaker. -- cgit v1.3 From 6bb1c88db2b329665d547eb86d083a062732a8dd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 23 Jan 2013 10:13:20 -0800 Subject: CHUI-480 : Fixed : Fetch group membership when starting group chat and populate speakers list --- indra/newview/llspeakers.cpp | 51 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 88f29d7587..a90d9111cb 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -31,6 +31,7 @@ #include "llagent.h" #include "llappviewer.h" #include "llimview.h" +#include "llgroupmgr.h" #include "llsdutil.h" #include "lluicolortable.h" #include "llviewerobjectlist.h" @@ -321,7 +322,11 @@ LLSpeakerMgr::~LLSpeakerMgr() LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::string& name, LLSpeaker::ESpeakerStatus status, LLSpeaker::ESpeakerType type) { - if (id.isNull()) return NULL; + LLUUID session_id = getSessionID(); + if (id.isNull() || (id == session_id)) + { + return NULL; + } LLPointer speakerp; if (mSpeakers.find(id) == mSpeakers.end()) @@ -527,22 +532,52 @@ void LLSpeakerMgr::updateSpeakerList() LLUUID session_id = getSessionID(); if ((mSpeakers.size() == 0) && (!session_id.isNull())) { - // If the list is empty, we update it with whatever was used to initiate the call so that it doesn't stay empty too long. + // If the list is empty, we update it with whatever we have locally so that it doesn't stay empty too long. // *TODO: Fix the server side code that sometimes forgets to send back the list of agents after a chat started // (IOW, fix why we get no ChatterBoxSessionAgentListUpdates message after the initial ChatterBoxSessionStartReply) LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); - for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it) + if (session->isGroupSessionType()) + { + // For groups, we need to hit the group manager + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(session_id); + if (!gdatap) + { + // Request the data the first time around + LLGroupMgr::getInstance()->sendCapGroupMembersRequest(session_id); + } + else if (gdatap->isMemberDataComplete() && !gdatap->mMembers.empty()) + { + LLGroupMgrGroupData::member_list_t::iterator member_it = gdatap->mMembers.begin(); + while (member_it != gdatap->mMembers.end()) + { + LLGroupMemberData* member = member_it->second; + // Add only the members who are online + if (member->getOnlineStatus() == "Online") + { + setSpeaker(member_it->first, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + } + ++member_it; + } + // Always add the current agent (it has to be there no matter what...) + setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + } + } + else { - // Add buddies if they are on line, add any other avatar. - if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it)) + // For all other types (ad-hoc, P2P, avaline), we use the initial targets list + for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it) { - setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + // Add buddies if they are on line, add any other avatar. + if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it)) + { + setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + } } + // Always add the current agent (it has to be there no matter what...) + setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } } } - // Finally, always add the current agent (it has to be there no matter what...) - setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) -- cgit v1.3 From 46a74c4e01e19c07b5ee966ebe9882c4209dc89c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 23 Jan 2013 17:45:25 -0800 Subject: CHUI-480 : Fixed : Flagged when local update is made and prevent doing it multiple times, allow group to graw by 1 (me) then the rest (prevent having group remaining hidden). --- indra/newview/llspeakers.cpp | 34 +++++++++++++++++++++------------- indra/newview/llspeakers.h | 1 + 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index a90d9111cb..a2d8874cea 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -306,9 +306,10 @@ private: // LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : - mVoiceChannel(channelp) -, mVoiceModerated(false) -, mModerateModeHandledFirstTime(false) + mVoiceChannel(channelp), + mVoiceModerated(false), + mModerateModeHandledFirstTime(false), + mSpeakerListUpdated(false) { static LLUICachedControl remove_delay ("SpeakerParticipantRemoveDelay", 10.0); @@ -530,15 +531,16 @@ void LLSpeakerMgr::updateSpeakerList() { // If not, check if the list is empty, except if it's Nearby Chat (session_id NULL). LLUUID session_id = getSessionID(); - if ((mSpeakers.size() == 0) && (!session_id.isNull())) + if (!session_id.isNull() && !mSpeakerListUpdated) { // If the list is empty, we update it with whatever we have locally so that it doesn't stay empty too long. - // *TODO: Fix the server side code that sometimes forgets to send back the list of agents after a chat started + // *TODO: Fix the server side code that sometimes forgets to send back the list of participants after a chat started. // (IOW, fix why we get no ChatterBoxSessionAgentListUpdates message after the initial ChatterBoxSessionStartReply) LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); - if (session->isGroupSessionType()) + if (session->isGroupSessionType() && (mSpeakers.size() <= 1)) { - // For groups, we need to hit the group manager + // For groups, we need to hit the group manager. + // Note: The session uuid and the group uuid are actually one and the same. If that was to change, this will fail. LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(session_id); if (!gdatap) { @@ -547,6 +549,7 @@ void LLSpeakerMgr::updateSpeakerList() } else if (gdatap->isMemberDataComplete() && !gdatap->mMembers.empty()) { + // Add group members when we get the complete list (note: can take a while before we get that list) LLGroupMgrGroupData::member_list_t::iterator member_it = gdatap->mMembers.begin(); while (member_it != gdatap->mMembers.end()) { @@ -558,13 +561,12 @@ void LLSpeakerMgr::updateSpeakerList() } ++member_it; } - // Always add the current agent (it has to be there no matter what...) - setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + mSpeakerListUpdated = true; } } - else + else if (mSpeakers.size() == 0) { - // For all other types (ad-hoc, P2P, avaline), we use the initial targets list + // 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) { // Add buddies if they are on line, add any other avatar. @@ -573,11 +575,17 @@ void LLSpeakerMgr::updateSpeakerList() setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } } - // Always add the current agent (it has to be there no matter what...) - setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + mSpeakerListUpdated = true; + } + else + { + // The list has been updated the normal way (i.e. by a ChatterBoxSessionAgentListUpdates received from the server) + mSpeakerListUpdated = true; } } } + // Always add the current agent (it has to be there...). Will do nothing if already there. + setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 7d518fe07b..5f5095097e 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -263,6 +263,7 @@ protected: typedef std::map > speaker_map_t; speaker_map_t mSpeakers; + bool mSpeakerListUpdated; speaker_list_t mSpeakersSorted; LLFrameTimer mSpeechTimer; -- cgit v1.3 From 3ae9124ce555dada3d14ede28a6658cddcfa53b8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 20 Feb 2013 19:06:49 -0800 Subject: CHUI-395 : Fixed! Check the moderator status in the group data when loading the group list --- indra/newview/llspeakers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index a2d8874cea..05df7261e1 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -557,7 +557,8 @@ void LLSpeakerMgr::updateSpeakerList() // Add only the members who are online if (member->getOnlineStatus() == "Online") { - setSpeaker(member_it->first, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + LLPointer speakerp = setSpeaker(member_it->first, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + speakerp->mIsModerator = ((member->getAgentPowers() & GP_SESSION_MODERATOR) == GP_SESSION_MODERATOR); } ++member_it; } -- cgit v1.3 From d29bec7f4d390b932705ac9342f01f0b2412dd97 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 8 Mar 2013 19:04:01 -0800 Subject: CHUI-793 : WIP : Limit the number of participants we load on groups when we load from the local group data --- indra/newview/llspeakers.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 05df7261e1..301b489c34 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -409,12 +409,10 @@ void LLSpeakerMgr::update(BOOL resort_ok) // update status of all current speakers BOOL voice_channel_active = (!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()); - for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end();) + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); speaker_it++) { LLUUID speaker_id = speaker_it->first; LLSpeaker* speakerp = speaker_it->second; - - speaker_map_t::iterator cur_speaker_it = speaker_it++; if (voice_channel_active && LLVoiceClient::getInstance()->getVoiceEnabled(speaker_id)) { @@ -551,18 +549,25 @@ void LLSpeakerMgr::updateSpeakerList() { // Add group members when we get the complete list (note: can take a while before we get that list) LLGroupMgrGroupData::member_list_t::iterator member_it = gdatap->mMembers.begin(); + S32 updated = 0; while (member_it != gdatap->mMembers.end()) { LLGroupMemberData* member = member_it->second; - // Add only the members who are online - if (member->getOnlineStatus() == "Online") + LLUUID id = member_it->first; + // Add only members who are online and not already in the list + if ((member->getOnlineStatus() == "Online") && (mSpeakers.find(id) == mSpeakers.end())) { - LLPointer speakerp = setSpeaker(member_it->first, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); + LLPointer speakerp = setSpeaker(id, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); speakerp->mIsModerator = ((member->getAgentPowers() & GP_SESSION_MODERATOR) == GP_SESSION_MODERATOR); + updated++; } ++member_it; + // Limit the number of "manually updated" participants to a reasonable number to avoid severe fps drop + // *TODO : solve the perf issue of having several hundreds of widgets in the conversation list + if (updated >= 100) + break; } - mSpeakerListUpdated = true; + mSpeakerListUpdated = true; } } else if (mSpeakers.size() == 0) -- cgit v1.3 From ac63601a2aeb05f67d6be87d7ad40495bbc3080b Mon Sep 17 00:00:00 2001 From: merov Date: Mon, 11 Mar 2013 21:32:40 -0700 Subject: CHUI-793 : Fixed! Introduced ChatLoadGroupTimeout and ChatLoadGroupMaxMembers to mitigate slow group loading. --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++ indra/newview/llspeakers.cpp | 11 ++++++++--- indra/newview/llspeakers.h | 1 + 3 files changed, 31 insertions(+), 3 deletions(-) (limited to 'indra/newview/llspeakers.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 79376f7467..e216c7865d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1584,6 +1584,28 @@ Value 0 + ChatLoadGroupMaxMembers + + Comment + Max number of active members we'll show up for an unresponsive group + Persist + 1 + Type + S32 + Value + 100 + + ChatLoadGroupTimeout + + Comment + Time we give the server to send group participants before we hit the server for group info (seconds) + Persist + 1 + Type + F32 + Value + 10.0 + ChatOnlineNotification Comment diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 301b489c34..8783d99b11 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -38,6 +38,8 @@ #include "llvoavatar.h" #include "llworld.h" +extern LLControlGroup gSavedSettings; + const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f); const LLColor4 ACTIVE_COLOR(0.5f, 0.5f, 0.5f, 1.f); @@ -311,6 +313,7 @@ LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : mModerateModeHandledFirstTime(false), mSpeakerListUpdated(false) { + mGetListTime.reset(); static LLUICachedControl remove_delay ("SpeakerParticipantRemoveDelay", 10.0); mSpeakerDelayRemover = new LLSpeakersDelayActionsStorage(boost::bind(&LLSpeakerMgr::removeSpeaker, this, _1), remove_delay); @@ -537,18 +540,20 @@ void LLSpeakerMgr::updateSpeakerList() LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); if (session->isGroupSessionType() && (mSpeakers.size() <= 1)) { + const F32 load_group_timeout = gSavedSettings.getF32("ChatLoadGroupTimeout"); // For groups, we need to hit the group manager. // Note: The session uuid and the group uuid are actually one and the same. If that was to change, this will fail. LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(session_id); - if (!gdatap) + if (!gdatap && (mGetListTime.getElapsedTimeF32() >= load_group_timeout)) { // Request the data the first time around LLGroupMgr::getInstance()->sendCapGroupMembersRequest(session_id); } - else if (gdatap->isMemberDataComplete() && !gdatap->mMembers.empty()) + else if (gdatap && gdatap->isMemberDataComplete() && !gdatap->mMembers.empty()) { // Add group members when we get the complete list (note: can take a while before we get that list) LLGroupMgrGroupData::member_list_t::iterator member_it = gdatap->mMembers.begin(); + const S32 load_group_max_members = gSavedSettings.getS32("ChatLoadGroupMaxMembers"); S32 updated = 0; while (member_it != gdatap->mMembers.end()) { @@ -564,7 +569,7 @@ void LLSpeakerMgr::updateSpeakerList() ++member_it; // Limit the number of "manually updated" participants to a reasonable number to avoid severe fps drop // *TODO : solve the perf issue of having several hundreds of widgets in the conversation list - if (updated >= 100) + if (updated >= load_group_max_members) break; } mSpeakerListUpdated = true; diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 5f5095097e..e953dd0e1a 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -264,6 +264,7 @@ protected: typedef std::map > speaker_map_t; speaker_map_t mSpeakers; bool mSpeakerListUpdated; + LLTimer mGetListTime; speaker_list_t mSpeakersSorted; LLFrameTimer mSpeechTimer; -- cgit v1.3