View Source Mobilizon.Actors.Actor (Mobilizon v5.0.0-beta.1)

Represents an actor (local and remote).

Summary

Functions

Returns the display name if available, or the preferred username (with the eventual @domain suffix if it's a distant actor).

Returns display name and username.

Changeset for group creation

Returns the preferred username with the eventual @domain suffix if it's a distant actor.

Checks whether actor visibility is public.

Changeset for person registration.

Changeset for remote actor creation.

Types

@type t() :: %Mobilizon.Actors.Actor{
  __meta__: term(),
  avatar: Mobilizon.Medias.File.t() | nil,
  banner: Mobilizon.Medias.File.t() | nil,
  comments: [Mobilizon.Discussions.Comment.t()],
  conversations: term(),
  created_reports: [Mobilizon.Reports.Report.t()],
  discussions_url: term(),
  domain: String.t() | nil,
  events_url: String.t(),
  feed_tokens: [Mobilizon.Events.FeedToken.t()],
  followers: [Mobilizon.Actors.Follower.t()],
  followers_url: String.t(),
  following_url: String.t(),
  followings: [Mobilizon.Actors.Follower.t()],
  id: integer(),
  inbox_url: String.t(),
  inserted_at: term(),
  keys: String.t(),
  last_refreshed_at: DateTime.t(),
  manually_approves_followers: boolean(),
  members_url: term(),
  memberships: [t()],
  mentions: [Mobilizon.Mention.t()],
  name: String.t() | nil,
  openness: atom(),
  organized_events: [Mobilizon.Events.Event.t()],
  outbox_url: String.t(),
  owner_shares: [Mobilizon.Share.t()],
  participations: [Mobilizon.Events.Participant.t()],
  physical_address: Mobilizon.Addresses.Address.t(),
  physical_address_id: term(),
  posts_url: String.t(),
  preferred_username: String.t(),
  report_notes: [Mobilizon.Reports.Note.t()],
  resources_url: String.t(),
  shared_inbox_url: String.t(),
  shares: [Mobilizon.Share.t()],
  subject_reports: [Mobilizon.Reports.Report.t()],
  summary: String.t(),
  suspended: boolean(),
  todos_url: term(),
  type: atom(),
  updated_at: term(),
  url: String.t(),
  user: Mobilizon.Users.User.t() | nil,
  user_id: term(),
  visibility: atom()
}

Functions

Link to this function

build_anonymous_actor_creation_attrs()

View Source
@spec build_anonymous_actor_creation_attrs() :: Ecto.Changeset.t()
Link to this function

build_relay_creation_attrs()

View Source
@spec build_relay_creation_attrs() :: Ecto.Changeset.t()
Link to this function

build_url(preferred_username, endpoint, args \\ [])

View Source
@spec build_url(String.t(), atom(), keyword()) :: String.t()

Builds an AP URL for an actor.

@spec display_name(t()) :: String.t()

Returns the display name if available, or the preferred username (with the eventual @domain suffix if it's a distant actor).

Link to this function

display_name_and_username(actor)

View Source
@spec display_name_and_username(t()) :: String.t()

Returns display name and username.

Link to this function

group_creation_changeset(actor, params)

View Source
@spec group_creation_changeset(t() | Ecto.Schema.t(), map()) :: Ecto.Changeset.t()

Changeset for group creation

Link to this function

preferred_username_and_domain(actor)

View Source
@spec preferred_username_and_domain(t()) :: String.t()

Returns the preferred username with the eventual @domain suffix if it's a distant actor.

Link to this function

public_visibility?(actor)

View Source
@spec public_visibility?(t()) :: boolean()

Checks whether actor visibility is public.

Link to this function

registration_changeset(actor, attrs)

View Source
@spec registration_changeset(t() | Ecto.Schema.t(), map()) :: Ecto.Changeset.t()

Changeset for person registration.

Link to this function

remote_actor_creation_changeset(attrs)

View Source
@spec remote_actor_creation_changeset(map()) :: Ecto.Changeset.t()

Changeset for remote actor creation.