Fix remote group visibility and use Mastodon's discoverable attribute
Make sure actor visibility is :public or :unlisted Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -39,6 +39,9 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
|
||||
"sc" => "http://schema.org#",
|
||||
"ical" => "http://www.w3.org/2002/12/cal/ical#",
|
||||
"pt" => "https://joinpeertube.org/ns#",
|
||||
"toot" => "http://joinmastodon.org/ns#",
|
||||
"discoverable" => "toot:discoverable",
|
||||
"manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
|
||||
"Hashtag" => "as:Hashtag",
|
||||
"category" => "sc:category",
|
||||
"uuid" => "sc:identifier",
|
||||
|
||||
@@ -64,7 +64,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Actor do
|
||||
shared_inbox_url: data["endpoints"]["sharedInbox"],
|
||||
domain: URI.parse(data["id"]).host,
|
||||
manually_approves_followers: data["manuallyApprovesFollowers"],
|
||||
type: data["type"]
|
||||
type: data["type"],
|
||||
visibility: if(Map.get(data, "discoverable", false) == true, do: :public, else: :unlisted)
|
||||
}
|
||||
end
|
||||
|
||||
@@ -96,6 +97,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Actor do
|
||||
"endpoints" => %{
|
||||
"sharedInbox" => actor.shared_inbox_url
|
||||
},
|
||||
"discoverable" => actor.visibility == :public,
|
||||
"manuallyApprovesFollowers" => actor.manually_approves_followers,
|
||||
"publicKey" => %{
|
||||
"id" => "#{actor.url}#main-key",
|
||||
|
||||
Reference in New Issue
Block a user