mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 16:03:25 +00:00
Fix whether group draft events should federate or not
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
20ff0a7f6c
commit
8b2ddbda2b
1 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,7 @@ defmodule Mobilizon.GraphQL.API.Events do
|
||||||
process_picture(picture, organizer_actor)
|
process_picture(picture, organizer_actor)
|
||||||
end) do
|
end) do
|
||||||
# For now we don't federate drafts but it will be needed if we want to edit them as groups
|
# For now we don't federate drafts but it will be needed if we want to edit them as groups
|
||||||
ActivityPub.create(:event, args, args.draft == false)
|
ActivityPub.create(:event, args, should_federate(args))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ defmodule Mobilizon.GraphQL.API.Events do
|
||||||
Map.update(args, :picture, nil, fn picture ->
|
Map.update(args, :picture, nil, fn picture ->
|
||||||
process_picture(picture, organizer_actor)
|
process_picture(picture, organizer_actor)
|
||||||
end) do
|
end) do
|
||||||
ActivityPub.update(event, args, Map.get(args, :draft, false) == false)
|
ActivityPub.update(event, args, should_federate(args))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -74,4 +74,9 @@ defmodule Mobilizon.GraphQL.API.Events do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp extract_pictures_from_event_body(args, _), do: args
|
defp extract_pictures_from_event_body(args, _), do: args
|
||||||
|
|
||||||
|
defp should_federate(%{attributed_to_id: attributed_to_id}) when not is_nil(attributed_to_id),
|
||||||
|
do: true
|
||||||
|
|
||||||
|
defp should_federate(args), do: Map.get(args, :draft, false) == false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue