diff options
author | Kitto Flora | 2010-09-06 21:45:17 +0000 |
---|---|---|
committer | Kitto Flora | 2010-09-06 21:45:17 +0000 |
commit | cfaefad754642677dbddfcbe743c3fa5e058785d (patch) | |
tree | 48ac26cc5289d8c0459837cd7d6936152216403b /OpenSim/Services/InventoryService/XInventoryService.cs | |
parent | Falling animation fix, comment out instrumentation. (diff) | |
parent | Fix yet another cause of "Ghost attachments" (diff) | |
download | opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.zip opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.gz opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.bz2 opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/InventoryService/XInventoryService.cs')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 84306e7..fb395ec 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -293,13 +293,35 @@ namespace OpenSim.Services.InventoryService | |||
293 | 293 | ||
294 | public virtual bool AddFolder(InventoryFolderBase folder) | 294 | public virtual bool AddFolder(InventoryFolderBase folder) |
295 | { | 295 | { |
296 | InventoryFolderBase check = GetFolder(folder); | ||
297 | if (check != null) | ||
298 | return false; | ||
299 | |||
296 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); | 300 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); |
297 | return m_Database.StoreFolder(xFolder); | 301 | return m_Database.StoreFolder(xFolder); |
298 | } | 302 | } |
299 | 303 | ||
300 | public virtual bool UpdateFolder(InventoryFolderBase folder) | 304 | public virtual bool UpdateFolder(InventoryFolderBase folder) |
301 | { | 305 | { |
302 | return AddFolder(folder); | 306 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); |
307 | InventoryFolderBase check = GetFolder(folder); | ||
308 | if (check == null) | ||
309 | return AddFolder(folder); | ||
310 | |||
311 | if (check.Type != -1 || xFolder.type != -1) | ||
312 | { | ||
313 | if (xFolder.version > check.Version) | ||
314 | return false; | ||
315 | check.Version = (ushort)xFolder.version; | ||
316 | xFolder = ConvertFromOpenSim(check); | ||
317 | return m_Database.StoreFolder(xFolder); | ||
318 | } | ||
319 | |||
320 | if (xFolder.version < check.Version) | ||
321 | xFolder.version = check.Version; | ||
322 | xFolder.folderID = check.ID; | ||
323 | |||
324 | return m_Database.StoreFolder(xFolder); | ||
303 | } | 325 | } |
304 | 326 | ||
305 | public virtual bool MoveFolder(InventoryFolderBase folder) | 327 | public virtual bool MoveFolder(InventoryFolderBase folder) |