summaryrefslogtreecommitdiff
path: root/mail/src/leap
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
commit7de67881aca3897bf102f462b3539ab881ebf515 (patch)
treec401d115a6595835ef07d1613ed622a600ec49c4 /mail/src/leap
parent32ef45e8a7d2f5cb384a767ce499ab9c90f701ad (diff)
fix last_uid write to avoid updates to lesser values
Diffstat (limited to 'mail/src/leap')
-rw-r--r--mail/src/leap/mail/imap/soledadstore.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mail/src/leap/mail/imap/soledadstore.py b/mail/src/leap/mail/imap/soledadstore.py
index 9d198576..657f21fe 100644
--- a/mail/src/leap/mail/imap/soledadstore.py
+++ b/mail/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