[PATCH 1/2] Re: Another way of locating UID of just saved message

Nicolas Sebrecht nicolas.s-dev at laposte.net
Wed Aug 3 17:56:39 BST 2011


On Wed, Aug 03, 2011 at 05:12:13PM +0200, Vladimir Marek wrote:
> Hmm, that should be 1/1.
> 
> After discussion with imaplib2 author, I don't need to modify imaplib2's
> code. I use bytearray instead of my personal class.

Fine. :-)

> > @@ -485,6 +549,9 @@ class IMAPFolder(BaseFolder):
> >                      assert(imapobj.noop()[0] == 'OK')
> >                      uid = self.savemessage_searchforheader(imapobj, headername,
> >                                                         headervalue)
> > +                    if uid == 0:
> > +                        self.ui.debug('imap', 'savemessage: second attempt to get new UID failed. Going to try search headers manually')
> > +                        uid = self.savemessage_fetchheaders(imapobj, headername, headervalue)
> 
> Also I don't like the fact, that OfflineIMAP tries SEARCH twice for
> every message before it tries to download full headers. It could
> remember that SEARCH failed in the past and for every new message skip
> directly to fetching headrers.
> 
> But that can be updated in further changes.

I agree.

> Maybe this is not suitable for the just-to-be released branch anyway?

Yes, it is. But you can keep going. The code base can't be moving so
much. I'm merging only obvious bug fixes. I aim to provide the stable
during early on next week.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list