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 <plastikmensch@users.noreply.github.com>
This commit is contained in:
parent
8cecb468b0
commit
f9730eba77
1 changed files with 3 additions and 1 deletions
|
@ -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?
|
||||
|
||||
|
|
Loading…
Reference in a new issue