From 9de8cefee55a23149b09d55339736bb324856ad9 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 21 Jun 2016 00:21:08 +0200 Subject: [PATCH 1/3] Split IM handling so an inheriting module can cange names if required. --- .../Avatar/InstantMessage/InstantMessageModule.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index fb868be6ed..2ba35df092 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -154,6 +154,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage #endregion + public virtual void OnViewerInstantMessage(IClientAPI client, GridInstantMessage im) + { + im.fromAgentName = client.FirstName + " " + client.LastName; + OnInstantMessage(client, im); + } + public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) { byte dialog = im.dialog; @@ -198,8 +204,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage if (m_TransferModule != null) { - if (client != null) - im.fromAgentName = client.FirstName + " " + client.LastName; m_TransferModule.SendInstantMessage(im, delegate(bool success) { From 8e40bb6fb7d0d25b1c2f808bb326db858da2bb65 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 21 Jun 2016 01:46:38 +0200 Subject: [PATCH 2/3] Make some more modules inheritable --- .../GetDisplayNames/GetDisplayNamesHandler.cs | 6 ++--- .../Linden/Caps/GetDisplayNamesModule.cs | 26 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs index f7f9da9aec..66659474f4 100644 --- a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs @@ -55,9 +55,9 @@ namespace OpenSim.Capabilities.Handlers { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private IUserManagement m_UserManagement; + protected IUserManagement m_UserManagement; - public GetDisplayNamesHandler(string path, IUserManagement umService, string name, string description) + public virtual GetDisplayNamesHandler(string path, IUserManagement umService, string name, string description) : base("GET", path, name, description) { m_UserManagement = umService; @@ -120,4 +120,4 @@ namespace OpenSim.Capabilities.Handlers } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs index 6617bbcb37..eabacb42dd 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs @@ -57,16 +57,16 @@ namespace OpenSim.Region.ClientStack.Linden private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Scene m_scene; - private IUserManagement m_UserManager; + protected Scene m_scene; + protected IUserManagement m_UserManager; - private bool m_Enabled = false; + protected bool m_Enabled = false; - private string m_URL; + protected string m_URL; #region ISharedRegionModule Members - public void Initialise(IConfigSource source) + public virtual void Initialise(IConfigSource source) { IConfig config = source.Configs["ClientStack.LindenCaps"]; if (config == null) @@ -77,7 +77,7 @@ namespace OpenSim.Region.ClientStack.Linden m_Enabled = true; } - public void AddRegion(Scene s) + public virtual void AddRegion(Scene s) { if (!m_Enabled) return; @@ -85,7 +85,7 @@ namespace OpenSim.Region.ClientStack.Linden m_scene = s; } - public void RemoveRegion(Scene s) + public virtual void RemoveRegion(Scene s) { if (!m_Enabled) return; @@ -94,7 +94,7 @@ namespace OpenSim.Region.ClientStack.Linden m_scene = null; } - public void RegionLoaded(Scene s) + public virtual void RegionLoaded(Scene s) { if (!m_Enabled) return; @@ -103,22 +103,22 @@ namespace OpenSim.Region.ClientStack.Linden m_scene.EventManager.OnRegisterCaps += RegisterCaps; } - public void PostInitialise() + public virtual void PostInitialise() { } - public void Close() { } + public virtual void Close() { } - public string Name { get { return "GetDisplayNamesModule"; } } + public virtual string Name { get { return "GetDisplayNamesModule"; } } - public Type ReplaceableInterface + public virtual Type ReplaceableInterface { get { return null; } } #endregion - public void RegisterCaps(UUID agentID, Caps caps) + public virtual void RegisterCaps(UUID agentID, Caps caps) { UUID capID = UUID.Random(); From 5c81e03738a3619296a56d2b7408f288c1359317 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 21 Jun 2016 01:49:47 +0200 Subject: [PATCH 3/3] Fix a dumb mistake --- .../Handlers/GetDisplayNames/GetDisplayNamesHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs index 66659474f4..155196c5b6 100644 --- a/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetDisplayNames/GetDisplayNamesHandler.cs @@ -57,7 +57,7 @@ namespace OpenSim.Capabilities.Handlers LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected IUserManagement m_UserManagement; - public virtual GetDisplayNamesHandler(string path, IUserManagement umService, string name, string description) + public GetDisplayNamesHandler(string path, IUserManagement umService, string name, string description) : base("GET", path, name, description) { m_UserManagement = umService;