Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
	app/models/user.rb

Resolved by adding :default_language to user settings fields
This commit is contained in:
Thibaut Girka
2018-06-21 20:49:57 +02:00
129 changed files with 1169 additions and 576 deletions

View File

@ -197,8 +197,8 @@ class Status < ApplicationRecord
before_validation :set_local
class << self
def not_in_filtered_languages(account)
where(language: nil).or where.not(language: account.filtered_languages)
def in_chosen_languages(account)
where(language: nil).or where(language: account.chosen_languages)
end
def as_home_timeline(account)
@ -344,7 +344,7 @@ class Status < ApplicationRecord
def filter_timeline_for_account(query, account, local_only)
query = query.not_excluded_by_account(account)
query = query.not_domain_blocked_by_account(account) unless local_only
query = query.not_in_filtered_languages(account) if account.filtered_languages.present?
query = query.in_chosen_languages(account) if account.chosen_languages.present?
query.merge(account_silencing_filter(account))
end