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
slimupdates
Justin Clark-Casey (justincc) 2010-04-19 21:25:59 +01:00
parent da83ee28be
commit 524a2a9e26
3 changed files with 9 additions and 11 deletions

View File

@ -181,10 +181,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
Manager.MyScene.AssetService.Store(asset); Manager.MyScene.AssetService.Store(asset);
if (part.Inventory.UpdateInventoryItem(item)) if (part.Inventory.UpdateInventoryItem(item))
{
remoteClient.SendAgentAlertMessage("Notecard saved", false);
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
} }
} }
} }
}
public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,

View File

@ -201,7 +201,9 @@ namespace OpenSim.Region.Framework.Scenes
// Update item with new asset // Update item with new asset
item.AssetID = asset.FullID; item.AssetID = asset.FullID;
group.UpdateInventoryItem(item); if (group.UpdateInventoryItem(item))
remoteClient.SendAgentAlertMessage("Notecard saved", false);
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
// Trigger rerunning of script (use TriggerRezScript event, see RezScript) // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
@ -1224,9 +1226,12 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient, part, transactionID, currentItem); remoteClient, part, transactionID, currentItem);
} }
if (part.Inventory.UpdateInventoryItem(itemInfo)) if (part.Inventory.UpdateInventoryItem(itemInfo))
{
remoteClient.SendAgentAlertMessage("Notecard saved", false);
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
} }
} }
}
else else
{ {
m_log.WarnFormat( m_log.WarnFormat(

View File

@ -630,16 +630,6 @@ namespace OpenSim.Region.Framework.Scenes
{ {
item.AssetID = m_items[item.ItemID].AssetID; 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_items[item.ItemID] = item;
m_inventorySerial++; m_inventorySerial++;