[sup-talk] Minor maildir change

William Morgan wmorgan-sup at masanjin.net
Wed Sep 19 11:59:58 EDT 2007


Excerpts from Magnus Therning's message of Sun Sep 16 11:19:36 -0700 2007:
> It's also a little strange that after a message is read it doesn't
> necessarily end up with the correct set of labels.  Instead one has to
> go to the index to get the proper set.

What do you mean? For a new, unseen message, the initial set of label is
uniquely determined by the source's default labels, unioned with
whatever state (read/unread, flagged, etc) we carry over from the
source. This is what Source#each does.

Now sup-sync has some complicated behavior that does involve the labels
on the index, but that has to do with situations where the message
already exists in the index, or the message state exists in a dumpfile
somewhere, and you're resolving the two potentially different label
sets.

> Another strange thing was that when using
> PollManager::add_messages_from all my emails ended up being unread
> (according to the labels in the message).  I tracked that down to it
> using the value of a header ("Status") to see whether a mail was read
> or not.  Is that something that's used for mboxes?  (I've attached a
> patch that removes the code.)

That is a hack to avoid having the mbox code read the header twice, one
for the labels and again for the actual header contents.  Since I'm
planning on reworking mbox anyways (to avoid keeping the file pointer
always open, and to clean up the interface between loader and
ssh-loader), so I'll try and think of a better way to do this. There
might not be.

In the mean time, I'll remove the second half of that statement, which
should make everyone happy.

>  - A source has some default labels (including :archive).
> 
>  - A message is always loaded from a source so it'll get its labels from
>    the source iff it's a new message. If it's a known message it'll
>    take its labels from the database.
> 
>  - Make all sets of labels actual sets.

Not sure what you mean by "actual sets", but I think this is pretty much
the way Sup works now.

-- 
William <wmorgan-sup at masanjin.net>


More information about the sup-talk mailing list