Fix bug where outfit folders could not be renamed.

Outfit folders are a type of system folder whose details are allowed to change.
0.7.3-extended
Justin Clark-Casey (justincc) 2012-05-21 19:38:43 +01:00
parent 96b964f7fa
commit ba909cb692
1 changed files with 16 additions and 2 deletions

View File

@ -317,22 +317,36 @@ namespace OpenSim.Services.InventoryService
public virtual bool UpdateFolder(InventoryFolderBase folder) public virtual bool UpdateFolder(InventoryFolderBase folder)
{ {
// m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID);
XInventoryFolder xFolder = ConvertFromOpenSim(folder); XInventoryFolder xFolder = ConvertFromOpenSim(folder);
InventoryFolderBase check = GetFolder(folder); InventoryFolderBase check = GetFolder(folder);
if (check == null) if (check == null)
return AddFolder(folder); return AddFolder(folder);
if (check.Type != -1 || xFolder.type != -1) if ((check.Type != (short)AssetType.Unknown || xFolder.type != (short)AssetType.Unknown)
&& (check.Type != (short)AssetType.OutfitFolder || xFolder.type != (short)AssetType.OutfitFolder))
{ {
if (xFolder.version > check.Version) if (xFolder.version < check.Version)
{
// m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version);
return false; return false;
}
check.Version = (ushort)xFolder.version; check.Version = (ushort)xFolder.version;
xFolder = ConvertFromOpenSim(check); xFolder = ConvertFromOpenSim(check);
// m_log.DebugFormat(
// "[XINVENTORY]: Storing version only update to system folder {0} {1} {2}",
// xFolder.folderName, xFolder.version, xFolder.type);
return m_Database.StoreFolder(xFolder); return m_Database.StoreFolder(xFolder);
} }
if (xFolder.version < check.Version) if (xFolder.version < check.Version)
xFolder.version = check.Version; xFolder.version = check.Version;
xFolder.folderID = check.ID; xFolder.folderID = check.ID;
return m_Database.StoreFolder(xFolder); return m_Database.StoreFolder(xFolder);