From 1a05a0adf2d0a9e3162ebfb26acc50be88a39e01 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Thu, 16 Feb 2023 09:01:14 +0100 Subject: [PATCH] Some $this->MailClient() to $this->ImapClient() --- .../v/0.0.0/app/libraries/RainLoop/Actions.php | 8 ++++---- .../app/libraries/RainLoop/Actions/Folders.php | 16 ++++++++-------- .../app/libraries/RainLoop/Actions/Messages.php | 13 +++++++------ .../app/libraries/RainLoop/Actions/Response.php | 2 +- .../app/libraries/RainLoop/Actions/User.php | 2 +- .../app/libraries/RainLoop/Actions/UserAuth.php | 2 +- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 070016feb..731dbbf72 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -245,8 +245,8 @@ class Actions public function BootEnd(): void { try { - if ($this->MailClient()->IsLoggined()) { - $this->MailClient()->Disconnect(); + if ($this->ImapClient()->IsLoggined()) { + $this->ImapClient()->Disconnect(); } } catch (\Throwable $oException) { unset($oException); @@ -1094,9 +1094,9 @@ class Actions { $oAccount = $this->getAccountFromToken(); - if (!$this->MailClient()->IsLoggined()) { + if (!$this->ImapClient()->IsLoggined()) { try { - $oAccount->ImapConnectAndLogin($this->oPlugins, $this->MailClient()->ImapClient(), $this->oConfig); + $oAccount->ImapConnectAndLogin($this->oPlugins, $this->ImapClient(), $this->oConfig); } catch (\MailSo\Net\Exceptions\ConnectionException $oException) { throw new Exceptions\ClientException(Notifications::ConnectionError, $oException); } catch (\Throwable $oException) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php index e964e52c1..d05f31dcb 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php @@ -57,14 +57,14 @@ trait Folders $aQuota = null; if ($this->GetCapa(Capa::QUOTA)) { try { -// $aQuota = $this->MailClient()->Quota(); - $aQuota = $this->MailClient()->QuotaRoot(); +// $aQuota = $this->ImapClient()->Quota(); + $aQuota = $this->ImapClient()->QuotaRoot(); } catch (\Throwable $oException) { // ignore } } - $aCapabilities = \array_values(\array_filter($this->MailClient()->Capability(), function ($item) { + $aCapabilities = \array_values(\array_filter($this->ImapClient()->Capability(), function ($item) { return !\preg_match('/^(IMAP|AUTH|LOGIN|SASL)/', $item); })); @@ -73,7 +73,7 @@ trait Folders array( 'quotaUsage' => $aQuota ? $aQuota[0] * 1024 : null, 'quotaLimit' => $aQuota ? $aQuota[1] * 1024 : null, - 'namespace' => $this->MailClient()->GetPersonalNamespace(), + 'namespace' => $this->ImapClient()->GetPersonalNamespace(), 'capabilities' => $aCapabilities ) ); @@ -109,7 +109,7 @@ trait Folders $sFolderFullName = $this->GetActionParam('folder'); $sMetadataKey = $this->GetActionParam('key'); if ($sFolderFullName && $sMetadataKey) { - $this->MailClient()->FolderSetMetadata($sFolderFullName, [ + $this->ImapClient()->FolderSetMetadata($sFolderFullName, [ $sMetadataKey => $this->GetActionParam('value') ?: null ]); } @@ -125,7 +125,7 @@ trait Folders try { - $this->MailClient()->{$bSubscribe ? 'FolderSubscribe' : 'FolderUnsubscribe'}($sFolderFullName); + $this->ImapClient()->{$bSubscribe ? 'FolderSubscribe' : 'FolderUnsubscribe'}($sFolderFullName); } catch (\Throwable $oException) { @@ -231,7 +231,7 @@ trait Folders try { - $this->MailClient()->FolderDelete($this->GetActionParam('folder', '')); + $this->ImapClient()->FolderDelete($this->GetActionParam('folder', '')); } catch (\MailSo\Mail\Exceptions\NonEmptyFolder $oException) { @@ -254,7 +254,7 @@ trait Folders try { - $this->MailClient()->FolderClear($this->GetActionParam('folder', '')); + $this->ImapClient()->FolderClear($this->GetActionParam('folder', '')); } catch (\Throwable $oException) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php index 640ba0e48..c06c97fae 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php @@ -62,6 +62,7 @@ trait Messages $oAccount = $this->initMailClientConnection(); if ($sHash) { +// $oInfo = $this->MailClient()->FolderHash($oParams->sFolderName); $oInfo = $this->ImapClient()->FolderStatusAndSelect($oParams->sFolderName); $aRequestHash = \explode('-', $sHash); $sFolderHash = $oInfo->getHash($this->ImapClient()->Hash()); @@ -135,7 +136,7 @@ trait Messages $sMessageFolder = $this->GetActionParam('messageFolder', ''); $iMessageUid = (int) $this->GetActionParam('messageUid', 0); if (\strlen($sMessageFolder) && 0 < $iMessageUid) { - $this->MailClient()->MessageDelete($sMessageFolder, new SequenceSet($iMessageUid)); + $this->ImapClient()->MessageDelete($sMessageFolder, new SequenceSet($iMessageUid)); } if (null !== $iNewUid && 0 < $iNewUid) { @@ -250,7 +251,7 @@ trait Messages if (\strlen($sDraftFolder) && 0 < $iDraftUid) { try { - $this->MailClient()->MessageDelete($sDraftFolder, new SequenceSet($iDraftUid)); + $this->ImapClient()->MessageDelete($sDraftFolder, new SequenceSet($iDraftUid)); } catch (\Throwable $oException) { @@ -452,7 +453,7 @@ trait Messages try { - $this->MailClient()->MessageDelete($sFolder, new SequenceSet($aUids), true); + $this->ImapClient()->MessageDelete($sFolder, new SequenceSet($aUids), true); } catch (\Throwable $oException) { @@ -517,7 +518,7 @@ trait Messages try { - $this->MailClient()->MessageMove($sFromFolder, $sToFolder, $oUids); + $this->ImapClient()->MessageMove($sFromFolder, $sToFolder, $oUids); } catch (\Throwable $oException) { @@ -546,7 +547,7 @@ trait Messages try { - $this->MailClient()->MessageCopy( + $this->ImapClient()->MessageCopy( $this->GetActionParam('fromFolder', ''), $this->GetActionParam('toFolder', ''), new SequenceSet(\explode(',', (string) $this->GetActionParam('uids', ''))) @@ -651,7 +652,7 @@ trait Messages $oAccount = $this->initMailClientConnection(); - $oImapClient = $this->MailClient()->ImapClient(); + $oImapClient = $this->ImapClient(); $oImapClient->FolderExamine($sFolderName); $aParts = [ diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php index a80b8236f..9c8429314 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php @@ -191,7 +191,7 @@ trait Response if ($mResponse instanceof \MailSo\Imap\Folder) { $aResult = $mResponse->jsonSerialize(); - $sHash = $mResponse->Hash($this->MailClient()->ImapClient()->Hash()); + $sHash = $mResponse->Hash($this->ImapClient()->Hash()); if ($sHash) { $aResult['hash'] = $sHash; } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php index 35127a7d7..b42276e2a 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php @@ -228,7 +228,7 @@ trait User try { - $aQuota = $this->MailClient()->QuotaRoot(); + $aQuota = $this->ImapClient()->QuotaRoot(); } catch (\Throwable $oException) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php index 7d7282e60..77ba1bebc 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php @@ -413,7 +413,7 @@ trait UserAuth { try { if (!$oImapClient) { - $oImapClient = $this->MailClient()->ImapClient(); + $oImapClient = $this->ImapClient(); } $oAccount->ImapConnectAndLogin($this->Plugins(), $oImapClient, $this->Config()); } catch (ClientException $oException) {