- status_count = Repo.one(status_query)
- user_count = Repo.aggregate(User.local_user_query(), :count, :id)
+ users_query =
+ from(u in User,
+ where: u.deactivated != true,
+ where: u.local == true,
+ where: not is_nil(u.nickname),
+ where: not u.invisible
+ )
+
+ user_count = Repo.aggregate(users_query, :count, :id)
+
+ %{
+ peers: peers,
+ stats: %{
+ domain_count: domain_count,
+ status_count: status_count || 0,
+ user_count: user_count
+ }
+ }
+ end