diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-01-13 21:57:24 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-01-13 21:57:24 -0600 |
commit | 67516a07db44196cc4bb94bf94abe5c6f611cf07 (patch) | |
tree | f65b7c79f859329a0438d806e777fa1d7aa7f400 /app/workers/defederate_status_worker.rb | |
parent | 1fbe7c340201ddff5232c7931a265136943ffd59 (diff) |
add new privacy option to auto-defederate after a given timespan + add options to defederate and/or delete past posts + add `defed_in`/`parent:defed_in`/`thread:defed_in` bangtags + ui indicator for posts marked for auto-defederation
Diffstat (limited to 'app/workers/defederate_status_worker.rb')
-rw-r--r-- | app/workers/defederate_status_worker.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/workers/defederate_status_worker.rb b/app/workers/defederate_status_worker.rb new file mode 100644 index 000000000..bae4be9b8 --- /dev/null +++ b/app/workers/defederate_status_worker.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DefederateStatusWorker + include Sidekiq::Worker + + sidekiq_options unique: :until_executed + + def perform(defederating_status_id) + defederating_status = DefederatingStatus.find(defederating_status_id) + defederating_status.destroy! + + RemoveStatusService.new.call(defederating_status.status, defederate_only: true) + true + rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid + true + end +end |