Don't show the user in their own following count.

This commit is contained in:
eal 2017-11-20 00:31:39 +02:00
parent 52aa65fe6e
commit aadf54e0df

View file

@ -61,8 +61,9 @@ def info_changeset(struct, params \\ %{}) do
end
def user_info(%User{} = user) do
oneself = if user.local, do: 1, else: 0
%{
following_count: length(user.following),
following_count: length(user.following) - oneself,
note_count: user.info["note_count"] || 0,
follower_count: user.info["follower_count"] || 0
}