From 001aff629866549a00daaeab05d427c5f3711949 Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 26 Aug 2020 01:50:24 +0200 Subject: [PATCH] Restrict member count in group list to public members --- PluralKit.Core/Database/Views/views.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PluralKit.Core/Database/Views/views.sql b/PluralKit.Core/Database/Views/views.sql index 20f5ac1a..bd1f88ad 100644 --- a/PluralKit.Core/Database/Views/views.sql +++ b/PluralKit.Core/Database/Views/views.sql @@ -58,6 +58,11 @@ from members; create view group_list as select groups.*, - -- Find group member count - (select count(*) from group_members where group_id = groups.id) as member_count + -- Find public group member count + ( + select count(*) from group_members + inner join members on group_members.member_id = members.id + where + group_members.group_id = groups.id and members.member_visibility = 1 + ) as member_count from groups; \ No newline at end of file