Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `config/webpack/shared.js`: Upstream has changed how Tesseract.js gets included and dropped a dependency. The conflict is caused by glitch-soc having different code due to its theming system. Ported upstream changes. - `lib/mastodon/version.rb`: Upstream refactor/code style change in a place we replaced upstream's repo URL with ours. Ported upstram changes, keeping our repo URL. - `yarn.lock`: Upstream dropped dependencies, one of which was textually too close to a glitch-soc-specific dependency. Not a real conflict.
This commit is contained in:
@ -36,11 +36,11 @@ class AccountConversation < ApplicationRecord
|
||||
end
|
||||
|
||||
class << self
|
||||
def paginate_by_id(limit, options = {})
|
||||
def to_a_paginated_by_id(limit, options = {})
|
||||
if options[:min_id]
|
||||
paginate_by_min_id(limit, options[:min_id]).reverse
|
||||
else
|
||||
paginate_by_max_id(limit, options[:max_id], options[:since_id])
|
||||
paginate_by_max_id(limit, options[:max_id], options[:since_id]).to_a
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -20,12 +20,12 @@ module Paginable
|
||||
query
|
||||
}
|
||||
|
||||
scope :paginate_by_id, ->(limit, options = {}) {
|
||||
def self.to_a_paginated_by_id(limit, options = {})
|
||||
if options[:min_id].present?
|
||||
paginate_by_min_id(limit, options[:min_id]).reverse
|
||||
else
|
||||
paginate_by_max_id(limit, options[:max_id], options[:since_id])
|
||||
paginate_by_max_id(limit, options[:max_id], options[:since_id]).to_a
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -72,6 +72,7 @@ class PreviewCard < ApplicationRecord
|
||||
class << self
|
||||
private
|
||||
|
||||
# rubocop:disable Naming/MethodParameterName
|
||||
def image_styles(f)
|
||||
styles = {
|
||||
original: {
|
||||
@ -85,6 +86,7 @@ class PreviewCard < ApplicationRecord
|
||||
styles[:original][:format] = 'jpg' if f.instance.image_content_type == 'image/gif'
|
||||
styles
|
||||
end
|
||||
# rubocop:enable Naming/MethodParameterName
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -254,16 +254,16 @@ class User < ApplicationRecord
|
||||
@shows_application ||= settings.show_application
|
||||
end
|
||||
|
||||
# rubocop:disable Naming/MethodParameterName
|
||||
def token_for_app(a)
|
||||
return nil if a.nil? || a.owner != self
|
||||
Doorkeeper::AccessToken
|
||||
.find_or_create_by(application_id: a.id, resource_owner_id: id) do |t|
|
||||
|
||||
Doorkeeper::AccessToken.find_or_create_by(application_id: a.id, resource_owner_id: id) do |t|
|
||||
t.scopes = a.scopes
|
||||
t.expires_in = Doorkeeper.configuration.access_token_expires_in
|
||||
t.use_refresh_token = Doorkeeper.configuration.refresh_token_enabled?
|
||||
end
|
||||
end
|
||||
# rubocop:enable Naming/MethodParameterName
|
||||
|
||||
def activate_session(request)
|
||||
session_activations.activate(session_id: SecureRandom.hex,
|
||||
@ -414,7 +414,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def notify_staff_about_pending_account!
|
||||
User.staff.includes(:account).each do |u|
|
||||
User.staff.includes(:account).find_each do |u|
|
||||
next unless u.allows_pending_account_emails?
|
||||
AdminMailer.new_pending_account(u.account, self).deliver_later
|
||||
end
|
||||
|
Reference in New Issue
Block a user