diff options
author | Joas Schilling <coding@schilljs.com> | 2021-05-31 14:47:57 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-08-24 17:55:33 +0300 |
commit | 7accfeef9853fff1f73d69df1925bf111278d69f (patch) | |
tree | cd37287230e38324ae0aed967b616202bb18b2e5 /lib | |
parent | df185fba5f076c640e67524c5f19ee53a4a00cd9 (diff) |
Don't count groups and circles as attendees for count checks
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Model/AttendeeMapper.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index 9a57c7887..1c689805b 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -131,9 +131,11 @@ class AttendeeMapper extends QBMapper { $query = $this->db->getQueryBuilder(); $query->select($query->func()->count('*', 'num_actors')) ->from($this->getTableName()) - ->where($query->expr()->eq('room_id', $query->createNamedParameter($roomId, IQueryBuilder::PARAM_INT))); - - // TODO Should exclude groups and circles when we add them + ->where($query->expr()->eq('room_id', $query->createNamedParameter($roomId, IQueryBuilder::PARAM_INT))) + ->andWhere($query->expr()->notIn('actor_type', $query->createNamedParameter([ + Attendee::ACTOR_CIRCLES, + Attendee::ACTOR_GROUPS, + ], IQueryBuilder::PARAM_STR_ARRAY))); if (!empty($participantType)) { $query->andWhere($query->expr()->in('participant_type', $query->createNamedParameter($participantType, IQueryBuilder::PARAM_INT_ARRAY))); |