From f9730eba770144c2a2adc586abcb12112cccfeab Mon Sep 17 00:00:00 2001 From: Plastikmensch Date: Sun, 14 May 2023 23:59:56 +0200 Subject: [PATCH] Handle `Undo` from Misskey Right now Misskey users were able to react, but couldn't remove their reactions. delegates `Undo` for a `Like` to `undo_emoji_react` when there is no favourite found. (Misskey `Like` activities can still create a fav when the emoji tag is invalid, I don't see the point though) Signed-off-by: Plastikmensch --- app/lib/activitypub/activity/undo.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/activitypub/activity/undo.rb b/app/lib/activitypub/activity/undo.rb index ba8d03703c..fd836b9728 100644 --- a/app/lib/activitypub/activity/undo.rb +++ b/app/lib/activitypub/activity/undo.rb @@ -110,13 +110,15 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity if @account.favourited?(status) favourite = status.favourites.where(account: @account).first favourite&.destroy + elsif @object['_misskey_reaction'].present? + undo_emoji_react else delete_later!(object_uri) end end def undo_emoji_react - name = @object['content'] + name = @object['content'] || @object['_misskey_reaction'] tags = @object['tag'] return if name.nil?