summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-02-11 01:46:00 -0400
committerKali Kaneko <kali@leap.se>2014-02-17 11:39:49 -0400
commitb83b94bf84ffb6d3bcabb192d64cf91fcfef96b4 (patch)
treeefd1fa9c1bef879c37e031c6ba00e33f839e8edd /src/leap/mail/imap
parentf869b7eecab67d07a23dfb8b2931b3844f7523e3 (diff)
fix last_uid write to avoid updates to lesser values
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r--src/leap/mail/imap/soledadstore.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/leap/mail/imap/soledadstore.py b/src/leap/mail/imap/soledadstore.py
index 9d19857..657f21f 100644
--- a/src/leap/mail/imap/soledadstore.py
+++ b/src/leap/mail/imap/soledadstore.py
@@ -515,11 +515,12 @@ class SoledadStore(ContentDedup):
with self._last_uid_lock:
mbox_doc = self._get_mbox_document(mbox)
old_val = mbox_doc.content[key]
- if value < old_val:
+ if value > old_val:
+ mbox_doc.content[key] = value
+ self._soledad.put_doc(mbox_doc)
+ else:
logger.error("%r:%s Tried to write a UID lesser than what's "
"stored!" % (mbox, value))
- mbox_doc.content[key] = value
- self._soledad.put_doc(mbox_doc)
# deleted messages