diff options
author | MW | 2009-02-19 11:54:53 +0000 |
---|---|---|
committer | MW | 2009-02-19 11:54:53 +0000 |
commit | 1b65020b414bca9120fe87998769b5e138c435cd (patch) | |
tree | 01ca7aa57f4362b7c63cd6a8c9e3a4ad76cc4979 /OpenSim/Region/CoreModules | |
parent | Force plugin state update when region crossing (diff) | |
download | opensim-SC_OLD-1b65020b414bca9120fe87998769b5e138c435cd.zip opensim-SC_OLD-1b65020b414bca9120fe87998769b5e138c435cd.tar.gz opensim-SC_OLD-1b65020b414bca9120fe87998769b5e138c435cd.tar.bz2 opensim-SC_OLD-1b65020b414bca9120fe87998769b5e138c435cd.tar.xz |
Added a event to IMessageTransferModule (and MessageTransferModule) so that other modules can capture IM messages and do custom handling of them. As just attaching to Client IM events doesn't really support this, as they would still get routed through the normal process and could give back errors.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 38d2d21..b8e0c29 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -48,6 +48,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
48 | private List<Scene> m_Scenes = new List<Scene>(); | 48 | private List<Scene> m_Scenes = new List<Scene>(); |
49 | private Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>(); | 49 | private Dictionary<UUID, ulong> m_UserRegionMap = new Dictionary<UUID, ulong>(); |
50 | 50 | ||
51 | public event ExternalHandleIM OnExternalIMCapture; | ||
52 | |||
53 | private ExternalHandleIM handlerExternalIMCapture; | ||
54 | |||
51 | public void Initialise(Scene scene, IConfigSource config) | 55 | public void Initialise(Scene scene, IConfigSource config) |
52 | { | 56 | { |
53 | IConfig cnf = config.Configs["Messaging"]; | 57 | IConfig cnf = config.Configs["Messaging"]; |
@@ -95,6 +99,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
95 | 99 | ||
96 | public void SendInstantMessage(GridInstantMessage im, MessageResultNotification result) | 100 | public void SendInstantMessage(GridInstantMessage im, MessageResultNotification result) |
97 | { | 101 | { |
102 | handlerExternalIMCapture = OnExternalIMCapture; | ||
103 | if (handlerExternalIMCapture != null) | ||
104 | { | ||
105 | if (handlerExternalIMCapture(im)) | ||
106 | { | ||
107 | result(true); | ||
108 | return; | ||
109 | } | ||
110 | } | ||
111 | |||
98 | UUID toAgentID = new UUID(im.toAgentID); | 112 | UUID toAgentID = new UUID(im.toAgentID); |
99 | 113 | ||
100 | m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString()); | 114 | m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString()); |