Fix most rubocop issues (#2165)
* Run rubocop --autocorrect on app/, config/ and lib/, also manually fix some remaining style issues * Run rubocop --autocorrect-all on db/ * Run rubocop --autocorrect-all on `spec/` and fix remaining issues
This commit is contained in:
@@ -154,7 +154,7 @@ class BackupService < BaseService
|
||||
object,
|
||||
serializer: serializer,
|
||||
adapter: ActivityPub::Adapter,
|
||||
allow_local_only: true,
|
||||
allow_local_only: true
|
||||
).as_json
|
||||
end
|
||||
|
||||
|
@@ -116,7 +116,7 @@ class FanOutOnWriteService < BaseService
|
||||
end
|
||||
|
||||
def deliver_to_direct_timelines!
|
||||
FeedInsertWorker.push_bulk(@status.mentions.includes(:account).map(&:account).select { |mentioned_account| mentioned_account.local? }) do |account|
|
||||
FeedInsertWorker.push_bulk(@status.mentions.includes(:account).map(&:account).select(&:local?)) do |account|
|
||||
[@status.id, account.id, 'direct', { 'update' => update? }]
|
||||
end
|
||||
end
|
||||
|
@@ -61,17 +61,22 @@ class PostStatusService < BaseService
|
||||
|
||||
private
|
||||
|
||||
def preprocess_attributes!
|
||||
if @text.blank? && @options[:spoiler_text].present?
|
||||
@text = '.'
|
||||
if @media&.find(&:video?) || @media&.find(&:gifv?)
|
||||
@text = '📹'
|
||||
elsif @media&.find(&:audio?)
|
||||
@text = '🎵'
|
||||
elsif @media&.find(&:image?)
|
||||
@text = '🖼'
|
||||
end
|
||||
def fill_blank_text!
|
||||
return unless @text.blank? && @options[:spoiler_text].present?
|
||||
|
||||
if @media&.any?(&:video?) || @media&.any?(&:gifv?)
|
||||
@text = '📹'
|
||||
elsif @media&.any?(&:audio?)
|
||||
@text = '🎵'
|
||||
elsif @media&.any?(&:image?)
|
||||
@text = '🖼'
|
||||
else
|
||||
@text = '.'
|
||||
end
|
||||
end
|
||||
|
||||
def preprocess_attributes!
|
||||
fill_blank_text!
|
||||
@sensitive = (@options[:sensitive].nil? ? @account.user&.setting_default_sensitive : @options[:sensitive]) || @options[:spoiler_text].present?
|
||||
@visibility = @options[:visibility] || @account.user&.setting_default_privacy
|
||||
@visibility = :unlisted if @visibility&.to_sym == :public && @account.silenced?
|
||||
|
Reference in New Issue
Block a user