diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 94a856b84d..f67bb0b304 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -48,6 +48,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected List m_Scenes = new List(); protected Dictionary m_UserRegionMap = new Dictionary(); + public event UndeliveredMessage OnUndeliveredMessage; + public virtual void Initialise(Scene scene, IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; @@ -165,6 +167,18 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } + UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; + + // If this event has handlers, then the IM will be considered + // delivered. This will suppress the error message. + // + if (handlerUndeliveredMessage != null) + { + handlerUndeliveredMessage(im); + result(true); + return; + } + //m_log.DebugFormat("[INSTANT MESSAGE]: Undeliverable"); result(false); return; diff --git a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs index 40c224d4d0..86dc236965 100644 --- a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs @@ -30,9 +30,12 @@ using OpenSim.Framework; namespace OpenSim.Region.Framework.Interfaces { public delegate void MessageResultNotification(bool success); + public delegate void UndeliveredMessage(GridInstantMessage im); public interface IMessageTransferModule { + event UndeliveredMessage OnUndeliveredMessage; + void SendInstantMessage(GridInstantMessage im, MessageResultNotification result); } }