From fd28c5a2d345327fc3784a820c59f408f376adc6 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Wed, 16 Mar 2011 16:03:35 +0100 Subject: [PATCH] folder/IMAP: savemessage() should just save flags if uid already exists As the LocalStatus and UIDMap backend already did: If the uid already exists for savemessage(), only modify the flags and don't append a new message. We don't invoke savemessage() on messages that already exist in our sync logic, so this has no change on our current behavior. But it makes backends befave more consistent with each other. Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/IMAP.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 89848b2..74a9b87 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -394,6 +394,11 @@ class IMAPFolder(BaseFolder): server. If the folder is read-only it will return 0.""" self.ui.debug('imap', 'savemessage: called') + # already have it, just save modified flags + if uid > 0 and uid in self.messagelist: + self.savemessageflags(uid, flags) + return uid + try: imapobj = self.imapserver.acquireconnection()