isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 6b7b2b11063ef32a3d40624d212c30d5f9ac995f
parent f1eea7d9a50da1a4e52ca22edabb5d31291e03be
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Sat, 23 Nov 2013 12:22:31 +0100

always get slave flags when we are expiring

even if we are not propagating new messages, the appearance of new
messages on the slave can lead to expiring older messages. for that, we
need to know their importance, and thus flags.

the alternative would be not doing an expiration run when not fetching
new messages, but that would mean more conditionals all over the place.
as the decision is somewhat arbitrary, just do the simpler thing.

Diffstat:
Msrc/sync.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/sync.c b/src/sync.c @@ -992,14 +992,12 @@ box_selected( int sts, void *aux ) opts[t] |= OPEN_NEW|OPEN_FLAGS; } } - if ((chan->ops[S] & (OP_NEW|OP_RENEW)) && chan->max_messages) + if ((chan->ops[S] & (OP_NEW|OP_RENEW|OP_FLAGS)) && chan->max_messages) opts[S] |= OPEN_OLD|OPEN_NEW|OPEN_FLAGS; if (line) for (srec = svars->srecs; srec; srec = srec->next) { if (srec->status & S_DEAD) continue; - if ((mvBit(srec->status, S_EXPIRE, S_EXPIRED) ^ srec->status) & S_EXPIRED) - opts[S] |= OPEN_OLD|OPEN_FLAGS; if (srec->tuid[0]) { if (srec->uid[M] == -2) opts[M] |= OPEN_NEW|OPEN_FIND, svars->state[M] |= ST_FIND_OLD; @@ -1355,6 +1353,7 @@ box_loaded( int sts, void *aux ) } if ((svars->chan->ops[S] & (OP_NEW|OP_RENEW|OP_FLAGS)) && svars->chan->max_messages) { + /* Note: When this branch is entered, we have loaded all slave messages. */ /* Expire excess messages. Flagged messages and not yet synced messages older * than the first not expired message are not counted towards the total. */ todel = svars->ctx[S]->count + svars->new_total[S] - svars->chan->max_messages;