Skip to content

Commit

Permalink
fix(Contexts): fetch share information also as sender, not only recip…
Browse files Browse the repository at this point in the history
…ient

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz authored and enjeck committed Apr 19, 2024
1 parent ec69cc0 commit d164cb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Db/ContextMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
Expand Down

0 comments on commit d164cb2

Please sign in to comment.