From 68978e6e2acd6736b689669dae8de09af5acde07 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Fri, 23 Jan 2009 01:49:32 +0000 Subject: add event queue code for sending group IM for future group support --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 8257508..7b80f45 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -35,6 +35,7 @@ using System.Timers; using System.Xml; using OpenMetaverse; using OpenMetaverse.Packets; +using OpenMetaverse.StructuredData; using log4net; using OpenSim.Framework; using OpenSim.Framework.Client; @@ -1182,6 +1183,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP string fromName, byte dialog, uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket) { + if (((Scene)(m_scene)).Permissions.CanInstantMessage(fromAgent, toAgent)) { ImprovedInstantMessagePacket msg @@ -1205,8 +1207,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP msg.MessageBlock.Message = Utils.StringToBytes(message); msg.MessageBlock.BinaryBucket = binaryBucket; - //System.Console.WriteLine("SendInstantMessage: " + msg); - OutPacket(msg, ThrottleOutPacketType.Task); + if (message.StartsWith("[grouptest]")) + { // this block is test code for implementing group IM - delete when group IM is finished + IEventQueue eq = Scene.RequestModuleInterface(); + if (eq != null) + { + dialog = 17; + + //OSD Item = Environment.EventQueueHelper.ChatterboxInvitation( + // new UUID("00000000-68f9-1111-024e-222222111123"), + // "Test Group", fromAgent, message, toAgent, fromName, dialog, 0, + // false, 0, new Vector3(), 1, transactionID, fromGroup, + // Utils.StringToBytes("Test Group")); + + OSD Item = Environment.EventQueueHelper.ChatterboxInvitation( + new UUID("00000000-68f9-1111-024e-222222111123"), + "Test Group", fromAgent, message, toAgent, fromName, dialog, 0, + false, 0, new Vector3(), 1, transactionID, fromGroup, binaryBucket); + + eq.Enqueue(Item, toAgent); + m_log.Info("########### eq chatterbox invitation #############\n" + Item); + } + + System.Console.WriteLine("SendInstantMessage: " + msg); + } + else + OutPacket(msg, ThrottleOutPacketType.Task); } } -- cgit v1.1