From 02e8df76adff7c4ee80e496736e7eaf939ad67de Mon Sep 17 00:00:00 2001 From: Bruno Wagner Goncalves Date: Thu, 21 Aug 2014 18:39:27 -0300 Subject: MessageCollection iterators must instantiate LeapMessage with the collection --- src/leap/mail/imap/messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/leap/mail/imap/messages.py') diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py index b0b2f95..11dcd8f 100644 --- a/src/leap/mail/imap/messages.py +++ b/src/leap/mail/imap/messages.py @@ -1337,7 +1337,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): :returns: a list of LeapMessages :rtype: list """ - return [LeapMessage(self._soledad, docid, self.mbox) + return [LeapMessage(self._soledad, docid, self.mbox, collection=self) for docid in self.unseen_iter()] # recent messages @@ -1370,7 +1370,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): :returns: iterator of dicts with content for all messages. :rtype: iterable """ - return (LeapMessage(self._soledad, docuid, self.mbox) + return (LeapMessage(self._soledad, docuid, self.mbox, collection=self) for docuid in self.all_uid_iter()) def __repr__(self): -- cgit v1.2.3 From 74059fb917eba96dbdd02a3cded5dfe83d16861c Mon Sep 17 00:00:00 2001 From: Bruno Wagner Goncalves Date: Thu, 21 Aug 2014 18:40:28 -0300 Subject: Fixed some PEP8 warnings on the messages file --- src/leap/mail/imap/messages.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/leap/mail/imap/messages.py') diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py index 11dcd8f..4e8e1a3 100644 --- a/src/leap/mail/imap/messages.py +++ b/src/leap/mail/imap/messages.py @@ -750,7 +750,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): :return: a dict with the template :rtype: dict """ - if not _type in self.templates.keys(): + if _type not in self.templates.keys(): raise TypeError("Improper type passed to _get_empty_doc") return copy.deepcopy(self.templates[_type]) @@ -938,10 +938,10 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): # We can say the observer that we're done at this point, but # before that we should make sure it has no serious consequences # if we're issued, for instance, a fetch command right after... - #self.reactor.callFromThread(observer.callback, uid) + # self.reactor.callFromThread(observer.callback, uid) # if we did the notify, we need to invalidate the deferred # so not to try to fire it twice. - #observer = None + # observer = None fd = self._populate_flags(flags, uid, chash, size, multi) hd = self._populate_headr(msg, chash, subject, date) -- cgit v1.2.3 From 2317b06394e415c69de51940f0eec33fcb7fdc97 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 3 Sep 2014 18:21:16 -0500 Subject: remove uid from signature --- src/leap/mail/imap/messages.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/leap/mail/imap/messages.py') diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py index 4e8e1a3..0356600 100644 --- a/src/leap/mail/imap/messages.py +++ b/src/leap/mail/imap/messages.py @@ -864,7 +864,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): else: return False - def add_msg(self, raw, subject=None, flags=None, date=None, uid=None, + def add_msg(self, raw, subject=None, flags=None, date=None, notify_on_disk=False): """ Creates a new message document. @@ -881,9 +881,6 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): :param date: the received date for the message :type date: str - :param uid: the message uid for this mailbox - :type uid: int - :return: a deferred that will be fired with the message uid when the adding succeed. :rtype: deferred @@ -933,6 +930,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MBoxParser): msg.setFlags((fields.DELETED_FLAG,), -1) return + # XXX get FUCKING UID from autoincremental table uid = self.memstore.increment_last_soledad_uid(self.mbox) # We can say the observer that we're done at this point, but -- cgit v1.2.3