about summary refs log tree commit diff
path: root/app/lib/ostatus/activity/deletion.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/ostatus/activity/deletion.rb')
-rw-r--r--app/lib/ostatus/activity/deletion.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/lib/ostatus/activity/deletion.rb b/app/lib/ostatus/activity/deletion.rb
new file mode 100644
index 000000000..c4d05a467
--- /dev/null
+++ b/app/lib/ostatus/activity/deletion.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class Ostatus::Activity::Deletion < Ostatus::Activity::Base
+  def perform
+    Rails.logger.debug "Deleting remote status #{id}"
+    status = Status.find_by(uri: id, account: @account)
+
+    if status.nil?
+      redis.setex("delete_upon_arrival:#{@account.id}:#{id}", 6 * 3_600, id)
+    else
+      RemoveStatusService.new.call(status)
+    end
+  end
+end