Some $this->MailClient() to $this->ImapClient()

This commit is contained in:
the-djmaze 2023-02-16 09:01:14 +01:00
parent d98a2e015e
commit 1a05a0adf2
6 changed files with 22 additions and 21 deletions

View file

@ -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) {

View file

@ -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)
{

View file

@ -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 = [

View file

@ -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;
}

View file

@ -228,7 +228,7 @@ trait User
try
{
$aQuota = $this->MailClient()->QuotaRoot();
$aQuota = $this->ImapClient()->QuotaRoot();
}
catch (\Throwable $oException)
{

View file

@ -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) {