Compare commits
2 Commits
5181897463
...
ea8158cb50
Author | SHA1 | Date | |
---|---|---|---|
|
ea8158cb50 | ||
|
65398c5fec |
@@ -261,7 +261,7 @@ public partial class ChatService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
var now = SystemClock.Instance.GetCurrentInstant();
|
var now = SystemClock.Instance.GetCurrentInstant();
|
||||||
|
|
||||||
List<Account> accountsToNotify = [];
|
List<Account> accountsToNotify = [];
|
||||||
foreach (
|
foreach (
|
||||||
var member in members
|
var member in members
|
||||||
@@ -381,8 +381,23 @@ public partial class ChatService(
|
|||||||
messageSenders = await crs.LoadMemberAccounts(messageSenders);
|
messageSenders = await crs.LoadMemberAccounts(messageSenders);
|
||||||
messageSenders = messageSenders.Where(x => x.Account is not null).ToList();
|
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)
|
foreach (var message in messages)
|
||||||
|
{
|
||||||
message.Value!.Sender = messageSenders.First(x => x.Id == message.Value.SenderId);
|
message.Value!.Sender = messageSenders.First(x => x.Id == message.Value.SenderId);
|
||||||
|
}
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
@@ -245,7 +245,6 @@ public class StickerController(AppDatabase db, StickerService st, FileService.Fi
|
|||||||
return permissionCheck;
|
return permissionCheck;
|
||||||
|
|
||||||
var sticker = await db.Stickers
|
var sticker = await db.Stickers
|
||||||
.Include(s => s.Image)
|
|
||||||
.Include(s => s.Pack)
|
.Include(s => s.Pack)
|
||||||
.ThenInclude(p => p.Publisher)
|
.ThenInclude(p => p.Publisher)
|
||||||
.FirstOrDefaultAsync(e => e.Id == id && e.Pack.Id == packId);
|
.FirstOrDefaultAsync(e => e.Id == id && e.Pack.Id == packId);
|
||||||
|
Reference in New Issue
Block a user