summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-04-22 19:02:22 +0200
committerlain <lain@soykaf.club>2020-04-22 19:02:22 +0200
commitf5bda09de648a6de3151c8614005ebc70447facb (patch)
tree661fffe62d5534515960ee6213c85b727813a119
parent8b88e2a6e2b3a777ca99bf94676ab47f2d4cc0ea (diff)
Stats: Use `invisible` property for filtering.
-rw-r--r--lib/pleroma/stats.ex3
-rw-r--r--test/stats_test.exs1
2 files changed, 1 insertions, 3 deletions
diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex
index 6763786a7..8d2809bbb 100644
--- a/lib/pleroma/stats.ex
+++ b/lib/pleroma/stats.ex
@@ -82,8 +82,7 @@ defmodule Pleroma.Stats do
where: u.deactivated != true,
where: u.local == true,
where: not is_nil(u.nickname),
- where: fragment("? not like 'internal.%'", u.nickname),
- where: fragment("? not like '%/relay'", u.ap_id)
+ where: not u.invisible
)
user_count = Repo.aggregate(users_query, :count, :id)
diff --git a/test/stats_test.exs b/test/stats_test.exs
index 73c7c1495..c1aeb2c7f 100644
--- a/test/stats_test.exs
+++ b/test/stats_test.exs
@@ -11,7 +11,6 @@ defmodule Pleroma.StatsTest do
test "it ignores internal users" do
_user = insert(:user, local: true)
_internal = insert(:user, local: true, nickname: nil)
- _internal = insert(:user, local: true, nickname: "internal.dude")
_internal = Pleroma.Web.ActivityPub.Relay.get_actor()
assert match?(%{stats: %{user_count: 1}}, Pleroma.Stats.calculate_stat_data())