2022-01-20 12:48:16 +00:00
|
|
|
# Akkoma: A lightweight social networking server
|
|
|
|
# Copyright © 2022-2022 Akkoma Authors <https://git.ihatebeinga.live/IHBAGang/akkoma/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-12-13 20:27:35 +00:00
|
|
|
defmodule Pleroma.Elasticsearch.DocumentMappings.User do
|
|
|
|
def id(obj), do: obj.id
|
|
|
|
|
|
|
|
def encode(%{actor_type: "Person"} = user) do
|
|
|
|
%{
|
|
|
|
timestamp: user.inserted_at,
|
|
|
|
instance: URI.parse(user.ap_id).host,
|
|
|
|
nickname: user.nickname,
|
2021-12-14 13:53:46 +00:00
|
|
|
bio: user.bio,
|
|
|
|
display_name: user.name
|
2021-12-13 20:27:35 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|