Pleroma v1.1.9-10-g42f76306+dev Pleroma.User View Source
Link to this section Summary
Functions
Fetch some posts when the user has just been federated with
A mass follow for local users. Respects blocks in both directions but does not create activities.
Creates an internal service actor by URI if missing. Optionally takes nickname for addressing.
Gets or fetch a user by uri or nickname.
The function returns a query to get users with no activity for given interval of days.
Inactive users are those who didn't read any notification, or had any activity where
the user is the activity's actor, during inactivity_threshold
days.
Deactivated users will not appear in this list.
Inserts provided changeset, performs post-registration actions (confirmation email sending etc.)
Enable or disable email notifications for user
Set last_digest_emailed_at
value for the user to current time
Link to this section Types
t()
View Sourcet() :: %Pleroma.User{ __meta__: term(), ap_id: term(), avatar: term(), bio: term(), email: term(), follower_address: term(), following: term(), following_address: term(), id: term(), info: term(), inserted_at: term(), keys: term(), last_digest_emailed_at: term(), last_refreshed_at: term(), local: term(), name: term(), nickname: term(), notifications: term(), password: term(), password_confirmation: term(), password_hash: term(), registrations: term(), search_rank: term(), search_type: term(), tags: term(), updated_at: term() }
Link to this section Functions
blocked_users(user)
View Sourceblocked_users(Pleroma.User.t()) :: [Pleroma.User.t()]
external_users(opts \\ [])
View Sourceexternal_users(keyword()) :: [Pleroma.User.t()]
Fetch some posts when the user has just been federated with
follow_all(follower, followeds)
View Sourcefollow_all(Pleroma.User.t(), [Pleroma.User.t()]) :: {atom(), Pleroma.User.t()}
A mass follow for local users. Respects blocks in both directions but does not create activities.
following?(follower, followed)
View Sourcefollowing?(Pleroma.User.t(), Pleroma.User.t()) :: boolean()
get_external_followers(user, page \\ nil)
View Sourceget_external_followers(Pleroma.User.t(), pos_integer()) :: {:ok, [Pleroma.User.t()]}
get_follow_requests(user)
View Sourceget_follow_requests(Pleroma.User.t()) :: {:ok, [Pleroma.User.t()]}
get_followers(user, page \\ nil)
View Sourceget_followers(Pleroma.User.t(), pos_integer()) :: {:ok, [Pleroma.User.t()]}
get_followers_query(user)
View Sourceget_followers_query(Pleroma.User.t()) :: Ecto.Query.t()
get_followers_query(user, page)
View Sourceget_followers_query(Pleroma.User.t(), pos_integer() | nil) :: Ecto.Query.t()
get_friends_query(user)
View Sourceget_friends_query(Pleroma.User.t()) :: Ecto.Query.t()
get_friends_query(user, page)
View Sourceget_friends_query(Pleroma.User.t(), pos_integer() | nil) :: Ecto.Query.t()
Creates an internal service actor by URI if missing. Optionally takes nickname for addressing.
get_or_fetch(uri)
View Sourceget_or_fetch(String.t()) :: {:ok, Pleroma.User.t()} | {:error, String.t()}
Gets or fetch a user by uri or nickname.
get_recipients_from_activity(activity)
View Sourceget_recipients_from_activity(Pleroma.Activity.t()) :: [Pleroma.User.t()]
get_users_from_set(ap_ids, local_only \\ true)
View Sourceget_users_from_set([String.t()], boolean()) :: [Pleroma.User.t()]
list_inactive_users_query(inactivity_threshold \\ 7)
View Sourcelist_inactive_users_query(integer()) :: Ecto.Query.t()
The function returns a query to get users with no activity for given interval of days.
Inactive users are those who didn't read any notification, or had any activity where
the user is the activity's actor, during inactivity_threshold
days.
Deactivated users will not appear in this list.
Examples
iex> Pleroma.User.list_inactive_users()
%Ecto.Query{}
maybe_direct_follow(follower, followed)
View Sourcemaybe_direct_follow(Pleroma.User.t(), Pleroma.User.t()) :: {:ok, Pleroma.User.t()} | {:error, String.t()}
maybe_fetch_follow_information(user)
View Sourcemaybe_fetch_follow_information(Pleroma.User.t()) :: Pleroma.User.t()
maybe_update_following_count(user)
View Sourcemaybe_update_following_count(Pleroma.User.t()) :: Pleroma.User.t()
mute(muter, user, notifications? \\ true)
View Sourcemute(Pleroma.User.t(), Pleroma.User.t(), boolean()) :: {:ok, Pleroma.User.t()} | {:error, String.t()}
muted_notifications?(user, arg2)
View Sourcemuted_notifications?(Pleroma.User.t() | nil, Pleroma.User.t() | map()) :: boolean()
muted_users(user)
View Sourcemuted_users(Pleroma.User.t()) :: [Pleroma.User.t()]
perform(atom, user)
View Sourceperform(atom(), Pleroma.User.t()) :: {:ok, Pleroma.User.t()}
perform(atom(), Pleroma.User.t()) :: {:ok, Pleroma.User.t()}
perform(atom, user, status)
View Sourceperform(atom(), Pleroma.User.t(), list()) :: list() | {:error, any()}
perform(atom(), Pleroma.User.t(), list()) :: list() | {:error, any()}
Inserts provided changeset, performs post-registration actions (confirmation email sending etc.)
reset_password(user, data)
View Sourcereset_password(Pleroma.User.t(), map()) :: {:ok, Pleroma.User.t()} | {:error, Ecto.Changeset.t()}
restrict_deactivated(query)
View Sourcerestrict_deactivated(Ecto.Query.t()) :: Ecto.Query.t()
subscribers(user)
View Sourcesubscribers(Pleroma.User.t()) :: [Pleroma.User.t()]
switch_email_notifications(user, type, status)
View Sourceswitch_email_notifications(t(), String.t(), boolean()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Enable or disable email notifications for user
Examples
iex> Pleroma.User.switch_email_notifications(Pleroma.User{info: %{email_notifications: %{"digest" => false}}}, "digest", true)
Pleroma.User{info: %{email_notifications: %{"digest" => true}}}
iex> Pleroma.User.switch_email_notifications(Pleroma.User{info: %{email_notifications: %{"digest" => true}}}, "digest", false)
Pleroma.User{info: %{email_notifications: %{"digest" => false}}}
toggle_confirmation(user)
View Sourcetoggle_confirmation(Pleroma.User.t()) :: {:ok, Pleroma.User.t()} | {:error, Changeset.t()}
Set last_digest_emailed_at
value for the user to current time