Add an event to process undelivered IMs
parent
7658e30dfc
commit
87822c5d95
|
@ -48,6 +48,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
|||
protected List<Scene> m_Scenes = new List<Scene>();
|
||||
protected Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>();
|
||||
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue