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
parent b012be0541
commit 87b37a4153
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
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