Let's see if this helps with attachments randomly ending up in L&F: If there is a previous folder ID, just move it back to where they came from
parent
3833f8864d
commit
bae5bc69fb
|
|
@ -1010,20 +1010,42 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask)
|
|||
LLUUID new_parent_id = item->getParentUUID();
|
||||
bool update_parent_on_server = false;
|
||||
|
||||
// <FS:Ansariel> Fix attachments being to Lost&Found during logout
|
||||
// <FS:Ansariel> Fix attachments falsely being moved to Lost&Found
|
||||
//if (new_parent_id.isNull())
|
||||
//{
|
||||
// // item with null parent will end in random location and then in Lost&Found,
|
||||
// // either move to default folder as if it is new item or don't move at all
|
||||
// LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID()
|
||||
// << " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName()
|
||||
// << ". New name: " << item->getName()
|
||||
// << "." << LL_ENDL;
|
||||
// new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
// update_parent_on_server = true;
|
||||
//}
|
||||
if (new_parent_id.isNull() && !LLApp::isExiting())
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
// item with null parent will end in random location and then in Lost&Found,
|
||||
// either move to default folder as if it is new item or don't move at all
|
||||
LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID()
|
||||
<< " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName()
|
||||
<< ". New name: " << item->getName()
|
||||
<< "." << LL_ENDL;
|
||||
new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
update_parent_on_server = true;
|
||||
if (old_parent_id.isNull())
|
||||
{
|
||||
// item with null parent will end in random location and then in Lost&Found,
|
||||
// either move to default folder as if it is new item or don't move at all
|
||||
LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID()
|
||||
<< " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName()
|
||||
<< ". New name: " << item->getName()
|
||||
<< "." << LL_ENDL;
|
||||
new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
update_parent_on_server = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID()
|
||||
<< " to null folder. Old parent not null. Moving to old parent. Old item name: " << old_item->getName()
|
||||
<< ". New name: " << item->getName()
|
||||
<< "." << LL_ENDL;
|
||||
new_parent_id = old_parent_id;
|
||||
update_parent_on_server = true;
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
if(old_parent_id != new_parent_id)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue