mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Better fix for broken DoFolderInformation() response
This commit is contained in:
parent
e52addf346
commit
013f09c8d3
2 changed files with 16 additions and 21 deletions
|
|
@ -653,8 +653,19 @@ class MailClient
|
||||||
foreach ($aFetchResponse as $oFetchResponse)
|
foreach ($aFetchResponse as $oFetchResponse)
|
||||||
{
|
{
|
||||||
$iUid = (int) $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::UID);
|
$iUid = (int) $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::UID);
|
||||||
$aFlags[$iUid] =
|
$aLowerFlags = \array_map('strtolower', $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::FLAGS));
|
||||||
$oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::FLAGS);
|
$aFlags[] = array(
|
||||||
|
'Uid' => $iUid,
|
||||||
|
'IsUnseen' => \in_array('\\unseen', $aLowerFlags) || !\in_array('\\seen', $aLowerFlags),
|
||||||
|
'IsSeen' => \in_array('\\seen', $aLowerFlags),
|
||||||
|
'IsFlagged' => \in_array('\\flagged', $aLowerFlags),
|
||||||
|
'IsAnswered' => \in_array('\\answered', $aLowerFlags),
|
||||||
|
'IsDeleted' => \in_array('\\deleted', $aLowerFlags),
|
||||||
|
'IsForwarded' => \in_array(\strtolower('$Forwarded'), $aLowerFlags) || ($sForwardedFlag && \in_array(\strtolower($sForwardedFlag), $aLowerFlags)),
|
||||||
|
'IsReadReceipt' => \in_array(\strtolower('$MDNSent'), $aLowerFlags) || ($sReadReceiptFlag && \in_array(\strtolower($sReadReceiptFlag), $aLowerFlags)),
|
||||||
|
'IsJunk' => !\in_array(\strtolower('$NonJunk'), $aLowerFlags) && \in_array(\strtolower('$Junk'), $aLowerFlags),
|
||||||
|
'IsPhishing' => \in_array(\strtolower('$Phishing'), $aLowerFlags)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -666,7 +677,7 @@ class MailClient
|
||||||
'MessageCount' => $iCount,
|
'MessageCount' => $iCount,
|
||||||
'MessageUnseenCount' => $iUnseenCount,
|
'MessageUnseenCount' => $iUnseenCount,
|
||||||
'UidNext' => $iUidNext,
|
'UidNext' => $iUidNext,
|
||||||
'MessageFlags' => $aFlags,
|
'MessagesFlags' => $aFlags,
|
||||||
'HighestModSeq' => $iHighestModSeq,
|
'HighestModSeq' => $iHighestModSeq,
|
||||||
'AppendLimit' => $iAppendLimit,
|
'AppendLimit' => $iAppendLimit,
|
||||||
'MailboxId' => $sMailboxId,
|
'MailboxId' => $sMailboxId,
|
||||||
|
|
|
||||||
|
|
@ -363,24 +363,8 @@ trait Folders
|
||||||
$aInboxInformation = $this->MailClient()->FolderInformation(
|
$aInboxInformation = $this->MailClient()->FolderInformation(
|
||||||
$sFolder, $iPrevUidNext, $aFlagsUids
|
$sFolder, $iPrevUidNext, $aFlagsUids
|
||||||
);
|
);
|
||||||
foreach ($aInboxInformation['MessageFlags'] as $iUid => $aFlags)
|
$aInboxInformation['Flags'] = $aInboxInformation['MessagesFlags'];
|
||||||
{
|
unset($aInboxInformation['MessagesFlags']);
|
||||||
$aLowerFlags = \array_map('strtolower', $aFlags);
|
|
||||||
$aInboxInformation['Flags'][$iUid] = array(
|
|
||||||
'Uid' => $iUid,
|
|
||||||
'IsUnseen' => \in_array('\\unseen', $aLowerFlags) || !\in_array('\\seen', $aLowerFlags),
|
|
||||||
'IsSeen' => \in_array('\\seen', $aLowerFlags),
|
|
||||||
'IsFlagged' => \in_array('\\flagged', $aLowerFlags),
|
|
||||||
'IsAnswered' => \in_array('\\answered', $aLowerFlags),
|
|
||||||
'IsDeleted' => \in_array('\\deleted', $aLowerFlags),
|
|
||||||
'IsForwarded' => \in_array(\strtolower('$Forwarded'), $aLowerFlags) || ($sForwardedFlag && \in_array(\strtolower($sForwardedFlag), $aLowerFlags)),
|
|
||||||
'IsReadReceipt' => \in_array(\strtolower('$MDNSent'), $aLowerFlags) || ($sReadReceiptFlag && \in_array(\strtolower($sReadReceiptFlag), $aLowerFlags)),
|
|
||||||
'IsJunk' => !\in_array(\strtolower('$NonJunk'), $aLowerFlags) && \in_array(\strtolower('$Junk'), $aLowerFlags),
|
|
||||||
'IsPhishing' => \in_array(\strtolower('$Phishing'), $aLowerFlags)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$aInboxInformation['Flags'] = \array_values($aInboxInformation['Flags']);
|
|
||||||
unset($aInboxInformation['MessageFlags']);
|
|
||||||
}
|
}
|
||||||
catch (\Throwable $oException)
|
catch (\Throwable $oException)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue