diff --git a/app/lib/activitypub/activity/emoji_react.rb b/app/lib/activitypub/activity/emoji_react.rb index 292ea6fd3a..9f28064cce 100644 --- a/app/lib/activitypub/activity/emoji_react.rb +++ b/app/lib/activitypub/activity/emoji_react.rb @@ -22,5 +22,7 @@ class ActivityPub::Activity::EmojiReact < ActivityPub::Activity reaction = original_status.status_reactions.create!(account: @account, name: name, custom_emoji: custom_emoji) LocalNotificationWorker.perform_async(original_status.account_id, reaction.id, 'StatusReaction', 'reaction') + rescue ActiveRecord::RecordInvalid + nil end end diff --git a/app/lib/activitypub/activity/like.rb b/app/lib/activitypub/activity/like.rb index 37215c1799..1ded77f4ae 100644 --- a/app/lib/activitypub/activity/like.rb +++ b/app/lib/activitypub/activity/like.rb @@ -34,5 +34,8 @@ class ActivityPub::Activity::Like < ActivityPub::Activity reaction = original_status.status_reactions.create!(account: @account, name: name, custom_emoji: custom_emoji) LocalNotificationWorker.perform_async(original_status.account_id, reaction.id, 'StatusReaction', 'reaction') true + # account tried to react with disabled custom emoji. Returning true to discard activity. + rescue ActiveRecord::RecordInvalid + true end end