[backend/federation] Support ASLike activities with content instead of _misskey_reaction

This commit is contained in:
Laura Hausmann 2024-08-18 19:19:21 +02:00
parent 2f3408f3d7
commit 6d5f7b5f4a
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 6 additions and 2 deletions

View file

@ -269,8 +269,8 @@ public class ActivityHandlerService(
await UnfollowAsync(followee, resolvedActor); await UnfollowAsync(followee, resolvedActor);
break; break;
case ASLike { Object: ASNote note } like: case ASLike { Object: ASNote note } like:
if (like.MisskeyReaction != null) if ((like.Content ?? like.MisskeyReaction) is { } reaction)
await noteSvc.RemoveReactionFromNoteAsync(note, resolvedActor, like.MisskeyReaction); await noteSvc.RemoveReactionFromNoteAsync(note, resolvedActor, reaction);
else else
await noteSvc.UnlikeNoteAsync(note, resolvedActor); await noteSvc.UnlikeNoteAsync(note, resolvedActor);
break; break;

View file

@ -130,6 +130,10 @@ public class ASLike : ASActivity
[JC(typeof(VC))] [JC(typeof(VC))]
public string? MisskeyReaction { get; set; } public string? MisskeyReaction { get; set; }
[J($"{Constants.ActivityStreamsNs}#content")]
[JC(typeof(VC))]
public string? Content { get; set; }
[J($"{Constants.ActivityStreamsNs}#tag")] [J($"{Constants.ActivityStreamsNs}#tag")]
[JC(typeof(ASTagConverter))] [JC(typeof(ASTagConverter))]
public List<ASTag>? Tags { get; set; } public List<ASTag>? Tags { get; set; }