diff options
author | Merov Linden <merov@lindenlab.com> | 2012-10-15 19:44:14 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-10-15 19:44:14 -0700 |
commit | 1557bffb5630158430946abd600218be89e3590e (patch) | |
tree | e392e408fd1c1c8b57c652a7122645d47b5f7520 /indra | |
parent | 5ec3b64a207327515859d5d4feca0dab9974f200 (diff) |
MAINT-1551 : WIP : Added a hack : send an accept invitation message so to trigger the sending of the agent list.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llavataractions.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llspeakers.cpp | 126 | ||||
-rw-r--r-- | indra/newview/llspeakers.h | 2 |
3 files changed, 93 insertions, 39 deletions
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 @@ -257,6 +257,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<LLSDNotationFormatter>(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<LLSpeaker> 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<LLUUID, LLPointer<LLSpeaker> > speaker_map_t; speaker_map_t mSpeakers; |