mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-25 17:51:36 +01:00
Check for content attribute in Misskey likes
This commit is contained in:
parent
95b2d969b1
commit
b8d7a1c07a
2 changed files with 5 additions and 4 deletions
|
@ -15,11 +15,12 @@ class ActivityPub::Activity::Like < ActivityPub::Activity
|
||||||
Trends.statuses.register(original_status)
|
Trends.statuses.register(original_status)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Misskey delivers reactions as likes with the emoji in _misskey_reaction
|
# Misskey delivers reactions as likes with the emoji in _misskey_reaction and content
|
||||||
# see https://misskey-hub.net/ns.html#misskey-reaction for details
|
# 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
|
def maybe_process_misskey_reaction
|
||||||
original_status = status_from_uri(object_uri)
|
original_status = status_from_uri(object_uri)
|
||||||
name = @json['_misskey_reaction']
|
name = @json['content'] || @json['_misskey_reaction']
|
||||||
return false if name.nil?
|
return false if name.nil?
|
||||||
|
|
||||||
if /^:.*:$/.match?(name)
|
if /^:.*:$/.match?(name)
|
||||||
|
|
|
@ -110,7 +110,7 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity
|
||||||
if @account.favourited?(status)
|
if @account.favourited?(status)
|
||||||
favourite = status.favourites.where(account: @account).first
|
favourite = status.favourites.where(account: @account).first
|
||||||
favourite&.destroy
|
favourite&.destroy
|
||||||
elsif @object['_misskey_reaction'].present?
|
elsif @object['content'].present? || @object['_misskey_reaction'].present?
|
||||||
undo_emoji_react
|
undo_emoji_react
|
||||||
else
|
else
|
||||||
delete_later!(object_uri)
|
delete_later!(object_uri)
|
||||||
|
|
Loading…
Reference in a new issue