Aaron Stone wrote:
Either ic_select, where we mark a previously selected mailbox as recent or
ci_cleanup (in imap4.c) upon disconnect. However, looking at the code in
imap4.c, there appears to be a notification mechanism that says when
recent messages have arrived. So a client keeping a connection alive with
noops would see when messages arrive. This indicates to me ic_select is
the right place.

I'd say:

struct DbmailImapSession {
        ...
        GList *recent_msgs;
}

on select:
        flush the recent_msgs list from a previously selected mailbox
        if access is rw:
                build a new recent_msgs list with the recent flag set

on logout:
        flush the recent_msgs list

IIRC, we can ignore flushing the recent_msgs list on sudden network disconnects.

Doesn't look to hard actually.

One side note though, Aaron. I saw in the is_header code you added to user.c that you still issue one update query per messageblk. That is very much suboptimal. We should work toward:

update dbmail_messages set recent_flags = 0 where message_idnr in (a,b,c, ... 
N);

where the IN (...) list can be quite long, possibly upto a few hundred idnrs.




--
  ________________________________________________________________
  Paul Stevens                                         [EMAIL PROTECTED]
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands_______________________________________www.nfg.nl

Reply via email to