Broadcast deleted activity id on deletion to conform to MastoAPI streamig spec
This commit is contained in:
parent
5075e8abe5
commit
6038c8a753
6 changed files with 40 additions and 14 deletions
|
|
@ -107,6 +107,18 @@ defmodule Pleroma.Activity do
|
|||
|
||||
def get_in_reply_to_activity(_), do: nil
|
||||
|
||||
def delete_by_ap_id(id) when is_binary(id) do
|
||||
by_object_ap_id(id)
|
||||
|> Repo.delete_all(returning: true)
|
||||
|> elem(1)
|
||||
|> Enum.find(fn
|
||||
%{data: %{"type" => "Create", "object" => %{"id" => ap_id}}} -> ap_id == id
|
||||
_ -> nil
|
||||
end)
|
||||
end
|
||||
|
||||
def delete_by_ap_id(_), do: nil
|
||||
|
||||
for {ap_type, type} <- @mastodon_notification_types do
|
||||
def mastodon_notification_type(%Activity{data: %{"type" => unquote(ap_type)}}),
|
||||
do: unquote(type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue