[backend/core] Improve GetReactionsAsync
This commit is contained in:
parent
13a359a1b6
commit
0c8b79a489
1 changed files with 3 additions and 3 deletions
|
@ -101,10 +101,10 @@ public class NotificationRenderer(UserRenderer userRenderer, NoteRenderer noteRe
|
||||||
{
|
{
|
||||||
var reactions = notifications.Select(p => p.Reaction).NotNull().ToList();
|
var reactions = notifications.Select(p => p.Reaction).NotNull().ToList();
|
||||||
|
|
||||||
var emojis = reactions.Where(p => !p.StartsWith(':')).Select(p => new ReactionResponse { Name = p, Url = null, Sensitive = false }).ToList();
|
var emojis = reactions.Where(p => !EmojiService.IsCustomEmoji(p)).Select(p => new ReactionResponse { Name = p, Url = null, Sensitive = false }).ToList();
|
||||||
var custom = reactions.Where(p => p.StartsWith(':')).ToAsyncEnumerable();
|
var custom = reactions.Where(EmojiService.IsCustomEmoji).ToArray();
|
||||||
|
|
||||||
await foreach (var s in custom)
|
foreach (var s in custom)
|
||||||
{
|
{
|
||||||
var emoji = await emojiSvc.ResolveEmojiAsync(s);
|
var emoji = await emojiSvc.ResolveEmojiAsync(s);
|
||||||
var reaction = emoji != null
|
var reaction = emoji != null
|
||||||
|
|
Loading…
Add table
Reference in a new issue