diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-02-11 22:22:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 22:22:25 +0100 |
commit | 59b7ba451b4ded817c98abfa8c88738de0484917 (patch) | |
tree | 86a6af23cb16f45a5bfb660d8edd70ad57d4a30c /app/models | |
parent | 776e337b8d2aa66440bc4565617b5440ca781e1a (diff) | |
parent | a34e4f7e279e14b304ed81f698feb19d18a74d04 (diff) |
Merge pull request #1684 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/admin/status_batch_action.rb | 12 | ||||
-rw-r--r-- | app/models/trends/tags.rb | 7 |
2 files changed, 13 insertions, 6 deletions
diff --git a/app/models/admin/status_batch_action.rb b/app/models/admin/status_batch_action.rb index 85822214b..40f60f379 100644 --- a/app/models/admin/status_batch_action.rb +++ b/app/models/admin/status_batch_action.rb @@ -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 diff --git a/app/models/trends/tags.rb b/app/models/trends/tags.rb index a425fd207..2ea4550df 100644 --- a/app/models/trends/tags.rb +++ b/app/models/trends/tags.rb @@ -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 |