This commit is contained in:
the-djmaze 2024-02-13 14:53:20 +01:00
parent 9f2b2e50d7
commit b3e1fe1320

View file

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