From e6059a7ca1637fccaf4380b5ee15cd37420cc6f1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 22 Mar 2022 03:09:34 +0000 Subject: [PATCH] add some headers to llemail emails; cosmetics --- OpenSim/Framework/WearableCacheItem.cs | 12 ++--- .../Avatar/Chat/Tests/ChatModuleTests.cs | 50 +++++++++++++------ .../InstantMessage/HGMessageTransferModule.cs | 4 +- .../Scripting/EMailModules/EmailModule.cs | 2 + 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/OpenSim/Framework/WearableCacheItem.cs b/OpenSim/Framework/WearableCacheItem.cs index f832ff9e43..70ed3dc857 100644 --- a/OpenSim/Framework/WearableCacheItem.cs +++ b/OpenSim/Framework/WearableCacheItem.cs @@ -35,10 +35,10 @@ namespace OpenSim.Framework [Serializable] public class WearableCacheItem { - public uint TextureIndex { get; set; } - public UUID CacheId { get; set; } - public UUID TextureID { get; set; } - public AssetBase TextureAsset { get; set; } + public uint TextureIndex; + public UUID CacheId; + public UUID TextureID; + public AssetBase TextureAsset; public static WearableCacheItem[] GetDefaultCacheItem() @@ -186,7 +186,7 @@ namespace OpenSim.Framework { for (int i = 0; i < pcacheItems.Length; i++) { - if (pcacheItems[i].CacheId == pCacheId) + if (pcacheItems[i].CacheId.Equals(pCacheId)) return pcacheItems[i]; } return null; @@ -195,7 +195,7 @@ namespace OpenSim.Framework { for (int i = 0; i < pcacheItems.Length; i++) { - if (pcacheItems[i].TextureID == pTextureId) + if (pcacheItems[i].TextureID.Equals(pTextureId)) return pcacheItems[i]; } return null; diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs index eb4a50977f..d915b3b103 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs @@ -142,12 +142,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // We must update the scenes in order to make the root new root agents trigger position updates in their // children. - sceneWest.Update(4); - sceneEast.Update(4); + for (int i = 0; i < 6; ++i) + { + sceneWest.Update(1); + sceneEast.Update(1); + } sp1.DrawDistance += 64; sp2.DrawDistance += 64; - sceneWest.Update(2); - sceneEast.Update(2); + for (int i = 0; i < 6; ++i) + { + sceneWest.Update(1); + sceneEast.Update(1); + } // Check child positions are correct. Assert.AreEqual( @@ -171,11 +177,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests sp1Position = new Vector3(30, 128, 20); sp1.AbsolutePosition = sp1Position; - sceneWest.Update(1); - sceneEast.Update(1); + for (int i = 0; i < 2; ++i) + { + sceneWest.Update(1); + sceneEast.Update(1); + } Thread.Sleep(12000); // child updates are now time limited - sceneWest.Update(5); - sceneEast.Update(5); + for (int i = 0; i < 6; ++i) + { + sceneWest.Update(1); + sceneEast.Update(1); + } // Check child position is correct. Assert.AreEqual( @@ -237,12 +249,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // We must update the scenes in order to make the root new root agents trigger position updates in their // children. - sceneNorth.Update(4); - sceneSouth.Update(4); + for (int i = 0; i < 6; ++i) + { + sceneNorth.Update(1); + sceneSouth.Update(1); + } sp1.DrawDistance += 64; sp2.DrawDistance += 64; - sceneNorth.Update(4); - sceneSouth.Update(4); + for (int i = 0; i < 6; ++i) + { + sceneNorth.Update(1); + sceneSouth.Update(1); + } // Check child positions are correct. Assert.AreEqual( @@ -266,11 +284,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests sp1Position = new Vector3(30, 128, 20); sp1.AbsolutePosition = sp1Position; - sceneNorth.Update(1); - sceneSouth.Update(1); + sceneNorth.Update(6); + sceneSouth.Update(6); Thread.Sleep(12000); // child updates are now time limited - sceneNorth.Update(5); - sceneSouth.Update(5); + sceneNorth.Update(6); + sceneSouth.Update(6); // Check child position is correct. Assert.AreEqual( diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index eff92a8f05..b188b747ca 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs @@ -190,8 +190,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage //m_log.DebugFormat("[HG MESSAGE TRANSFER]: Got UUI {0}", recipientUUI); if (recipientUUI.Length > 0) { - if (Util.ParseUniversalUserIdentifier(recipientUUI, out UUID id, out string tourl, - out string first, out string last, out string secret)) + if (Util.ParseFullUniversalUserIdentifier(recipientUUI, out UUID id, out string tourl, + out string first, out string last) && !string.IsNullOrEmpty(tourl)) { success = m_IMService.OutgoingInstantMessage(im, tourl, true); if (success) diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index ab5690e473..df61bdeb32 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -484,6 +484,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules } mmsg.To.Add(mailTo); + mmsg.Headers["X-Owner-ID"] = ownerID.ToString(); + mmsg.Headers["X-Task-ID"] = objectIDstr; mmsg.Body = new TextPart("plain") { Text = "Object-Name: " + LastObjectName + "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " +