From b3e1fe1320cd564ecaa6f939d58698093e173ea9 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 13 Feb 2024 14:53:20 +0100 Subject: [PATCH] Resolve #1430 --- .../libraries/RainLoop/Actions/Folders.php | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) 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 9728589df..23703c738 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 @@ -55,21 +55,24 @@ trait Folders $HideUnsubscribed = (bool) $oSettingsLocal->GetConf('HideUnsubscribed', $HideUnsubscribed); } - $oNamespaces = $this->ImapClient()->GetNamespaces(); $oFolderCollection = $this->MailClient()->Folders('', '*', $HideUnsubscribed); - if (isset($oNamespaces->aOtherUsers[0])) { - $oCollection = $this->MailClient()->Folders($oNamespaces->aOtherUsers[0]['prefix'], '*', $HideUnsubscribed); - if ($oCollection) { - foreach ($oCollection as $oFolder) { - $oFolderCollection[$oFolder->FullName] = $oFolder; + + $oNamespaces = $this->ImapClient()->GetNamespaces(); + if ($oNamespaces) { + if (isset($oNamespaces->aOtherUsers[0])) { + $oCollection = $this->MailClient()->Folders($oNamespaces->aOtherUsers[0]['prefix'], '*', $HideUnsubscribed); + if ($oCollection) { + foreach ($oCollection as $oFolder) { + $oFolderCollection[$oFolder->FullName] = $oFolder; + } } } - } - if (isset($oNamespaces->aShared[0])) { - $oCollection = $this->MailClient()->Folders($oNamespaces->aShared[0]['prefix'], '*', $HideUnsubscribed); - if ($oCollection) { - foreach ($oCollection as $oFolder) { - $oFolderCollection[$oFolder->FullName] = $oFolder; + if (isset($oNamespaces->aShared[0])) { + $oCollection = $this->MailClient()->Folders($oNamespaces->aShared[0]['prefix'], '*', $HideUnsubscribed); + if ($oCollection) { + foreach ($oCollection as $oFolder) { + $oFolderCollection[$oFolder->FullName] = $oFolder; + } } } } @@ -94,7 +97,7 @@ trait Folders array( 'quotaUsage' => $aQuota ? $aQuota[0] * 1024 : null, 'quotaLimit' => $aQuota ? $aQuota[1] * 1024 : null, - 'namespace' => $oNamespaces->GetPersonalPrefix(), + 'namespace' => $oNamespaces ? $oNamespaces->GetPersonalPrefix() : '', 'namespaces' => $oNamespaces, 'capabilities' => $aCapabilities )