diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-01-16 11:07:46 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-01-16 11:07:46 +0300 |
commit | 90433b988e4d9519e0d2368452aefdb0dc565b52 (patch) | |
tree | 84aaf248771dbcc40b135bcc35297b822398e17c /lib | |
parent | de1da7b3d1c855df87262b8d24d6cdb6a6a518bc (diff) | |
download | pleroma-90433b988e4d9519e0d2368452aefdb0dc565b52.tar.gz |
[#518] Fixed /api/v1/instance ("domain_count" value) and /api/v1/instance/peers responses.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/stats.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex index 8a030ecd0..65a6d58b5 100644 --- a/lib/pleroma/stats.ex +++ b/lib/pleroma/stats.ex @@ -34,10 +34,11 @@ defmodule Pleroma.Stats do peers = from( u in Pleroma.User, - select: fragment("distinct ?->'host'", u.info), + select: fragment("distinct split_part(?, '@', 2)", u.nickname), where: u.local != ^true ) |> Repo.all() + |> Enum.filter(& &1) domain_count = Enum.count(peers) |