From 524a2a9e26794e2ed645d51c089be42633a782df Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 19 Apr 2010 21:25:59 +0100 Subject: [PATCH] Make the "notecard saved" text appear in the saver rather than the notecard owner, if the notecard is saved by a permitted group member This means moving the alert up to a place where the IClientAPI is available. One can also argue that such client messages shouldn't be sent directly from the scene data model --- .../Agent/AssetTransaction/AgentAssetsTransactions.cs | 3 +++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 7 ++++++- .../Framework/Scenes/SceneObjectPartInventory.cs | 10 ---------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 012d58167f..d30e954a10 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -181,7 +181,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction Manager.MyScene.AssetService.Store(asset); if (part.Inventory.UpdateInventoryItem(item)) + { + remoteClient.SendAgentAlertMessage("Notecard saved", false); part.GetProperties(remoteClient); + } } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7661068605..144de434ca 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -201,7 +201,9 @@ namespace OpenSim.Region.Framework.Scenes // Update item with new asset item.AssetID = asset.FullID; - group.UpdateInventoryItem(item); + if (group.UpdateInventoryItem(item)) + remoteClient.SendAgentAlertMessage("Notecard saved", false); + part.GetProperties(remoteClient); // Trigger rerunning of script (use TriggerRezScript event, see RezScript) @@ -1224,7 +1226,10 @@ namespace OpenSim.Region.Framework.Scenes remoteClient, part, transactionID, currentItem); } if (part.Inventory.UpdateInventoryItem(itemInfo)) + { + remoteClient.SendAgentAlertMessage("Notecard saved", false); part.GetProperties(remoteClient); + } } } else diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 2e13f90b66..4b9a2ad3af 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -630,16 +630,6 @@ namespace OpenSim.Region.Framework.Scenes { item.AssetID = m_items[item.ItemID].AssetID; } - else if ((InventoryType)item.Type == InventoryType.Notecard) - { - ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); - - if (presence != null) - { - presence.ControllingClient.SendAgentAlertMessage( - "Notecard saved", false); - } - } m_items[item.ItemID] = item; m_inventorySerial++;