diff --git a/Iceshrimp.Backend/Core/Services/EmojiService.cs b/Iceshrimp.Backend/Core/Services/EmojiService.cs index e81060e2..75570e9a 100644 --- a/Iceshrimp.Backend/Core/Services/EmojiService.cs +++ b/Iceshrimp.Backend/Core/Services/EmojiService.cs @@ -1,3 +1,4 @@ +using System.Runtime.CompilerServices; using System.Text.RegularExpressions; using AsyncKeyedLock; using Iceshrimp.Backend.Core.Configuration; @@ -71,8 +72,8 @@ public partial class EmojiService( { var user = await sysUserSvc.GetInstanceActorAsync(); var driveFile = await driveSvc.StoreFileAsync(existing.OriginalUrl, user, false, forceStore: true, - skipImageProcessing: false) ?? - throw new Exception("Error storing emoji file"); + skipImageProcessing: false) + ?? throw new Exception("Error storing emoji file"); var emoji = new Emoji { @@ -206,6 +207,19 @@ public partial class EmojiService( } } + [OverloadResolutionPriority(1)] + private static void ResolveChildren( + Span nodes, ref List list + ) + { + foreach (var node in nodes) + { + if (node is MfmEmojiCodeNode emojiNode) list.Add(emojiNode); + list.AddRange(node.Children.OfType()); + ResolveChildren(node.Children, ref list); + } + } + public async Task UpdateLocalEmojiAsync( string id, string? name, List? aliases, string? category, string? license, bool? sensitive ) @@ -245,4 +259,4 @@ public partial class EmojiService( [GeneratedRegex(@"^:?([\w+-]+)@([a-zA-Z0-9._\-]+\.[a-zA-Z0-9._\-]+):?$", RegexOptions.Compiled)] private static partial Regex RemoteCustomEmojiRegex { get; } -} \ No newline at end of file +}