View Source ActivityPub (bonfire_umbrella v0.9.10-cooperation-beta.62)

Entrypoint to the ActivityPub API for processing incoming and outgoing federated objects (normalising, saving the the Object storage, passing them to the adapter, and queueing outgoing activities to be pushed out).

In general, the functions in this module take object-like map. That includes a struct as the input for actor parameters. Use the functions in the ActivityPub.Actor module (ActivityPub.Actor.get_cached/1 for example) to retrieve those.

Summary

Functions

Generates and federates an Accept activity via the data passed through params.

Generates and federates a Create activity via the data passed through params.

Generates and federates a Follow activity.

Record a Like

Generates and federates a Reject activity via the data passed through params.

Generates and federates an Unfollow activity.

Functions

@spec accept(%{
  :to => [any()],
  :actor => ActivityPub.Actor.t(),
  :object => map() | binary(),
  optional(atom()) => any()
}) :: {:ok, ActivityPub.Object.t()} | {:error, any()}

Generates and federates an Accept activity via the data passed through params.

@spec create(%{
  :to => [any()],
  :actor => ActivityPub.Actor.t(),
  :context => binary(),
  :object => map(),
  optional(atom()) => any()
}) :: {:ok, ActivityPub.Object.t()} | {:error, any()}

Generates and federates a Create activity via the data passed through params.

Link to this function

delete(object, is_local?, opts \\ [])

View Source
@spec flag(%{
  :actor => ActivityPub.Actor.t(),
  :context => binary(),
  :account => ActivityPub.Actor.t(),
  :statuses => [any()],
  :content => binary(),
  optional(atom()) => any()
}) :: {:ok, ActivityPub.Object.t()} | {:error, any()}

Generates and federates a Follow activity.

Note: the follow should be reflected as a Follow on the host database side only after receiving an Accept activity in response (though you could register it as a Request if your app has that concept)

Record a Like

Link to this function

move(origin, target, local \\ true, recursing \\ false)

View Source
@spec reject(%{to: [any()], actor: ActivityPub.Actor.t(), object: binary()}) ::
  {:ok, ActivityPub.Object.t()} | {:error, any()}

Generates and federates a Reject activity via the data passed through params.

Generates and federates an Unfollow activity.