Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - .github/ISSUE_TEMPLATE/bug_report.md Took our version. - CONTRIBUTING.md Updated the embedded copy of upstream's version. - README.md Took our version. - app/policies/status_policy.rb Not a real conflict, took code from both. - app/views/layouts/embedded.html.haml Added upstream's changes (dns-prefetch) and fixed `%body.embed` - app/views/settings/preferences/show.html.haml Reverted some of upstream changes, as we have a page dedicated for flavours and skins. - config/initializers/content_security_policy.rb Kept our version of the CSP. - config/initializers/doorkeeper.rb Not a real conflict, took code from both.
This commit is contained in:
@@ -39,7 +39,7 @@ class Status < ApplicationRecord
|
||||
|
||||
update_index('statuses#status', :proper) if Chewy.enabled?
|
||||
|
||||
enum visibility: [:public, :unlisted, :private, :direct], _suffix: :visibility
|
||||
enum visibility: [:public, :unlisted, :private, :direct, :limited], _suffix: :visibility
|
||||
|
||||
belongs_to :application, class_name: 'Doorkeeper::Application', optional: true
|
||||
|
||||
@@ -54,7 +54,8 @@ class Status < ApplicationRecord
|
||||
has_many :bookmarks, inverse_of: :status, dependent: :destroy
|
||||
has_many :reblogs, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblog, dependent: :destroy
|
||||
has_many :replies, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :thread
|
||||
has_many :mentions, dependent: :destroy
|
||||
has_many :mentions, dependent: :destroy, inverse_of: :status
|
||||
has_many :active_mentions, -> { active }, class_name: 'Mention', inverse_of: :status
|
||||
has_many :media_attachments, dependent: :nullify
|
||||
|
||||
has_and_belongs_to_many :tags
|
||||
@@ -94,7 +95,7 @@ class Status < ApplicationRecord
|
||||
:status_stat,
|
||||
:tags,
|
||||
:stream_entry,
|
||||
mentions: :account,
|
||||
active_mentions: :account,
|
||||
reblog: [
|
||||
:account,
|
||||
:application,
|
||||
@@ -103,7 +104,7 @@ class Status < ApplicationRecord
|
||||
:media_attachments,
|
||||
:conversation,
|
||||
:status_stat,
|
||||
mentions: :account,
|
||||
active_mentions: :account,
|
||||
],
|
||||
thread: :account
|
||||
|
||||
@@ -176,7 +177,11 @@ class Status < ApplicationRecord
|
||||
end
|
||||
|
||||
def hidden?
|
||||
private_visibility? || direct_visibility?
|
||||
private_visibility? || direct_visibility? || limited_visibility?
|
||||
end
|
||||
|
||||
def distributable?
|
||||
public_visibility? || unlisted_visibility?
|
||||
end
|
||||
|
||||
def with_media?
|
||||
@@ -240,6 +245,10 @@ class Status < ApplicationRecord
|
||||
left_outer_joins(:status_stat).select('statuses.id, greatest(statuses.updated_at, status_stats.updated_at) AS updated_at')
|
||||
end
|
||||
|
||||
def selectable_visibilities
|
||||
visibilities.keys - %w(direct limited)
|
||||
end
|
||||
|
||||
def in_chosen_languages(account)
|
||||
where(language: nil).or where(language: account.chosen_languages)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user