diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-03-05 20:27:07 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-03-05 20:27:07 +0300 |
commit | d6b29b85b2e4935df1fc8498b69de77a5da4573a (patch) | |
tree | 1846da7a60b6f33bf67fdd05e4845fa80f3e7cd4 /lib | |
parent | 8395c38ec2e7923d9d35e64c4e536e09eec24156 (diff) | |
parent | 12b4a7d848da1bf5d72db31f1a3b7e42c09af590 (diff) |
Merge branch 'master' of github.com:/nextcloud/mail into feature/account-settings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Db/AliasMapper.php | 14 | ||||
-rw-r--r-- | lib/Service/AccountService.php | 2 | ||||
-rw-r--r-- | lib/Service/AliasesService.php | 4 |
3 files changed, 7 insertions, 13 deletions
diff --git a/lib/Db/AliasMapper.php b/lib/Db/AliasMapper.php index ce46fe5d1..6c9eabe8f 100644 --- a/lib/Db/AliasMapper.php +++ b/lib/Db/AliasMapper.php @@ -71,18 +71,12 @@ class AliasMapper extends QBMapper { * @param int $accountId the account whose aliases will be deleted * @param string $currentUserId the user that is currently logged in */ - public function deleteAll($accountId, $currentUserId) { + public function deleteAll($accountId) { $qb = $this->db->getQueryBuilder(); - $query = $qb->delete($this->getTableName(), 'aliases') - ->join('aliases', 'mail_accounts', 'accounts', $qb->expr()->eq('aliases.account_id', 'accounts.id')) - ->where($qb->expr()->eq('account_id', $qb->createNamedParameter($accountId))) - ->andWhere( - $qb->expr()->andX( - $qb->expr()->eq('accounts.user_id', $qb->createNamedParameter($currentUserId)), - $qb->expr()->eq('aliases.account_id', $qb->createNamedParameter($accountId)) - ) - ); + $query = $qb + ->delete($this->getTableName()) + ->where($qb->expr()->eq('account_id', $qb->createNamedParameter($accountId))); $query->execute(); } diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php index ad5f93b78..c3cfec3b2 100644 --- a/lib/Service/AccountService.php +++ b/lib/Service/AccountService.php @@ -115,9 +115,9 @@ class AccountService { if ($accountId === Manager::ACCOUNT_ID) { return; } - $this->aliasesService->deleteAll($accountId, $currentUserId); $mailAccount = $this->mapper->find($currentUserId, $accountId); + $this->aliasesService->deleteAll($accountId); $this->mapper->delete($mailAccount); } diff --git a/lib/Service/AliasesService.php b/lib/Service/AliasesService.php index 8c696556d..01ee5a338 100644 --- a/lib/Service/AliasesService.php +++ b/lib/Service/AliasesService.php @@ -83,7 +83,7 @@ class AliasesService { * @param int $accountId the account which aliases will be deleted * @param string $currentUserId the user whom the account belongs to */ - public function deleteAll($accountId, $currentUserId) { - $this->mapper->deleteAll($accountId, $currentUserId); + public function deleteAll($accountId) { + $this->mapper->deleteAll($accountId); } } |