aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/InstantMessageModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/InstantMessageModule.cs30
1 files changed, 16 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
index 9ac1d76..2ad027a 100644
--- a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
@@ -27,11 +27,12 @@
27*/ 27*/
28 28
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife;
31using Nini.Config;
32using OpenSim.Framework;
33using OpenSim.Framework.Console;
30using OpenSim.Region.Environment.Interfaces; 34using OpenSim.Region.Environment.Interfaces;
31using OpenSim.Region.Environment.Scenes; 35using OpenSim.Region.Environment.Scenes;
32using OpenSim.Framework.Console;
33using OpenSim.Framework;
34using Nini.Config;
35 36
36namespace OpenSim.Region.Environment.Modules 37namespace OpenSim.Region.Environment.Modules
37{ 38{
@@ -42,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules
42 43
43 public InstantMessageModule() 44 public InstantMessageModule()
44 { 45 {
45 m_log = OpenSim.Framework.Console.MainLog.Instance; 46 m_log = MainLog.Instance;
46 } 47 }
47 48
48 public void Initialise(Scene scene, IConfigSource config) 49 public void Initialise(Scene scene, IConfigSource config)
@@ -50,33 +51,34 @@ namespace OpenSim.Region.Environment.Modules
50 if (!m_scenes.Contains(scene)) 51 if (!m_scenes.Contains(scene))
51 { 52 {
52 m_scenes.Add(scene); 53 m_scenes.Add(scene);
53 scene.EventManager.OnNewClient += OnNewClient; 54 scene.EventManager.OnNewClient += OnNewClient;
54 } 55 }
55 } 56 }
56 57
57 void OnNewClient(OpenSim.Framework.IClientAPI client) 58 private void OnNewClient(IClientAPI client)
58 { 59 {
59 client.OnInstantMessage += OnInstantMessage; 60 client.OnInstantMessage += OnInstantMessage;
60 } 61 }
61 62
62 void OnInstantMessage(libsecondlife.LLUUID fromAgentID, 63 private void OnInstantMessage(LLUUID fromAgentID,
63 libsecondlife.LLUUID fromAgentSession, libsecondlife.LLUUID toAgentID, 64 LLUUID fromAgentSession, LLUUID toAgentID,
64 libsecondlife.LLUUID imSessionID, uint timestamp, string fromAgentName, 65 LLUUID imSessionID, uint timestamp, string fromAgentName,
65 string message, byte dialog) 66 string message, byte dialog)
66 { 67 {
67 // TODO: Remove after debugging. Privacy implications. 68 // TODO: Remove after debugging. Privacy implications.
68 m_log.Verbose("IM",fromAgentName + ": " + message); 69 m_log.Verbose("IM", fromAgentName + ": " + message);
69 70
70 foreach (Scene m_scene in m_scenes) 71 foreach (Scene m_scene in m_scenes)
71 { 72 {
72 if (m_scene.Entities.ContainsKey(toAgentID) && m_scene.Entities[toAgentID] is ScenePresence) 73 if (m_scene.Entities.ContainsKey(toAgentID) && m_scene.Entities[toAgentID] is ScenePresence)
73 { 74 {
74 // Local Message 75 // Local Message
75 ScenePresence user = (ScenePresence)m_scene.Entities[toAgentID]; 76 ScenePresence user = (ScenePresence) m_scene.Entities[toAgentID];
76 if (!user.IsChildAgent) 77 if (!user.IsChildAgent)
77 { 78 {
78 user.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, 79 user.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message,
79 toAgentID, imSessionID, fromAgentName, dialog, timestamp); 80 toAgentID, imSessionID, fromAgentName, dialog,
81 timestamp);
80 } 82 }
81 // Message sent 83 // Message sent
82 return; 84 return;
@@ -104,4 +106,4 @@ namespace OpenSim.Region.Environment.Modules
104 get { return true; } 106 get { return true; }
105 } 107 }
106 } 108 }
107} 109} \ No newline at end of file