From bdab40280b64e31b763a99f6c2011e7e91e7d0fa Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Sun, 8 Jul 2007 03:32:27 +0000
Subject: * Added instant message support for the local region. Grid support
forthcoming.
---
OpenSim/Region/ClientStack/ClientView.API.cs | 25 ++++++++++++++++++++++
.../ClientStack/ClientView.ProcessPackets.cs | 14 ++++++++++++
2 files changed, 39 insertions(+)
(limited to 'OpenSim/Region/ClientStack')
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 9e7117f..cefe856 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -40,6 +40,7 @@ namespace OpenSim.Region.ClientStack
{
partial class ClientView
{
+ public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer;
public event RezObject OnRezObject;
public event GenericCall4 OnDeRezObject;
@@ -236,6 +237,30 @@ namespace OpenSim.Region.ClientStack
this.OutPacket(reply);
}
+ ///
+ ///
+ ///
+ /// TODO
+ ///
+ ///
+ public void SendInstantMessage(string message, LLUUID target)
+ {
+ ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
+ msg.AgentData.AgentID = this.AgentID;
+ msg.AgentData.SessionID = this.SessionID;
+
+ msg.MessageBlock.Dialog = 0;
+ msg.MessageBlock.FromGroup = false;
+ msg.MessageBlock.ID = target.Combine(this.AgentID);
+ msg.MessageBlock.Offline = 0;
+ msg.MessageBlock.ParentEstateID = 0;
+ msg.MessageBlock.Position = new LLVector3();
+ msg.MessageBlock.RegionID = new LLUUID();
+ msg.MessageBlock.Timestamp = 0;
+ msg.MessageBlock.ToAgentID = target;
+
+ this.OutPacket(msg);
+ }
///
/// Send the region heightmap to the client
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 0114fb1..def14c7 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -92,6 +92,20 @@ namespace OpenSim.Region.ClientStack
this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
}
break;
+ case PacketType.ImprovedInstantMessage:
+ ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
+
+ string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
+ string IMmessage = Util.FieldToString(msgpack.MessageBlock.Message);
+
+ if (OnInstantMessage != null)
+ {
+ this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
+ msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
+ }
+
+ break;
+
case PacketType.RezObject:
RezObjectPacket rezPacket = (RezObjectPacket)Pack;
AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
--
cgit v1.1