[backend/core] Fix ArrayTypeMismatchException in APMentionsResolver
This commit is contained in:
parent
5dee8bc783
commit
b160a97f0e
1 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using CommunityToolkit.HighPerformance;
|
||||
using Iceshrimp.Backend.Core.Configuration;
|
||||
using Iceshrimp.Backend.Core.Database.Tables;
|
||||
|
@ -45,6 +46,26 @@ public class MentionsResolver(IOptions<Config.InstanceSection> config) : ISingle
|
|||
}
|
||||
}
|
||||
|
||||
[OverloadResolutionPriority(1)]
|
||||
private void ResolveMentions(
|
||||
Span<IMfmInlineNode> nodes, string? host,
|
||||
List<Note.MentionedUser> mentionCache,
|
||||
SplitDomainMapping splitDomainMapping
|
||||
)
|
||||
{
|
||||
for (var i = 0; i < nodes.Length; i++)
|
||||
{
|
||||
var node = nodes[i];
|
||||
if (node is not MfmMentionNode mention)
|
||||
{
|
||||
ResolveMentions(node.Children, host, mentionCache, splitDomainMapping);
|
||||
continue;
|
||||
}
|
||||
|
||||
nodes[i] = ResolveMention(mention, host, mentionCache, splitDomainMapping);
|
||||
}
|
||||
}
|
||||
|
||||
private IMfmInlineNode ResolveMention(
|
||||
MfmMentionNode node, string? host,
|
||||
IEnumerable<Note.MentionedUser> mentionCache,
|
||||
|
|
Loading…
Add table
Reference in a new issue