Changed noop by unselect/select.

pull/10/head
Ludovic Marcotte 2013-04-10 10:48:25 -04:00
parent 1b983ef691
commit 33840c71cd
1 changed files with 7 additions and 3 deletions

View File

@ -943,9 +943,13 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts, NS
[mapping registerURL: [self url] withID: mid];
/* synchronise the cache and update the change key with the one provided
by the client. Before doing this, lets issue a noop because of timing
issues with Dovecot. */
[client noop];
by the client. Before doing this, lets issue a unselect/select combo
because of timing issues with Dovecot in obtaining the latest modseq.
Sometimes, Dovecot doesn't return the newly appended UID if we do
a "UID SORT (DATE) UTF-8 (MODSEQ XYZ) (NOT DELETED)" command (where
XYZ is the HIGHESTMODSEQ+1) immediately after IMAP APPEND */
[client unselect];
[client select: folderName];
[(MAPIStoreMailFolder *) container synchroniseCache];
changeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)];