diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2021-01-28 22:23:10 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2021-01-28 22:23:10 +0400 |
commit | a51d903e0c8c87247df6b3cdecc476269edf58ce (patch) | |
tree | f85f1b8cf7db27d91e2b193bbcd8c57e71800797 /lib | |
parent | 13a2ae8ce0f6eb642ef9d6b8fb2cc08e712385c5 (diff) | |
download | pleroma-a51d903e0c8c87247df6b3cdecc476269edf58ce.tar.gz |
Make sure active_user_count/1 counts only local users
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 1dde65335..06cdb42af 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2446,7 +2446,7 @@ defmodule Pleroma.User do URI.parse(ap_id).host end - def update_last_active_at(user) do + def update_last_active_at(%__MODULE__{local: true} = user) do user |> cast(%{last_active_at: NaiveDateTime.utc_now()}, [:last_active_at]) |> update_and_set_cache() @@ -2457,6 +2457,7 @@ defmodule Pleroma.User do __MODULE__ |> where([u], u.last_active_at >= ^active_after) + |> where([u], u.local == true) |> Repo.aggregate(:count) end end |