View Source ActivityPub.Actor (bonfire v0.3.4-classic-beta.4)

An ActivityPub Actor type and functions for dealing with actors.

Link to this section Summary

Link to this section Types

@type t() :: %ActivityPub.Actor{
  ap_id: term(),
  data: term(),
  deactivated: term(),
  id: term(),
  keys: term(),
  local: term(),
  pointer_id: term(),
  username: term()
}

Link to this section Functions

Link to this function

ensure_keys_present(actor)

View Source

Checks if an actor struct has a non-nil keys field and generates a PEM if it doesn't.

Link to this function

fetch_by_username(username)

View Source

Fetches a remote actor by username in username@domain.tld format

Link to this function

format_remote_actor(actor)

View Source
Link to this function

get_actor_from_follow(follow)

View Source
Link to this function

get_and_format_collections_for_actor(actor)

View Source
Link to this function

get_and_format_resources_for_actor(actor)

View Source
@spec get_by_ap_id(String.t()) :: {:ok, t()} | {:error, any()}

Fetches an actor given its AP ID.

Remote actors are first checked if they exist in database and are fetched remotely if they don't.

Remote actors are also automatically updated every 24 hours.

Link to this function

get_by_username(username)

View Source

Fetches a local actor given its preferred username.

Link to this function

get_cached_by_ap_id!(ap_id)

View Source
Link to this function

get_cached_by_ap_id(ap_id)

View Source
Link to this function

get_cached_by_local_id(id)

View Source
Link to this function

get_cached_by_username(username)

View Source
Link to this function

get_community_ap_id(actor)

View Source
Link to this function

get_creator_ap_id(actor)

View Source
Link to this function

get_external_followers(actor)

View Source
Link to this function

get_or_fetch(username_or_uri)

View Source
Link to this function

get_or_fetch_by_ap_id(ap_id)

View Source
Link to this function

get_or_fetch_by_username(username)

View Source

Tries to get a local actor by username or tries to fetch it remotely if username is provided in username@domain.tld format.

Link to this function

get_public_key_for_ap_id(ap_id)

View Source

Fetches the public key for given actor AP ID.

Link to this function

maybe_create_actor_from_object(actor)

View Source
Link to this function

remote_users(actor, data)

View Source
@spec update_actor(String.t()) :: {:ok, t()} | {:error, any()}

Updates an existing actor struct by its AP ID.

Link to this function

update_actor_data_by_ap_id(ap_id, data)

View Source