Add an event to process undelivered IMs

0.6.5-rc1
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;

View File

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