aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar/InstantMessage
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-01 18:18:19 +0000
committerMelanie Thielker2008-11-01 18:18:19 +0000
commit388c053dcb8de3d9b89c99989af1990296cf2001 (patch)
treea1d12cae14606bf30a59532de7d6e996a51f469e /OpenSim/Region/Environment/Modules/Avatar/InstantMessage
parentRevert last checkin. Avatars fall through non-physical prims now. (diff)
downloadopensim-SC-388c053dcb8de3d9b89c99989af1990296cf2001.zip
opensim-SC-388c053dcb8de3d9b89c99989af1990296cf2001.tar.gz
opensim-SC-388c053dcb8de3d9b89c99989af1990296cf2001.tar.bz2
opensim-SC-388c053dcb8de3d9b89c99989af1990296cf2001.tar.xz
Make the IM and friends modules optional. Clean up some code that dealt
with the old Grid Instant Message over OGS1. Refactor the EventManager to be independent of the rigid module structure design imposed by the current implementation. Message routing is now done in the destination module rather than in the event manager. This way, more or less granular solutions are possible without core changes.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/InstantMessage')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
index 2553266..adf1103 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -54,6 +54,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
54 54
55 public void Initialise(Scene scene, IConfigSource config) 55 public void Initialise(Scene scene, IConfigSource config)
56 { 56 {
57 if (config.Configs["Messaging"] != null)
58 {
59 if (config.Configs["Messaging"].GetString(
60 "InstantMessageModule", "InstantMessageModule") !=
61 "InstantMessageModule")
62 return;
63 }
64
57 lock (m_scenes) 65 lock (m_scenes)
58 { 66 {
59 if (m_scenes.Count == 0) 67 if (m_scenes.Count == 0)
@@ -67,7 +75,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
67 { 75 {
68 m_scenes.Add(scene); 76 m_scenes.Add(scene);
69 scene.EventManager.OnNewClient += OnNewClient; 77 scene.EventManager.OnNewClient += OnNewClient;
70 scene.EventManager.OnGridInstantMessageToIMModule += OnGridInstantMessage; 78 scene.EventManager.OnGridInstantMessage += OnGridInstantMessage;
71 } 79 }
72 } 80 }
73 } 81 }
@@ -114,7 +122,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
114 byte[] binaryBucket) 122 byte[] binaryBucket)
115 { 123 {
116 bool dialogHandledElsewhere 124 bool dialogHandledElsewhere
117 = ((dialog == 38) || (dialog == 39) || (dialog == 40) 125 = ( dialog == (byte) InstantMessageDialog.FriendshipOffered
126 || dialog == (byte) InstantMessageDialog.FriendshipAccepted
127 || dialog == (byte) InstantMessageDialog.FriendshipDeclined
118 || dialog == (byte) InstantMessageDialog.InventoryOffered 128 || dialog == (byte) InstantMessageDialog.InventoryOffered
119 || dialog == (byte) InstantMessageDialog.InventoryAccepted 129 || dialog == (byte) InstantMessageDialog.InventoryAccepted
120 || dialog == (byte) InstantMessageDialog.InventoryDeclined 130 || dialog == (byte) InstantMessageDialog.InventoryDeclined
@@ -197,8 +207,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
197 /// 207 ///
198 /// </summary> 208 /// </summary>
199 /// <param name="msg"></param> 209 /// <param name="msg"></param>
200 private void OnGridInstantMessage(GridInstantMessage msg) 210 private void OnGridInstantMessage(GridInstantMessage msg, InstantMessageReceiver which)
201 { 211 {
212 if ((which & InstantMessageReceiver.IMModule) == 0)
213 return;
214
202 // Trigger the above event handler 215 // Trigger the above event handler
203 OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), 216 OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession),
204 new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, 217 new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName,