Bonfire.Federate.ActivityPub.AdapterUtils (Bonfire v1.0.0-social-rc.3.14)
View SourceSummary
Functions
Converts an interaction_policy map to a list of {circle_name, role} tuples.
without :ok / :error tuple
Functions
Converts an interaction_policy map to a list of {circle_name, role} tuples.
Only known verbs and circles are included. Supports multiple circles per verb. Looks up followers/following URLs from the actor object if present.
Handles the special case: if automaticApproval contains only the author's identifier, this means "nobody can" and emits a negative role for all local users.
Examples
iex> interaction_policy = %{
...> "canLike" => %{"automaticApproval" => ["https://www.w3.org/ns/activitystreams#Public"]},
...> "canReply" => %{"automaticApproval" => "https://example.org/users/someone/followers"},
...> "canQuote" => %{"automaticApproval" => "https://example.org/users/someone"}
...> }
iex> ap_incoming_interaction_policy_to_circle_roles(activity, interaction_policy)
[ {:guest, :react}, {:followers, :participate}, {:local, :cannot_critique} ]
without :ok / :error tuple