1 defmodule Pleroma.User do
9 field :nickname, :string
10 field :password_hash, :string
11 field :following, { :array, :string }, default: []
17 def ap_id(%User{nickname: nickname}) do
19 Application.get_env(:pleroma, Pleroma.Web.Endpoint)
20 |> Keyword.fetch!(:url)
21 |> Keyword.fetch!(:host)
23 "https://#{host}/users/#{nickname}"
26 def ap_followers(%User{} = user) do
27 "#{ap_id(user)}/followers"