forked from potsda.mn/mobilizon
Add "formerType" and "delete" attributes on Tombstones objects
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2032586352
commit
446c5f00ab
|
@ -98,6 +98,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Actors do
|
|||
"actor" => actor_url,
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => to_string(type),
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => target_actor_url
|
||||
},
|
||||
"id" => target_actor_url <> "/delete",
|
||||
|
|
|
@ -84,6 +84,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Comments do
|
|||
"actor" => actor.url,
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => "Note",
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => url
|
||||
},
|
||||
"id" => url <> "/delete",
|
||||
|
|
|
@ -117,6 +117,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Discussions do
|
|||
"actor" => actor.url,
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => "Note",
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"url" => url
|
||||
},
|
||||
"id" => url <> "/delete",
|
||||
|
|
|
@ -84,6 +84,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Events do
|
|||
"actor" => actor.url,
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => "Event",
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => url
|
||||
},
|
||||
"to" => [actor.url <> "/followers", "https://www.w3.org/ns/activitystreams#Public"],
|
||||
|
|
|
@ -79,6 +79,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Posts do
|
|||
"type" => "Delete",
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => "Article",
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => url
|
||||
},
|
||||
"id" => url <> "/delete",
|
||||
|
|
|
@ -150,7 +150,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Resources do
|
|||
@spec delete(Resource.t(), Actor.t(), boolean, map()) ::
|
||||
{:ok, ActivityStream.t(), Actor.t(), Resource.t()} | {:error, Ecto.Changeset.t()}
|
||||
def delete(
|
||||
%Resource{url: url, actor: %Actor{url: group_url, members_url: members_url}} = resource,
|
||||
%Resource{url: url, type: type, actor: %Actor{url: group_url, members_url: members_url}} =
|
||||
resource,
|
||||
%Actor{url: actor_url} = actor,
|
||||
_local,
|
||||
_additionnal
|
||||
|
@ -163,6 +164,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Resources do
|
|||
"type" => "Delete",
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => if(type == :folder, do: "ResourceCollection", else: "Document"),
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => url
|
||||
},
|
||||
"id" => url <> "/delete",
|
||||
|
|
|
@ -57,6 +57,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.TodoLists do
|
|||
"type" => "Delete",
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => "TodoList",
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => url
|
||||
},
|
||||
"id" => url <> "/delete",
|
||||
|
|
|
@ -97,6 +97,8 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Todos do
|
|||
"type" => "Delete",
|
||||
"object" => %{
|
||||
"type" => "Tombstone",
|
||||
"formerType" => "Todo",
|
||||
"deleted" => DateTime.utc_now(),
|
||||
"id" => url
|
||||
},
|
||||
"id" => "#{url}/delete",
|
||||
|
|
Loading…
Reference in a new issue