mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
status: stub local_only?, add scope, add marked_local_only?
This commit is contained in:
parent
434c70fd98
commit
08519cd4f4
@ -75,6 +75,8 @@ class Status < ApplicationRecord
|
|||||||
scope :not_excluded_by_account, ->(account) { where.not(account_id: account.excluded_from_timeline_account_ids) }
|
scope :not_excluded_by_account, ->(account) { where.not(account_id: account.excluded_from_timeline_account_ids) }
|
||||||
scope :not_domain_blocked_by_account, ->(account) { account.excluded_from_timeline_domains.blank? ? left_outer_joins(:account) : left_outer_joins(:account).where('accounts.domain IS NULL OR accounts.domain NOT IN (?)', account.excluded_from_timeline_domains) }
|
scope :not_domain_blocked_by_account, ->(account) { account.excluded_from_timeline_domains.blank? ? left_outer_joins(:account) : left_outer_joins(:account).where('accounts.domain IS NULL OR accounts.domain NOT IN (?)', account.excluded_from_timeline_domains) }
|
||||||
|
|
||||||
|
scope :not_local_only, -> { where(local_only: false) }
|
||||||
|
|
||||||
cache_associated :account, :application, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, :application, :stream_entry, :tags, :media_attachments, mentions: :account], thread: :account
|
cache_associated :account, :application, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, :application, :stream_entry, :tags, :media_attachments, mentions: :account], thread: :account
|
||||||
|
|
||||||
delegate :domain, to: :account, prefix: true
|
delegate :domain, to: :account, prefix: true
|
||||||
@ -271,6 +273,10 @@ class Status < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def local_only?
|
def local_only?
|
||||||
|
local_only
|
||||||
|
end
|
||||||
|
|
||||||
|
def marked_local_only?
|
||||||
# match both with and without U+FE0F (the emoji variation selector)
|
# match both with and without U+FE0F (the emoji variation selector)
|
||||||
/👁\ufe0f?\z/.match?(content)
|
/👁\ufe0f?\z/.match?(content)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user