Don't show the user in their own following count.
This commit is contained in:
parent
52aa65fe6e
commit
aadf54e0df
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue