From bec51a9580bd3cc498adb89f3110d964ee5d3c62 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 8 Nov 2008 18:07:33 +0000 Subject: * Ported InstantMessageModule to IClientCore * See http://opensimulator.org/wiki/OpenSim_0.6_IClientAPI#InstantMessageModule.cs --- .../Avatar/InstantMessage/InstantMessageModule.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index b8fbe2b..a673f7b 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs @@ -35,6 +35,7 @@ using log4net; using Nini.Config; using Nwc.XmlRpc; using OpenSim.Framework; +using OpenSim.Framework.Client; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -74,12 +75,21 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); - scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnClientConnect += OnClientConnect; scene.EventManager.OnGridInstantMessage += OnGridInstantMessage; } } } + void OnClientConnect(IClientCore client) + { + IClientIM clientIM; + if(client.TryGet(out clientIM)) + { + clientIM.OnInstantMessage += OnInstantMessage; + } + } + private void ReadConfig(IConfigSource config) { IConfig cnf = config.Configs["Startup"]; @@ -109,11 +119,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage #endregion - private void OnNewClient(IClientAPI client) - { - client.OnInstantMessage += OnInstantMessage; - } - private void OnInstantMessage(IClientAPI client, UUID fromAgentID, UUID fromAgentSession, UUID toAgentID, UUID imSessionID, uint timestamp, string fromAgentName, -- cgit v1.1