Skip to content

Commit

Permalink
Check for content attribute in Misskey likes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEssem committed Dec 29, 2023
1 parent 95b2d96 commit b8d7a1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/lib/activitypub/activity/like.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ def perform
Trends.statuses.register(original_status)
end

# Misskey delivers reactions as likes with the emoji in _misskey_reaction
# see https://misskey-hub.net/ns.html#misskey-reaction for details
# Misskey delivers reactions as likes with the emoji in _misskey_reaction and content
# Versions of Misskey before 12.1.0 only specify emojis in _misskey_reaction, so we check both
# See https://misskey-hub.net/ns.html#misskey-reaction for details
def maybe_process_misskey_reaction
original_status = status_from_uri(object_uri)
name = @json['_misskey_reaction']
name = @json['content'] || @json['_misskey_reaction']
return false if name.nil?

if /^:.*:$/.match?(name)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/activitypub/activity/undo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def undo_like
if @account.favourited?(status)
favourite = status.favourites.where(account: @account).first
favourite&.destroy
elsif @object['_misskey_reaction'].present?
elsif @object['content'].present? || @object['_misskey_reaction'].present?
undo_emoji_react
else
delete_later!(object_uri)
Expand Down

0 comments on commit b8d7a1c

Please sign in to comment.