* Ported InstantMessageModule to IClientCore
* See http://opensimulator.org/wiki/OpenSim_0.6_IClientAPI#InstantMessageModule.cs0.6.1-post-fixes
parent
73b85d2e84
commit
bec51a9580
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue