From 20a77a6d4b05ee15b7b04a81920d19462e6e542a Mon Sep 17 00:00:00 2001
From: MW
Date: Thu, 12 Jul 2007 15:16:19 +0000
Subject: Fixed a number of bugs in the local InstantMessage handling, sending
InstantMessages will no longer crash the server. But they still aren't really
working correctly, you can't type replies to received messages.
---
OpenSim/Region/ClientStack/ClientView.API.cs | 38 +++++++++++++---------
.../ClientStack/ClientView.ProcessPackets.cs | 2 --
2 files changed, 22 insertions(+), 18 deletions(-)
(limited to 'OpenSim/Region/ClientStack')
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index e88995f..5be82dd 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -245,23 +245,29 @@ namespace OpenSim.Region.ClientStack
/// TODO
///
///
- public void SendInstantMessage(string message, LLUUID target)
+ public void SendInstantMessage(string message, LLUUID target, string fromName)
{
- 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);
+ if (message != "typing")
+ {
+ Encoding enc = Encoding.ASCII;
+ ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
+ msg.AgentData.AgentID = this.AgentID;
+ msg.AgentData.SessionID = this.SessionID;
+ msg.MessageBlock.FromAgentName = enc.GetBytes(fromName + " \0");
+ msg.MessageBlock.Dialog = 0;
+ msg.MessageBlock.FromGroup = false;
+ msg.MessageBlock.ID = target.Combine(this.SecureSessionID);
+ 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;
+ msg.MessageBlock.Message = enc.GetBytes(message + "\0");
+ msg.MessageBlock.BinaryBucket = new byte[0];
+
+ this.OutPacket(msg);
+ }
}
///
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 3265898..e5249f9 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -102,9 +102,7 @@ namespace OpenSim.Region.ClientStack
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