diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb index 54b918bd8a..2a58fd3f71 100644 --- a/app/models/custom_emoji.rb +++ b/app/models/custom_emoji.rb @@ -48,7 +48,7 @@ class CustomEmoji < ApplicationRecord scope :local, -> { where(domain: nil) } scope :remote, -> { where.not(domain: nil) } - scope :remote_only, -> { where.not(domain: nil).where(category_id: nil) } + scope :remote_only, -> { where.not(domain: nil).where(category_id: nil).where(local_counterpart: { id: nil }) } scope :alphabetic, -> { order(domain: :asc, shortcode: :asc) } scope :by_domain_and_subdomains, ->(domain) { where(domain: domain).or(where(arel_table[:domain].matches("%.#{domain}"))) } scope :listed, -> { local.where(disabled: false).where(visible_in_picker: true) }