Skip to content

Commit

Permalink
fixed missing tag change records in history
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksimChegulov committed Nov 29, 2024
1 parent 42774c2 commit 8087a85
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions products/ASC.Files/Core/Core/FileStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,8 @@ private async Task<Folder<T>> InternalCreateFolderAsync<T>(T parentId, string ti
var tags = tagsInfos.Select(tagInfo => Tag.Custom(Guid.Empty, folder, tagInfo.Name));

await tagDao.SaveTagsAsync(tags);

await filesMessageService.SendAsync(MessageAction.AddedRoomTags, folder, folder.Title, string.Join(',', tags.Select(x => x.Name)));
}
}

Expand Down Expand Up @@ -996,11 +998,22 @@ await filesMessageService.SendAsync(MessageAction.RoomLifeTimeSet, folder, lifet
var tags = tagsInfos.Select(tagInfo => Tag.Custom(Guid.Empty, folder, tagInfo.Name));

await tagDao.SaveTagsAsync(tags);

var addedTags = tags.Select(t => t.Name).Except(currentTags.Select(t => t.Name)).ToList();
if (addedTags.Count > 0)
{
await filesMessageService.SendAsync(MessageAction.AddedRoomTags, folder, folder.Title, string.Join(',', addedTags));
}
}
}

var toDelete = currentTags.Where(r => tagsInfos.All(b => b.Name != r.Name)).ToList();
await tagDao.RemoveTagsAsync(folder, toDelete.Select(t => t.Id).ToList());

if (toDelete.Count > 0)
{
await filesMessageService.SendAsync(MessageAction.DeletedRoomTags, folder, folder.Title, string.Join(',', toDelete.Select(t => t.Name)));
}
}

var newTags = tagDao.GetNewTagsAsync(authContext.CurrentAccount.ID, folder);
Expand Down

0 comments on commit 8087a85

Please sign in to comment.