This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/models/domain_block.rb
Eugen Rochko 4aa5ebe591 Split public timeline into "public timeline" which is local, and
"whole known network" which is what public timeline used to be

Only domain blocks with suspend severity will block PuSH subscriptions
Silenced accounts should not appear in conversations unless followed
2017-02-19 20:25:54 +01:00

12 lines
255 B
Ruby

# frozen_string_literal: true
class DomainBlock < ApplicationRecord
enum severity: [:silence, :suspend]
validates :domain, presence: true, uniqueness: true
def self.blocked?(domain)
where(domain: domain, severity: :suspend).exists?
end
end