Compare commits

...

2 Commits

Author SHA1 Message Date
LittleSheep
ea8158cb50 ♻️ Optimize chat summary 2025-08-10 20:22:43 +08:00
LittleSheep
65398c5fec 🐛 Fix update sticker 2025-08-10 20:08:45 +08:00
2 changed files with 16 additions and 2 deletions

View File

@@ -261,7 +261,7 @@ public partial class ChatService(
}
var now = SystemClock.Instance.GetCurrentInstant();
List<Account> accountsToNotify = [];
foreach (
var member in members
@@ -381,8 +381,23 @@ public partial class ChatService(
messageSenders = await crs.LoadMemberAccounts(messageSenders);
messageSenders = messageSenders.Where(x => x.Account is not null).ToList();
// Get keys of messages to remove (where sender is not found)
var messagesToRemove = messages
.Where(m => messageSenders.All(s => s.Id != m.Value.SenderId))
.Select(m => m.Key)
.ToList();
// Remove messages with no sender
foreach (var key in messagesToRemove)
{
messages.Remove(key);
}
// Update remaining messages with their senders
foreach (var message in messages)
{
message.Value!.Sender = messageSenders.First(x => x.Id == message.Value.SenderId);
}
return messages;
}

View File

@@ -245,7 +245,6 @@ public class StickerController(AppDatabase db, StickerService st, FileService.Fi
return permissionCheck;
var sticker = await db.Stickers
.Include(s => s.Image)
.Include(s => s.Pack)
.ThenInclude(p => p.Publisher)
.FirstOrDefaultAsync(e => e.Id == id && e.Pack.Id == packId);