Open pjio opened 1 year ago
Also check #32 This is a design flaw by roundcubes library. Check my ticket for how to handle it the "roundcube way"
@IZSkiSurfer I've changed the PR to the "Roundcube way".
This is more explicit and should have no side effects.
Thanks @pjio your fix looks fine and dandy ;) I guess the tickets could be closed or marked as fixed with the next version.
First thanks to everyone involved in this project!
About the problem: I'm using this library alongside with https://github.com/ddeboer/imap, which uses the UID to identify messages. In
Roundcube\ImapClient::fetch()
the sequence-number (variable$id
) is used as the key in$result
, even when$is_uid
is set to true. InJavanile\Imap2\Message
depending on$flags
the$messageNum
-parameter could either be the sequence-number or the UID. Therefore some methods fail to access the result.What I've changed: ~
array_pop()
is used to retrieve the message from the array and should work with sequence-numbers and UID.~ If FT_UID is set,$messages
will have theuid
as the key in the affected functions (no change was required to Roundcube).How I've tested it: I fetched mails from Outlook365 via OAuth2 and by UID successfully with this change.
Possibly related: https://github.com/javanile/php-imap2/issues/15 https://github.com/javanile/php-imap2/issues/18