* Ported InstantMessageModule to IClientCore

* See http://opensimulator.org/wiki/OpenSim_0.6_IClientAPI#InstantMessageModule.cs
0.6.1-post-fixes
Adam Frisby 2008-11-08 18:07:33 +00:00
parent 73b85d2e84
commit bec51a9580
1 changed files with 11 additions and 6 deletions

View File

@ -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,