Expose isOnline through AP

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-02-08 15:27:17 +01:00 committed by tykayn
parent 72061d9fe2
commit 32ec220372
2 changed files with 8 additions and 2 deletions

View File

@ -112,6 +112,10 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
"@id" => "mz:participationMessage",
"@type" => "sc:Text"
},
"isOnline" => %{
"@type" => "sc:Boolean",
"@id" => "mz:isOnline"
},
"PropertyValue" => "sc:PropertyValue",
"value" => "sc:value",
"propertyID" => "sc:propertyID",

View File

@ -139,7 +139,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
"url" => event.url,
"inLanguage" => event.language,
"timezone" => event.options.timezone,
"contacts" => Enum.map(event.contacts, & &1.url)
"contacts" => Enum.map(event.contacts, & &1.url),
"isOnline" => event.options.is_online
}
|> maybe_add_physical_address(event)
|> maybe_add_event_picture(event)
@ -168,7 +169,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
"repliesModerationOption",
if(Map.get(object, "commentsEnabled", true), do: :allow_all, else: :closed)
),
timezone: calculate_timezone(object, address)
timezone: calculate_timezone(object, address),
is_online: object["isOnline"] == true
}
end