mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Fixed: Unselect folder (if supported) on [moving, deleting] (#846)
This commit is contained in:
parent
55e3bad890
commit
b5c1d8b665
3 changed files with 75 additions and 6 deletions
|
|
@ -966,6 +966,18 @@ class ImapClient extends \MailSo\Net\NetClient
|
||||||
return $this->selectOrExamineFolder($sFolderName, $this->__FORCE_SELECT_ON_EXAMINE__, $bReSelectSameFolders);
|
return $this->selectOrExamineFolder($sFolderName, $this->__FORCE_SELECT_ON_EXAMINE__, $bReSelectSameFolders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \MailSo\Imap\ImapClient
|
||||||
|
*
|
||||||
|
* @throws \MailSo\Net\Exceptions\Exception
|
||||||
|
* @throws \MailSo\Imap\Exceptions\Exception
|
||||||
|
*/
|
||||||
|
public function FolderUnSelect()
|
||||||
|
{
|
||||||
|
return $this->IsSelected() && $this->IsSupported('UNSELECT') ?
|
||||||
|
$this->SendRequestWithCheck('UNSELECT') : $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $aInputFetchItems
|
* @param array $aInputFetchItems
|
||||||
* @param string $sIndexRange
|
* @param string $sIndexRange
|
||||||
|
|
|
||||||
|
|
@ -637,6 +637,22 @@ class MailClient
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \MailSo\Mail\MailClient
|
||||||
|
*
|
||||||
|
* @throws \MailSo\Net\Exceptions\Exception
|
||||||
|
* @throws \MailSo\Imap\Exceptions\Exception
|
||||||
|
*/
|
||||||
|
public function FolderUnSelect()
|
||||||
|
{
|
||||||
|
if ($this->oImapClient->IsSelected())
|
||||||
|
{
|
||||||
|
$this->oImapClient->FolderUnSelect();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param resource $rMessageStream
|
* @param resource $rMessageStream
|
||||||
* @param int $iMessageStreamSize
|
* @param int $iMessageStreamSize
|
||||||
|
|
|
||||||
|
|
@ -7205,14 +7205,35 @@ class Actions
|
||||||
{
|
{
|
||||||
$this->MailClient()->MessageDelete($sFolder, $aFilteredUids, true, true,
|
$this->MailClient()->MessageDelete($sFolder, $aFilteredUids, true, true,
|
||||||
!!$this->Config()->Get('labs', 'use_imap_expunge_all_on_delete', false));
|
!!$this->Config()->Get('labs', 'use_imap_expunge_all_on_delete', false));
|
||||||
|
|
||||||
$sHash = $this->MailClient()->FolderHash($sFolder);
|
|
||||||
}
|
}
|
||||||
catch (\Exception $oException)
|
catch (\Exception $oException)
|
||||||
{
|
{
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantDeleteMessage, $oException);
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantDeleteMessage, $oException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->Config()->Get('labs', 'use_imap_unselect', true))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->MailClient()->FolderUnSelect();
|
||||||
|
}
|
||||||
|
catch (\Exception $oException)
|
||||||
|
{
|
||||||
|
unset($oException);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sHash = '';
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$sHash = $this->MailClient()->FolderHash($sFromFolder);
|
||||||
|
}
|
||||||
|
catch (\Exception $oException)
|
||||||
|
{
|
||||||
|
unset($oException);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, '' === $sHash ? false : array($sFolder, $sHash));
|
return $this->DefaultResponse(__FUNCTION__, '' === $sHash ? false : array($sFolder, $sHash));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7253,16 +7274,36 @@ class Actions
|
||||||
!!$this->Config()->Get('labs', 'use_imap_move', true),
|
!!$this->Config()->Get('labs', 'use_imap_move', true),
|
||||||
!!$this->Config()->Get('labs', 'use_imap_expunge_all_on_delete', false)
|
!!$this->Config()->Get('labs', 'use_imap_expunge_all_on_delete', false)
|
||||||
);
|
);
|
||||||
|
|
||||||
$sHash = $this->MailClient()->FolderHash($sFromFolder);
|
|
||||||
}
|
}
|
||||||
catch (\Exception $oException)
|
catch (\Exception $oException)
|
||||||
{
|
{
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantMoveMessage, $oException);
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantMoveMessage, $oException);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__,
|
if ($this->Config()->Get('labs', 'use_imap_unselect', true))
|
||||||
'' === $sHash ? false : array($sFromFolder, $sHash));
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->MailClient()->FolderUnSelect();
|
||||||
|
}
|
||||||
|
catch (\Exception $oException)
|
||||||
|
{
|
||||||
|
unset($oException);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sHash = '';
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$sHash = $this->MailClient()->FolderHash($sFromFolder);
|
||||||
|
}
|
||||||
|
catch (\Exception $oException)
|
||||||
|
{
|
||||||
|
unset($oException);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->DefaultResponse(__FUNCTION__, '' === $sHash ? false : array($sFromFolder, $sHash));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue