aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-03-17 23:52:30 +0000
committerMelanie Thielker2009-03-17 23:52:30 +0000
commit87822c5d958f4ea10269d6eb646a6288681d4718 (patch)
tree4c8b9b138ecba85aa509230f33e3ee6b601ca129
parent* minor: remove compiler warning (diff)
downloadopensim-SC-87822c5d958f4ea10269d6eb646a6288681d4718.zip
opensim-SC-87822c5d958f4ea10269d6eb646a6288681d4718.tar.gz
opensim-SC-87822c5d958f4ea10269d6eb646a6288681d4718.tar.bz2
opensim-SC-87822c5d958f4ea10269d6eb646a6288681d4718.tar.xz
Add an event to process undelivered IMs
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs14
-rw-r--r--OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs3
2 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 94a856b..f67bb0b 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
48 protected List<Scene> m_Scenes = new List<Scene>(); 48 protected List<Scene> m_Scenes = new List<Scene>();
49 protected Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>(); 49 protected Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>();
50 50
51 public event UndeliveredMessage OnUndeliveredMessage;
52
51 public virtual void Initialise(Scene scene, IConfigSource config) 53 public virtual void Initialise(Scene scene, IConfigSource config)
52 { 54 {
53 IConfig cnf = config.Configs["Messaging"]; 55 IConfig cnf = config.Configs["Messaging"];
@@ -165,6 +167,18 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
165 return; 167 return;
166 } 168 }
167 169
170 UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage;
171
172 // If this event has handlers, then the IM will be considered
173 // delivered. This will suppress the error message.
174 //
175 if (handlerUndeliveredMessage != null)
176 {
177 handlerUndeliveredMessage(im);
178 result(true);
179 return;
180 }
181
168 //m_log.DebugFormat("[INSTANT MESSAGE]: Undeliverable"); 182 //m_log.DebugFormat("[INSTANT MESSAGE]: Undeliverable");
169 result(false); 183 result(false);
170 return; 184 return;
diff --git a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
index 40c224d..86dc236 100644
--- a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
@@ -30,9 +30,12 @@ using OpenSim.Framework;
30namespace OpenSim.Region.Framework.Interfaces 30namespace OpenSim.Region.Framework.Interfaces
31{ 31{
32 public delegate void MessageResultNotification(bool success); 32 public delegate void MessageResultNotification(bool success);
33 public delegate void UndeliveredMessage(GridInstantMessage im);
33 34
34 public interface IMessageTransferModule 35 public interface IMessageTransferModule
35 { 36 {
37 event UndeliveredMessage OnUndeliveredMessage;
38
36 void SendInstantMessage(GridInstantMessage im, MessageResultNotification result); 39 void SendInstantMessage(GridInstantMessage im, MessageResultNotification result);
37 } 40 }
38} 41}