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 committed Apr 15, 2024
1 parent 31ae97c commit 96a45f0
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 @@ -219,6 +219,10 @@ public function findById(int $contextId, ?string $userId = null): Context {
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 96a45f0

Please sign in to comment.