mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Cleanup Folders() fetch
This commit is contained in:
parent
7c472943cf
commit
30a6f7f94a
1 changed files with 7 additions and 8 deletions
|
|
@ -911,13 +911,13 @@ class MailClient
|
||||||
if ($this->oImapClient->IsSupported('LIST-EXTENDED')) {
|
if ($this->oImapClient->IsSupported('LIST-EXTENDED')) {
|
||||||
$bUseListSubscribeStatus = false;
|
$bUseListSubscribeStatus = false;
|
||||||
} else if ($bUseListSubscribeStatus) {
|
} else if ($bUseListSubscribeStatus) {
|
||||||
//\SnappyMail\Log::warning('IMAP', 'RFC5258 not supported, using LSUB');
|
// $this->oLogger && $this->oLogger->Write('RFC5258 not supported, using LSUB');
|
||||||
|
// \SnappyMail\Log::warning('IMAP', 'RFC5258 not supported, using LSUB');
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$aSubscribedFolders = $this->oImapClient->FolderSubscribeList($sParent, $sListPattern);
|
$aSubscribedFolders = $this->oImapClient->FolderSubscribeList($sParent, $sListPattern);
|
||||||
$aImapSubscribedFoldersHelper = array();
|
$aImapSubscribedFoldersHelper = array();
|
||||||
foreach ($aSubscribedFolders as /* @var $oImapFolder \MailSo\Imap\Folder */ $oImapFolder)
|
foreach ($aSubscribedFolders as /* @var $oImapFolder \MailSo\Imap\Folder */ $oImapFolder) {
|
||||||
{
|
|
||||||
$aImapSubscribedFoldersHelper[] = $oImapFolder->FullName();
|
$aImapSubscribedFoldersHelper[] = $oImapFolder->FullName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -937,19 +937,18 @@ class MailClient
|
||||||
if (($bUseListSubscribeStatus && (null === $aImapSubscribedFoldersHelper || \in_array($sFullName, $aImapSubscribedFoldersHelper))) || $oImapFolder->IsInbox()) {
|
if (($bUseListSubscribeStatus && (null === $aImapSubscribedFoldersHelper || \in_array($sFullName, $aImapSubscribedFoldersHelper))) || $oImapFolder->IsInbox()) {
|
||||||
$oImapFolder->setSubscribed();
|
$oImapFolder->setSubscribed();
|
||||||
}
|
}
|
||||||
$aFolders[$sFullName] = $oImapFolder;
|
|
||||||
|
|
||||||
// Add NonExistent folders
|
// Add NonExistent folders
|
||||||
$sDelimiter = $oImapFolder->Delimiter();
|
$sDelimiter = $oImapFolder->Delimiter();
|
||||||
$aFolderExplode = \explode($sDelimiter, $sFullName);
|
$aFolderExplode = \explode($sDelimiter, $sFullName);
|
||||||
\array_pop($aFolderExplode);
|
\array_pop($aFolderExplode);
|
||||||
while ($aFolderExplode) {
|
while ($aFolderExplode) {
|
||||||
$sNonExistentFolderFullName = \implode($sDelimiter, $aFolderExplode);
|
$sFullName = \implode($sDelimiter, $aFolderExplode);
|
||||||
if (!isset($aFolders[$sNonExistentFolderFullName])) {
|
if (!isset($aFolders[$sFullName])) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$aFolders[$sNonExistentFolderFullName] =
|
$aFolders[$sFullName] =
|
||||||
new \MailSo\Imap\Folder($sNonExistentFolderFullName, $sDelimiter, ['\\Noselect', '\\NonExistent']);
|
new \MailSo\Imap\Folder($sFullName, $sDelimiter, ['\\Noselect', '\\NonExistent']);
|
||||||
}
|
}
|
||||||
catch (\Throwable $oExc)
|
catch (\Throwable $oExc)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue