Add an event to process undelivered IMs

This commit is contained in:
Melanie Thielker
2009-03-17 23:52:30 +00:00
parent 7658e30dfc
commit 87822c5d95
2 changed files with 17 additions and 0 deletions

View File

@@ -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;