Basic status creation and retrieval.
This commit is contained in:
parent
8de523c8ae
commit
9a8850eb9e
14 changed files with 272 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
defmodule Pleroma.User do
|
||||
use Ecto.Schema
|
||||
alias Pleroma.User
|
||||
|
||||
schema "users" do
|
||||
field :bio, :string
|
||||
|
|
@ -7,7 +8,22 @@ defmodule Pleroma.User do
|
|||
field :name, :string
|
||||
field :nickname, :string
|
||||
field :password_hash, :string
|
||||
field :following, { :array, :string }, default: []
|
||||
field :ap_id, :string
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
def ap_id(%User{nickname: nickname}) do
|
||||
host =
|
||||
Application.get_env(:pleroma, Pleroma.Web.Endpoint)
|
||||
|> Keyword.fetch!(:url)
|
||||
|> Keyword.fetch!(:host)
|
||||
|
||||
"https://#{host}/users/#{nickname}"
|
||||
end
|
||||
|
||||
def ap_followers(%User{} = user) do
|
||||
"#{ap_id(user)}/followers"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue