From c34f07b6f3e4bd27412d248382ff6c6945330917 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 20 Jan 2018 01:28:00 +0000 Subject: silent ignore mutes on HG visitors, let viewers do it on cache only, proper HG suport is another story... and questionable --- .../Avatar/InstantMessage/MuteListModule.cs | 20 ++++++++++++++++---- bin/Robust.HG.ini.example | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index d3c7751..9cbfd4a 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected bool m_Enabled = false; protected List m_SceneList = new List(); protected IMuteListService m_service = null; + private IUserManagement m_userManagementModule; public void Initialise(IConfigSource config) { @@ -89,10 +90,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_Enabled = false; return; } + lock (m_SceneList) { if(m_service == null) m_service = srv; + if(m_userManagementModule == null) + m_userManagementModule = scene.RequestModuleInterface(); m_SceneList.Add(scene); scene.EventManager.OnNewClient += OnNewClient; } @@ -131,7 +135,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void Close() { } - + + private bool IsForeign(IClientAPI client) + { + if(m_userManagementModule == null) + return false; // we can't check + + return !m_userManagementModule.IsLocalGridUser(client.AgentId); + } + private void OnNewClient(IClientAPI client) { client.OnMuteListRequest += OnMuteListRequest; @@ -141,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void OnMuteListRequest(IClientAPI client, uint crc) { - if (!m_Enabled) + if (!m_Enabled || IsForeign(client)) { if(crc == 0) client.SendEmpytMuteList(); @@ -192,7 +204,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void OnUpdateMuteListEntry(IClientAPI client, UUID muteID, string muteName, int muteType, uint muteFlags) { - if (!m_Enabled) + if (!m_Enabled || IsForeign(client)) return; UUID agentID = client.AgentId; @@ -220,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void OnRemoveMuteListEntry(IClientAPI client, UUID muteID, string muteName) { - if (!m_Enabled) + if (!m_Enabled || IsForeign(client)) return; m_service.RemoveMute(client.AgentId, muteID, muteName); } diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 82bed30..a327c6b 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -522,7 +522,7 @@ ; If you run this login server behind a proxy, set this to true ; HasProxy = false - + ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs) ;; If you have GatekeeperURI set under [Hypergrid], no need to set it here, leave it commented ; GatekeeperURI = "${Const|BaseURL}:${Const|PublicPort}" -- cgit v1.1