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/llspeakers.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llspeakers.cpp') 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)); } -- cgit v1.2.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/llspeakers.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llspeakers.cpp') 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.2.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/llspeakers.cpp | 126 ++++++++++++++++++++++++++++++------------- 1 file changed, 89 insertions(+), 37 deletions(-) (limited to 'indra/newview/llspeakers.cpp') 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); -- cgit v1.2.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/llspeakers.cpp | 52 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 10 deletions(-) (limited to 'indra/newview/llspeakers.cpp') 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) -- cgit v1.2.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/llspeakers.cpp | 92 +++++++------------------------------------- 1 file changed, 14 insertions(+), 78 deletions(-) (limited to 'indra/newview/llspeakers.cpp') 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)); } -- cgit v1.2.3