mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 10:59:17 +00:00
delete activities
This commit is contained in:
parent
12a171844b
commit
4e8ee48cff
|
@ -14,6 +14,12 @@ defp enabled? do
|
|||
Config.get([:search, :provider]) == Pleroma.Search.Elasticsearch
|
||||
end
|
||||
|
||||
def delete_by_id(:activity, id) do
|
||||
if enabled?() do
|
||||
Elastix.Document.delete(url(), "activities", "activity", id)
|
||||
end
|
||||
end
|
||||
|
||||
def put_by_id(:activity, id) do
|
||||
id
|
||||
|> Activity.get_by_id_with_object()
|
||||
|
|
|
@ -542,6 +542,10 @@ def handle_after_transaction(%Pleroma.Activity{data: %{"type" => "Create"}} = ac
|
|||
Pleroma.Elasticsearch.put_by_id(:activity, activity.id)
|
||||
end
|
||||
|
||||
def handle_after_transaction(%Pleroma.Activity{data: %{"type" => "Delete", "deleted_activity_id" => id}}) do
|
||||
Pleroma.Elasticsearch.delete_by_id(:activity, id)
|
||||
end
|
||||
|
||||
def handle_after_transaction(%Pleroma.Activity{}) do
|
||||
:ok
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue