From 54cc20c127455c9e5b02dfefadc6260dcdb59f78 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 15 Apr 2024 12:29:22 +0200 Subject: [PATCH] fix(Contexts): fetch share information also as sender, not only recipient Signed-off-by: Arthur Schiwon --- lib/Db/ContextMapper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Db/ContextMapper.php b/lib/Db/ContextMapper.php index 4e17ce4d2..964e3d515 100644 --- a/lib/Db/ContextMapper.php +++ b/lib/Db/ContextMapper.php @@ -253,6 +253,10 @@ public function findAllContainingNode(int $nodeType, int $nodeId, string $userId protected function applyOwnedOrSharedQuery(IQueryBuilder $qb, string $userId): void { $sharedToConditions = $qb->expr()->orX(); + // shared by user clause + $userInitiatedShare = $qb->expr()->eq('s.sender', $qb->createNamedParameter($userId)); + $sharedToConditions->add($userInitiatedShare); + // shared to user clause $userShare = $qb->expr()->andX( $qb->expr()->eq('s.receiver_type', $qb->createNamedParameter('user')),