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
1 changed files with 2 additions and 1 deletions

View File

@ -61,8 +61,9 @@ def info_changeset(struct, params \\ %{}) do
end end
def user_info(%User{} = user) do 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, note_count: user.info["note_count"] || 0,
follower_count: user.info["follower_count"] || 0 follower_count: user.info["follower_count"] || 0
} }