View Source Mobilizon.Federation.ActivityPub.Actions.Create (Mobilizon v5.0.0-beta.1)

Create things

Summary

Types

@type create_entities() ::
  :event
  | :comment
  | :discussion
  | :conversation
  | :actor
  | :todo_list
  | :todo
  | :resource
  | :post

Functions

Link to this function

create(type, args, local \\ false, additional \\ %{})

View Source
@spec create(create_entities(), map(), boolean(), map()) ::
  {:ok, Mobilizon.Federation.ActivityPub.Activity.t(), Entity.t()}
  | {:error, :entity_tombstoned | atom() | Ecto.Changeset.t()}

Create an activity of type Create

  • Creates the object, which returns AS data
  • Wraps ActivityStreams data into a Create activity
  • Creates an Mobilizon.Federation.ActivityPub.Activity from this
  • Federates (asynchronously) the activity
  • Returns the activity