Bonfire.API.MastoCompat.Mappers.Suggestion (Bonfire v1.0.1-social-alpha.28)
View SourceMaps Bonfire User objects to Mastodon Suggestion format.
Suggestions represent accounts that are recommended for the user to follow. See: https://docs.joinmastodon.org/entities/Suggestion/
Summary
Functions
Transform a Bonfire User into a Mastodon Suggestion.
Transform a list of Bonfire Users into Mastodon Suggestions.
Functions
Transform a Bonfire User into a Mastodon Suggestion.
Options
:source- The suggestion source (default: "global"):sources- List of suggestion sources (default: ["global"])- All other options are passed to Account.from_user/2
Examples
iex> from_user(%{id: "123", character: %{username: "alice"}})
%{"source" => "global", "sources" => ["global"], "account" => %{...}}
iex> from_user(nil)
nil
Transform a list of Bonfire Users into Mastodon Suggestions.
Options
Same as from_user/2, applied to all users.
Examples
iex> from_users([%{id: "1"}, %{id: "2"}])
[%{"source" => "global", ...}, %{"source" => "global", ...}]