mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
parent
53333bd56a
commit
30ff459535
1 changed files with 33 additions and 8 deletions
|
|
@ -91,6 +91,34 @@ class ResponseCollection extends \MailSo\Base\Collection
|
||||||
return $aReturn;
|
return $aReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array|string $mName
|
||||||
|
*/
|
||||||
|
private function getArrayNameToStringName($mName) : string
|
||||||
|
{
|
||||||
|
if (\is_string($mName))
|
||||||
|
{
|
||||||
|
return $mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\is_array($mName))
|
||||||
|
{
|
||||||
|
if (0 === \count($mName))
|
||||||
|
{
|
||||||
|
return '[]';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($mName as &$mSubName)
|
||||||
|
{
|
||||||
|
$mSubName = "[{$this->getArrayNameToStringName($mSubName)}]";
|
||||||
|
}
|
||||||
|
|
||||||
|
return \implode('', $mName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
public function getFoldersResult(string $sStatus, bool $bUseListStatus = false) : array
|
public function getFoldersResult(string $sStatus, bool $bUseListStatus = false) : array
|
||||||
{
|
{
|
||||||
$aReturn = array();
|
$aReturn = array();
|
||||||
|
|
@ -110,15 +138,12 @@ class ResponseCollection extends \MailSo\Base\Collection
|
||||||
* https://github.com/the-djmaze/snappymail/issues/1
|
* https://github.com/the-djmaze/snappymail/issues/1
|
||||||
* https://github.com/the-djmaze/snappymail/issues/70
|
* https://github.com/the-djmaze/snappymail/issues/70
|
||||||
*/
|
*/
|
||||||
$sFullNameRaw = \array_slice($oResponse->ResponseList, 4);
|
$aFullNameRawList = \array_slice($oResponse->ResponseList, 4);
|
||||||
foreach ($sFullNameRaw as &$name) {
|
foreach ($aFullNameRawList as &$sName) {
|
||||||
if (\is_array($name)) {
|
$sName = $this->getArrayNameToStringName($sName);
|
||||||
$name = "[{$name[0]}]";
|
|
||||||
} else if (!\is_string($name)) {
|
|
||||||
$name = '';
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$sFullNameRaw = \implode('', $sFullNameRaw);
|
$sFullNameRaw = \implode('', $aFullNameRawList);
|
||||||
|
|
||||||
$oFolder = new Folder($sFullNameRaw,
|
$oFolder = new Folder($sFullNameRaw,
|
||||||
$oResponse->ResponseList[3], $oResponse->ResponseList[2]);
|
$oResponse->ResponseList[3], $oResponse->ResponseList[2]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue