folder: Base: sort message UID list

Return a sorted list of UIDs in getmessageuidlist.

Some MUAs (and their users) like to display messages in UID order
(or "order received").  If offlineimap is used in IMAP<->IMAP mode,
then the order messages are received by the second IMAP server will
be different because offlineimap iterates over a UID list produced
from the keys of a dictionary, which is unsorted.

This change sorts that list of UIDs so that both IMAP servers will
have their messages in the same order (except those times where
messages are appended to folders on both repositories between
syncs).

Signed-off-by: James E. Blair <corvus@gnu.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
James E. Blair 2012-07-07 20:16:56 -07:00 committed by Nicolas Sebrecht
parent bfa966dd08
commit a5ea1827fb

View File

@ -302,7 +302,7 @@ class BaseFolder(object):
You may have to call cachemessagelist() before calling this function!"""
return self.getmessagelist().keys()
return sorted(self.getmessagelist().keys())
def getmessagecount(self):
"""Gets the number of messages."""