From 6f9c1e3bcc5b3d6f0a3b87c76048b619453ceae4 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 2 Feb 2009 17:22:20 +0000 Subject: [PATCH] * Stop the instant message module from trying to register for the message transfer module in PostInitialise() if it hasn't actually been enabled --- .../Avatar/InstantMessage/InstantMessageModule.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index 88c0680fcd..747469bd79 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs @@ -44,14 +44,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage { public class InstantMessageModule : IRegionModule { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Is this module enabled? + /// + private bool m_enabled = false; + private readonly List m_scenes = new List(); #region IRegionModule Members - //private bool gridmode = false; - private IMessageTransferModule m_TransferModule = null; public void Initialise(Scene scene, IConfigSource config) @@ -63,6 +66,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage "InstantMessageModule") return; } + + m_enabled = true; lock (m_scenes) { @@ -86,6 +91,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage public void PostInitialise() { + if (!m_enabled) + return; + m_TransferModule = m_scenes[0].RequestModuleInterface();