Merge commit 'df6086d4027910fb160d531b4fe7ffdec26b0cd7' into glitch-soc/merge-upstream
This commit is contained in:
commit
e91ede5be6
40 files changed
+351
-244
No files matched your search
@@ -440,7 +440,7 @@ class Account < ApplicationRecord
|
||||
end
|
||||
|
||||
def inboxes
|
||||
urls = reorder(nil).where(protocol: :activitypub).group(:preferred_inbox_url).pluck(Arel.sql("coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url) AS preferred_inbox_url"))
|
||||
urls = reorder(nil).activitypub.group(:preferred_inbox_url).pluck(Arel.sql("coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url) AS preferred_inbox_url"))
|
||||
DeliveryFailureTracker.without_unavailable(urls)
|
||||
end
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ module Account::StatusesSearch
|
||||
def add_to_public_statuses_index!
|
||||
return unless Chewy.enabled?
|
||||
|
||||
statuses.without_reblogs.where(visibility: :public).reorder(nil).find_in_batches do |batch|
|
||||
statuses.without_reblogs.public_visibility.reorder(nil).find_in_batches do |batch|
|
||||
PublicStatusesIndex.import(batch)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ module Status::SearchConcern
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
scope :indexable, -> { without_reblogs.where(visibility: :public).joins(:account).where(account: { indexable: true }) }
|
||||
scope :indexable, -> { without_reblogs.public_visibility.joins(:account).where(account: { indexable: true }) }
|
||||
end
|
||||
|
||||
def searchable_by
|
||||
|
||||
@@ -23,7 +23,7 @@ class IpBlock < ApplicationRecord
|
||||
sign_up_requires_approval: 5000,
|
||||
sign_up_block: 5500,
|
||||
no_access: 9999,
|
||||
}
|
||||
}, prefix: true
|
||||
|
||||
validates :ip, :severity, presence: true
|
||||
validates :ip, uniqueness: true
|
||||
|
||||
@@ -71,7 +71,7 @@ class PublicFeed
|
||||
end
|
||||
|
||||
def public_scope
|
||||
Status.with_public_visibility.joins(:account).merge(Account.without_suspended.without_silenced)
|
||||
Status.public_visibility.joins(:account).merge(Account.without_suspended.without_silenced)
|
||||
end
|
||||
|
||||
def local_only_scope
|
||||
|
||||
@@ -111,7 +111,6 @@ class Status < ApplicationRecord
|
||||
scope :with_accounts, ->(ids) { where(id: ids).includes(:account) }
|
||||
scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
|
||||
scope :without_reblogs, -> { where(statuses: { reblog_of_id: nil }) }
|
||||
scope :with_public_visibility, -> { where(visibility: :public) }
|
||||
scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_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) }
|
||||
@@ -495,7 +494,6 @@ class Status < ApplicationRecord
|
||||
def set_visibility
|
||||
self.visibility = reblog.visibility if reblog? && visibility.nil?
|
||||
self.visibility = (account.locked? ? :private : :public) if visibility.nil?
|
||||
self.sensitive = false if sensitive.nil?
|
||||
end
|
||||
|
||||
def set_local_only
|
||||
|
||||
+1
-1
@@ -446,7 +446,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def sign_up_from_ip_requires_approval?
|
||||
sign_up_ip.present? && IpBlock.sign_up_requires_approval.exists?(['ip >>= ?', sign_up_ip.to_s])
|
||||
sign_up_ip.present? && IpBlock.severity_sign_up_requires_approval.exists?(['ip >>= ?', sign_up_ip.to_s])
|
||||
end
|
||||
|
||||
def sign_up_email_requires_approval?
|
||||
|
||||
Reference in new issue
Block a user