mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-07 15:27:43 +08:00
MessageExpunge should be FolderExpunge
And simplify the function parameters
This commit is contained in:
parent
e31b4f4b75
commit
7dec51a364
2 changed files with 10 additions and 10 deletions
|
@ -944,20 +944,20 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
}
|
||||
|
||||
/**
|
||||
* The EXPUNGE command permanently removes all messages that have the
|
||||
* \Deleted flag set from the currently selected mailbox.
|
||||
*
|
||||
* @throws \MailSo\Net\Exceptions\Exception
|
||||
* @throws \MailSo\Imap\Exceptions\Exception
|
||||
*/
|
||||
public function MessageExpunge(string $sUidRangeIfSupported = '', bool $bForceUidExpunge = false, bool $bExpungeAll = false) : self
|
||||
public function FolderExpunge(SequenceSet $oUidRange = null) : self
|
||||
{
|
||||
$sUidRangeIfSupported = \trim($sUidRangeIfSupported);
|
||||
|
||||
$sCmd = 'EXPUNGE';
|
||||
$aArguments = array();
|
||||
|
||||
if (!$bExpungeAll && $bForceUidExpunge && \strlen($sUidRangeIfSupported) && $this->IsSupported('UIDPLUS'))
|
||||
{
|
||||
if ($oUidRange && \count($oUidRange) && $oRange->UID && $this->IsSupported('UIDPLUS')) {
|
||||
$sCmd = 'UID '.$sCmd;
|
||||
$aArguments = array($sUidRangeIfSupported);
|
||||
$aArguments = array((string) $oUidRange);
|
||||
}
|
||||
|
||||
$this->SendRequestGetResponse($sCmd, $aArguments);
|
||||
|
|
|
@ -390,10 +390,10 @@ class MailClient
|
|||
StoreAction::ADD_FLAGS_SILENT
|
||||
);
|
||||
|
||||
if ($oRange->UID) {
|
||||
$this->oImapClient->MessageExpunge((string) $oRange, true, $bExpungeAll);
|
||||
if ($bExpungeAll) {
|
||||
$this->oImapClient->FolderExpunge();
|
||||
} else {
|
||||
$this->oImapClient->MessageExpunge('', false, $bExpungeAll);
|
||||
$this->oImapClient->FolderExpunge($oRange);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -1390,7 +1390,7 @@ class MailClient
|
|||
StoreAction::ADD_FLAGS_SILENT
|
||||
);
|
||||
|
||||
$this->oImapClient->MessageExpunge();
|
||||
$this->oImapClient->FolderExpunge();
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Reference in a new issue