[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);
break;
case ASLike { Object: ASNote note } like:
if (like.MisskeyReaction != null)
await noteSvc.RemoveReactionFromNoteAsync(note, resolvedActor, like.MisskeyReaction);
if ((like.Content ?? like.MisskeyReaction) is { } reaction)
await noteSvc.RemoveReactionFromNoteAsync(note, resolvedActor, reaction);
else
await noteSvc.UnlikeNoteAsync(note, resolvedActor);
break;

View file

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