Improve member adding and excluding flow
Allow to exclude a member Send emails to the member when it's excluded Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -68,10 +68,18 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Comment do
|
||||
tags: tags,
|
||||
mentions: mentions,
|
||||
local: is_nil(actor_domain),
|
||||
visibility: if(Visibility.is_public?(object), do: :public, else: :private)
|
||||
visibility: if(Visibility.is_public?(object), do: :public, else: :private),
|
||||
published_at: object["published"]
|
||||
}
|
||||
|
||||
maybe_fetch_parent_object(object, data)
|
||||
Logger.debug("Converted object before fetching parents")
|
||||
Logger.debug(inspect(data))
|
||||
|
||||
data = maybe_fetch_parent_object(object, data)
|
||||
|
||||
Logger.debug("Converted object after fetching parents")
|
||||
Logger.debug(inspect(data))
|
||||
data
|
||||
else
|
||||
{:ok, %Actor{suspended: true}} ->
|
||||
:error
|
||||
@@ -98,7 +106,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Comment do
|
||||
comment.actor.url,
|
||||
"uuid" => comment.uuid,
|
||||
"id" => comment.url,
|
||||
"tag" => build_mentions(comment.mentions) ++ build_tags(comment.tags)
|
||||
"tag" => build_mentions(comment.mentions) ++ build_tags(comment.tags),
|
||||
"published" => comment.published_at |> DateTime.to_iso8601()
|
||||
}
|
||||
|
||||
object =
|
||||
|
||||
@@ -35,7 +35,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Post do
|
||||
"name" => post.title,
|
||||
"content" => post.body,
|
||||
"attributedTo" => creator_url,
|
||||
"published" => post.publish_at || post.inserted_at
|
||||
"published" => (post.publish_at || post.inserted_at) |> DateTime.to_iso8601()
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Resource do
|
||||
"name" => resource.title,
|
||||
"summary" => resource.summary,
|
||||
"context" => get_context(resource),
|
||||
"attributedTo" => actor_url
|
||||
"attributedTo" => actor_url,
|
||||
"published" => resource.published_at |> DateTime.to_iso8601()
|
||||
}
|
||||
|
||||
case type do
|
||||
@@ -65,7 +66,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Resource do
|
||||
url: object["id"],
|
||||
actor_id: actor_id,
|
||||
creator_id: creator_id,
|
||||
parent_id: parent_id
|
||||
parent_id: parent_id,
|
||||
published_at: object["published"]
|
||||
}
|
||||
|
||||
case type do
|
||||
|
||||
@@ -37,7 +37,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Todo do
|
||||
"id" => todo.url,
|
||||
"name" => todo.title,
|
||||
"status" => todo.status,
|
||||
"todoList" => todo_list_url
|
||||
"todoList" => todo_list_url,
|
||||
"published" => todo.published_at |> DateTime.to_iso8601()
|
||||
}
|
||||
end
|
||||
|
||||
@@ -58,7 +59,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Todo do
|
||||
status: object["status"],
|
||||
url: object["id"],
|
||||
todo_list_id: todo_list_id,
|
||||
creator_id: creator_id
|
||||
creator_id: creator_id,
|
||||
published_at: object["published"]
|
||||
}
|
||||
else
|
||||
{:todo_list, nil} ->
|
||||
|
||||
@@ -28,7 +28,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.TodoList do
|
||||
"type" => "TodoList",
|
||||
"actor" => group_url,
|
||||
"id" => todo_list.url,
|
||||
"name" => todo_list.title
|
||||
"name" => todo_list.title,
|
||||
"published" => todo_list.published_at |> DateTime.to_iso8601()
|
||||
}
|
||||
end
|
||||
|
||||
@@ -43,7 +44,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.TodoList do
|
||||
%{
|
||||
title: object["name"],
|
||||
url: object["id"],
|
||||
actor_id: group_id
|
||||
actor_id: group_id,
|
||||
published_at: object["published"]
|
||||
}
|
||||
|
||||
_ ->
|
||||
|
||||
Reference in New Issue
Block a user