fix intro.cid and intro.suggest-id

This commit is contained in:
Philipp 2021-10-19 23:11:47 +02:00
parent b4572a5293
commit 44627a0b12
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
5 changed files with 32 additions and 24 deletions

View file

@ -147,12 +147,20 @@ class Introduction extends BaseDepository
}
}
public function existsForContact(int $cid, int $uid): bool
/**
* Checks, if the suggested contact already exists for the user
*
* @param int $sid
* @param int $uid
*
* @return bool
*/
public function suggestionExistsForUser(int $sid, int $uid): bool
{
try {
return $this->exists(['uid' => $uid, 'suggest-cid' => $cid]);
return $this->exists(['uid' => $uid, 'suggest-cid' => $sid]);
} catch (\Exception $e) {
throw new IntroductionPersistenceException(sprintf('Cannot check Introductions for contact %d and user %d', $cid, $uid), $e);
throw new IntroductionPersistenceException(sprintf('Cannot check suggested Introduction for contact %d and user %d', $sid, $uid), $e);
}
}