Merge branch 'main' into glitch-soc/merge-upstream
This commit is contained in:
@@ -8,6 +8,12 @@ class Admin::StatusBatchAction
|
||||
attr_accessor :current_account, :type,
|
||||
:status_ids, :report_id
|
||||
|
||||
attr_reader :send_email_notification
|
||||
|
||||
def send_email_notification=(value)
|
||||
@send_email_notification = ActiveModel::Type::Boolean.new.cast(value)
|
||||
end
|
||||
|
||||
def save!
|
||||
process_action!
|
||||
end
|
||||
@@ -55,7 +61,7 @@ class Admin::StatusBatchAction
|
||||
statuses.each { |status| Tombstone.find_or_create_by(uri: status.uri, account: status.account, by_moderator: true) } unless target_account.local?
|
||||
end
|
||||
|
||||
UserMailer.warning(target_account.user, @warning).deliver_later! if target_account.local?
|
||||
UserMailer.warning(target_account.user, @warning).deliver_later! if warnable?
|
||||
RemovalWorker.push_bulk(status_ids) { |status_id| [status_id, { 'preserve' => target_account.local?, 'immediate' => !target_account.local? }] }
|
||||
end
|
||||
|
||||
@@ -82,6 +88,10 @@ class Admin::StatusBatchAction
|
||||
!report.nil?
|
||||
end
|
||||
|
||||
def warnable?
|
||||
send_email_notification && target_account.local?
|
||||
end
|
||||
|
||||
def target_account
|
||||
@target_account ||= statuses.first.account
|
||||
end
|
||||
|
@@ -11,12 +11,9 @@ class Trends::Tags < Trends::Base
|
||||
}
|
||||
|
||||
def register(status, at_time = Time.now.utc)
|
||||
original_status = status.reblog? ? status.reblog : status
|
||||
return unless !status.reblog? && status.public_visibility? && !status.account.silenced?
|
||||
|
||||
return unless original_status.public_visibility? && status.public_visibility? &&
|
||||
!original_status.account.silenced? && !status.account.silenced?
|
||||
|
||||
original_status.tags.each do |tag|
|
||||
status.tags.each do |tag|
|
||||
add(tag, status.account_id, at_time) if tag.usable?
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user