summaryrefslogtreecommitdiffstats
path: root/app/services/process_interaction_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/process_interaction_service.rb')
-rw-r--r--app/services/process_interaction_service.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/process_interaction_service.rb b/app/services/process_interaction_service.rb
index b7503ca6ad0..536911e2f5f 100644
--- a/app/services/process_interaction_service.rb
+++ b/app/services/process_interaction_service.rb
@@ -32,6 +32,8 @@ class ProcessInteractionService < BaseService
add_post!(body, account) if mentions_account?(xml, target_account)
when :share
add_post!(body, account) unless status(xml).nil?
+ when :delete
+ delete_post!(xml, account)
end
end
end
@@ -62,6 +64,16 @@ class ProcessInteractionService < BaseService
account.unfollow!(target_account)
end
+ def delete_post!(xml, account)
+ status = Status.find(activity_id(xml))
+
+ return if status.nil?
+
+ if account.id == status.account_id
+ RemoveStatusService.new.(status)
+ end
+ end
+
def favourite!(xml, from_account)
current_status = status(xml)
current_status.favourites.where(account: from_account).first_or_create!(account: from_account)