mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-27 01:28:56 +08: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 = [];
|
||||
foreach ($oImapClient->Fetch(['BODY.PEEK[HEADER.FIELDS (FROM)]'], \implode(',', $aUids), true) as $oFetchResponse) {
|
||||
$oHeaders = new \MailSo\Mime\HeaderCollection($oFetchResponse->GetHeaderFieldsValue());
|
||||
$oFrom = $oHeaders->GetAsEmailCollection(\MailSo\Mime\Enumerations\Header::FROM_, true);
|
||||
foreach ($oFrom as $oMail) {
|
||||
$aResult[] = [$oMail->GetEmail(), $oMail->GetDisplayName()];
|
||||
if ($aUids) {
|
||||
foreach ($oImapClient->Fetch(['BODY.PEEK[HEADER.FIELDS (FROM)]'], \implode(',', $aUids), true) as $oFetchResponse) {
|
||||
$oHeaders = new \MailSo\Mime\HeaderCollection($oFetchResponse->GetHeaderFieldsValue());
|
||||
$oFrom = $oHeaders->GetAsEmailCollection(\MailSo\Mime\Enumerations\Header::FROM_, true);
|
||||
foreach ($oFrom as $oMail) {
|
||||
$aResult[] = [$oMail->GetEmail(), $oMail->GetDisplayName()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue