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(-) 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