View Source ActivityPub (bonfire v0.3.0-classic-beta.4)
ActivityPub API
In general, the functions in this module take object-like formatted struct as the input for actor parameters.
Use the functions in the ActivityPub.Actor
module (ActivityPub.Actor.get_by_ap_id/1
for example) to retrieve those.
Link to this section 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.
Generates and federates a Reject activity via the data passed through params
.
Generates and federates an Unfollow activity.
Link to this section 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
.
announce(actor, object, activity_id \\ nil, local \\ true, public \\ true, summary \\ nil)
View Source@spec announce( ActivityPub.Actor.t(), ActivityPub.Object.t(), activity_id :: binary() | nil, local :: boolean(), public :: boolean(), summary :: binary() | nil ) :: {:ok, activity :: ActivityPub.Object.t(), object :: ActivityPub.Object.t()} | {:error, any()}
@spec block( blocker :: ActivityPub.Actor.t(), blocked :: ActivityPub.Actor.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, ActivityPub.Object.t()} | {:error, any()}
Generates and federates a Create activity via the data passed through params
.
@spec delete( ActivityPub.Actor.t(), local :: boolean(), delete_actor :: binary() | nil ) :: {:ok, ActivityPub.Object.t()} | {:error, any()}
@spec delete(ActivityPub.Object.t(), local :: boolean(), delete_actor :: binary()) :: {:ok, ActivityPub.Object.t()} | {:error, any()}
@spec follow( follower :: ActivityPub.Actor.t(), follower :: ActivityPub.Actor.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, ActivityPub.Object.t()} | {:error, any()}
Generates and federates a Follow activity.
Note: the follow should be reflected on the host database side only after receiving an Accept
activity in response!
@spec like( ActivityPub.Actor.t(), ActivityPub.Object.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, activity :: ActivityPub.Object.t(), object :: ActivityPub.Object.t()} | {:error, any()}
@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
.
@spec unannounce( ActivityPub.Actor.t(), ActivityPub.Object.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, unannounce_activity :: ActivityPub.Object.t(), object :: ActivityPub.Object.t()} | {:error, any()}
@spec unblock( blocker :: ActivityPub.Actor.t(), blocked :: ActivityPub.Actor.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, ActivityPub.Object.t()} | {:error, any()}
@spec unfollow( follower :: ActivityPub.Actor.t(), follower :: ActivityPub.Actor.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, ActivityPub.Object.t()} | {:error, any()}
Generates and federates an Unfollow activity.
@spec unlike( ActivityPub.Actor.t(), ActivityPub.Object.t(), activity_id :: binary() | nil, local :: boolean() ) :: {:ok, unlike_activity :: ActivityPub.Object.t(), like_activity :: ActivityPub.Object.t(), object :: ActivityPub.Object.t()} | {:error, any()}
@spec update(%{ :to => [any()], :cc => [any()], :actor => ActivityPub.Actor.t(), :object => map(), optional(atom()) => any() }) :: {:ok, ActivityPub.Object.t()} | {:error, any()}