From bdf9add8d1191b08bdaa9706484ac5da1f91af52 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 9 Nov 2008 01:16:42 +0000 Subject: [PATCH] Reintroduce transactionID to the parameter list for SendInstantMessage. It is required by group IM and also for a proper implementation of item give, group notice attachments and offline IM. --- OpenSim/Framework/Client/IClientIM.cs | 4 +++- OpenSim/Framework/IClientAPI.cs | 4 ++-- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 12 +++++++++--- .../Avatar/InstantMessage/InstantMessageModule.cs | 4 ++-- .../Inventory/Transfer/InventoryTransferModule.cs | 6 +++--- .../Environment/Modules/World/NPC/NPCAvatar.cs | 2 +- .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 2 +- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/Client/IClientIM.cs b/OpenSim/Framework/Client/IClientIM.cs index a3498c2497..1d55d10146 100644 --- a/OpenSim/Framework/Client/IClientIM.cs +++ b/OpenSim/Framework/Client/IClientIM.cs @@ -39,7 +39,9 @@ namespace OpenSim.Framework.Client void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, - bool fromGroup, byte[] binaryBucket); + UUID transactionID, bool fromGroup, + byte[] binaryBucket); + event ImprovedInstantMessage OnInstantMessage; } } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 061676e27a..7a3931fb41 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -741,7 +741,7 @@ namespace OpenSim.Framework uint timeStamp); void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, - uint timeStamp, bool fromGroup, byte[] binaryBucket); + uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket); void SendGenericMessage(string method, List message); @@ -1027,4 +1027,4 @@ namespace OpenSim.Framework void KillEndDone(); } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index bb6e62db2e..3a9c17e055 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1067,15 +1067,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp) { - SendInstantMessage(fromAgent, message, toAgent, fromName, dialog, timeStamp, false, new byte[0]); + SendInstantMessage(fromAgent, message, toAgent, fromName, dialog, timeStamp, UUID.Zero, false, new byte[0]); } /// /// Send an instant message to this client /// + // + // Don't remove transaction ID! Groups and item gives need to set it! + // public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, - bool fromGroup, byte[] binaryBucket) + UUID transactionID, bool fromGroup, byte[] binaryBucket) { if (((Scene)(m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent)) { @@ -1087,7 +1090,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP msg.MessageBlock.FromAgentName = Utils.StringToBytes(fromName); msg.MessageBlock.Dialog = dialog; msg.MessageBlock.FromGroup = fromGroup; - msg.MessageBlock.ID = fromAgent ^ toAgent; + if (transactionID == UUID.Zero) + msg.MessageBlock.ID = fromAgent ^ toAgent; + else + msg.MessageBlock.ID = transactionID; msg.MessageBlock.Offline = 0; msg.MessageBlock.ParentEstateID = 0; msg.MessageBlock.Position = new Vector3(); diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index a673f7bc66..eb82ad73b1 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage { user.ControllingClient.SendInstantMessage(fromAgentID, message, toAgentID, fromAgentName, dialog, - timestamp, fromGroup, binaryBucket); + timestamp, UUID.Zero, fromGroup, binaryBucket); // Message sent return; } @@ -179,7 +179,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage user.ControllingClient.SendInstantMessage(fromAgentID, message, toAgentID, fromAgentName, dialog, - timestamp, fromGroup, binaryBucket); + timestamp, UUID.Zero, fromGroup, binaryBucket); // Message sent return; } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index d8b203fa00..b134591ace 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer user.ControllingClient.SendInstantMessage( fromAgentID, message, toAgentID, fromAgentName, - dialog, timestamp, false, binaryBucket); + dialog, timestamp, UUID.Zero, false, binaryBucket); return; } @@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer { user.ControllingClient.SendInstantMessage( fromAgentID, message, toAgentID, fromAgentName, - dialog, timestamp, false, binaryBucket); + dialog, timestamp, UUID.Zero, false, binaryBucket); if (m_pendingOffers.ContainsKey(imSessionID)) { @@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer { user.ControllingClient.SendInstantMessage( fromAgentID, message, toAgentID, fromAgentName, - dialog, timestamp, false, binaryBucket); + dialog, timestamp, UUID.Zero, false, binaryBucket); if (m_pendingOffers.ContainsKey(imSessionID)) { diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 155a01b663..cf8ba94f7b 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -476,7 +476,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC } - public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, bool fromGroup, byte[] binaryBucket) + public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, UUID transationID, bool fromGroup, byte[] binaryBucket) { } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 85d51e6fcf..789d24b3fc 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -388,7 +388,7 @@ namespace OpenSim.Region.Examples.SimpleModule } - public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, bool fromGroup, byte[] binaryBucket) + public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket) { }