mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: ImapContactsSuggestions error on empty $aUids
This commit is contained in:
parent
4c752f9a15
commit
48a954e077
1 changed files with 7 additions and 5 deletions
|
|
@ -29,11 +29,13 @@ class ImapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges
|
||||||
);
|
);
|
||||||
|
|
||||||
$aResult = [];
|
$aResult = [];
|
||||||
foreach ($oImapClient->Fetch(['BODY.PEEK[HEADER.FIELDS (FROM)]'], \implode(',', $aUids), true) as $oFetchResponse) {
|
if ($aUids) {
|
||||||
$oHeaders = new \MailSo\Mime\HeaderCollection($oFetchResponse->GetHeaderFieldsValue());
|
foreach ($oImapClient->Fetch(['BODY.PEEK[HEADER.FIELDS (FROM)]'], \implode(',', $aUids), true) as $oFetchResponse) {
|
||||||
$oFrom = $oHeaders->GetAsEmailCollection(\MailSo\Mime\Enumerations\Header::FROM_, true);
|
$oHeaders = new \MailSo\Mime\HeaderCollection($oFetchResponse->GetHeaderFieldsValue());
|
||||||
foreach ($oFrom as $oMail) {
|
$oFrom = $oHeaders->GetAsEmailCollection(\MailSo\Mime\Enumerations\Header::FROM_, true);
|
||||||
$aResult[] = [$oMail->GetEmail(), $oMail->GetDisplayName()];
|
foreach ($oFrom as $oMail) {
|
||||||
|
$aResult[] = [$oMail->GetEmail(), $oMail->GetDisplayName()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue