diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-26 13:27:45 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 12:38:50 +0300 |
commit | 8cdcf5aa74a404e492cad5c5f82971e18b3af59d (patch) | |
tree | e52c5aa5f40c8147416004be8439d3dc23effb67 /lib/Manager.php | |
parent | b7a677ee5d63ac38119f9657c1714d62204d757f (diff) |
Only return rooms with an attendee match
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r-- | lib/Manager.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Manager.php b/lib/Manager.php index fbe6a35ca..51b4e036c 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -302,7 +302,8 @@ class Manager { $query->expr()->eq('a.actor_id', $query->createNamedParameter($userId)), $query->expr()->eq('a.actor_type', $query->createNamedParameter('users')), $query->expr()->eq('a.room_id', 'r.id') - )); + )) + ->where($query->expr()->isNotNull('a.id')); if ($includeLastMessage) { $this->loadLastMessageInfo($query); @@ -345,12 +346,13 @@ class Manager { if ($userId !== null) { // Non guest user $query->addSelect('a.*') - ->selectAlias('a.id', 'a_id'); - $query->leftJoin('r', 'talk_attendees', 'a', $query->expr()->andX( + ->selectAlias('a.id', 'a_id') + ->leftJoin('r', 'talk_attendees', 'a', $query->expr()->andX( $query->expr()->eq('a.actor_id', $query->createNamedParameter($userId)), $query->expr()->eq('a.actor_type', $query->createNamedParameter('users')), $query->expr()->eq('a.room_id', 'r.id') - )); + )) + ->andWhere($query->expr()->isNotNull('a.id')); } $result = $query->execute(); |