de-noise msg_copied() and flags_set() somewhat
assign temporary srec object instead of always spelling out the indirection.
This commit is contained in:
parent
841f07efd0
commit
b677bfe7e5
16
src/sync.c
16
src/sync.c
|
@ -1840,22 +1840,23 @@ static void
|
||||||
msg_copied( int sts, uint uid, copy_vars_t *vars )
|
msg_copied( int sts, uint uid, copy_vars_t *vars )
|
||||||
{
|
{
|
||||||
SVARS_CHECK_CANCEL_RET;
|
SVARS_CHECK_CANCEL_RET;
|
||||||
|
sync_rec_t *srec = vars->srec;
|
||||||
switch (sts) {
|
switch (sts) {
|
||||||
case SYNC_OK:
|
case SYNC_OK:
|
||||||
if (!uid) { // Stored to a non-UIDPLUS mailbox
|
if (!uid) { // Stored to a non-UIDPLUS mailbox
|
||||||
svars->state[t] |= ST_FIND_NEW;
|
svars->state[t] |= ST_FIND_NEW;
|
||||||
} else {
|
} else {
|
||||||
debug( " -> new UID %u on %s\n", uid, str_ms[t] );
|
debug( " -> new UID %u on %s\n", uid, str_ms[t] );
|
||||||
jFprintf( svars, "%c %u %u %u\n", "<>"[t], vars->srec->uid[M], vars->srec->uid[S], uid );
|
jFprintf( svars, "%c %u %u %u\n", "<>"[t], srec->uid[M], srec->uid[S], uid );
|
||||||
vars->srec->uid[t] = uid;
|
vars->srec->uid[t] = uid;
|
||||||
vars->srec->status &= ~S_PENDING;
|
vars->srec->status &= ~S_PENDING;
|
||||||
vars->srec->tuid[0] = 0;
|
vars->srec->tuid[0] = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SYNC_NOGOOD:
|
case SYNC_NOGOOD:
|
||||||
debug( " -> killing (%u,%u)\n", vars->srec->uid[M], vars->srec->uid[S] );
|
debug( " -> killing (%u,%u)\n", srec->uid[M], srec->uid[S] );
|
||||||
vars->srec->status = S_DEAD;
|
srec->status = S_DEAD;
|
||||||
jFprintf( svars, "- %u %u\n", vars->srec->uid[M], vars->srec->uid[S] );
|
jFprintf( svars, "- %u %u\n", srec->uid[M], srec->uid[S] );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cancel_sync( svars );
|
cancel_sync( svars );
|
||||||
|
@ -1965,13 +1966,14 @@ static void
|
||||||
flags_set( int sts, void *aux )
|
flags_set( int sts, void *aux )
|
||||||
{
|
{
|
||||||
SVARS_CHECK_RET_VARS(flag_vars_t);
|
SVARS_CHECK_RET_VARS(flag_vars_t);
|
||||||
|
sync_rec_t *srec = vars->srec;
|
||||||
switch (sts) {
|
switch (sts) {
|
||||||
case DRV_OK:
|
case DRV_OK:
|
||||||
if (vars->aflags & F_DELETED)
|
if (vars->aflags & F_DELETED)
|
||||||
vars->srec->wstate |= W_DEL(t);
|
srec->wstate |= W_DEL(t);
|
||||||
else if (vars->dflags & F_DELETED)
|
else if (vars->dflags & F_DELETED)
|
||||||
vars->srec->wstate &= ~W_DEL(t);
|
srec->wstate &= ~W_DEL(t);
|
||||||
flags_set_p2( svars, vars->srec, t );
|
flags_set_p2( svars, srec, t );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free( vars );
|
free( vars );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user