CVS commit by ossi: 

M_NOT_SYNCED => M_SYNCED. now that sync records know their messages, it
is simpler to track the positive case.


  M +1 -1      isync.h   1.46
  M +11 -14    sync.c   1.54


--- isync/src/isync.h  #1.45:1.46
@@ -120,5 +120,5 @@ typedef struct group_conf {
 #define M_FLAGS        (1<<2) /* flags fetched */
 #define M_PROCESSED    (1<<3) /* registered in pair */
-#define M_NOT_SYNCED   (1<<4) /* not in remote mailbox, yet */
+#define M_SYNCED       (1<<4) /* already propagated */
 #define M_EXPIRED      (1<<5) /* kicked out by MaxMessages */
 

--- isync/src/sync.c  #1.53:1.54
@@ -127,4 +127,6 @@ findmsgs( sync_rec_t *srecs, store_t *ct
          found:
                msg->status |= M_PROCESSED;
+               if (srec->uid[1-t] >= 0)
+                       msg->status |= M_SYNCED;
                srec->msg[t] = msg;
                nsrec = srec->next;
@@ -631,5 +633,4 @@ sync_boxes( store_t *ctx[], const char *
                                                if ((chan->ops[t] & OP_EXPUNGE) 
&& (srec->msg[1-t]->flags & F_DELETED)) {
                                                        debug( "  -> not %sing 
- would be expunged anyway\n", str_hl[t] );
-                                                       srec->msg[1-t]->status 
|= M_NOT_SYNCED;
                                                } else {
                                                        if 
((srec->msg[1-t]->flags & F_FLAGGED) || !chan->stores[t]->max_size || 
srec->msg[1-t]->size <= chan->stores[t]->max_size) {
@@ -639,5 +640,5 @@ sync_boxes( store_t *ctx[], const char *
                                                                case 
DRV_STORE_BAD: ret = SYNC_BAD(1-t); goto finish;
                                                                case 
DRV_BOX_BAD: ret = SYNC_FAIL; goto finish;
-                                                               default: /* ok 
*/ srec->msg[1-t]->status |= M_NOT_SYNCED; break;
+                                                               default: /* ok 
*/ break;
                                                                case DRV_OK:
                                                                        
srec->msg[1-t]->flags = msgdata.flags;
@@ -648,4 +649,5 @@ sync_boxes( store_t *ctx[], const char *
                                                                                
Fprintf( jfp, "%c %d %d %d\n", "<>"[t], srec->uid[M], srec->uid[S], uid );
                                                                                
srec->uid[t] = uid;
+                                                                               
srec->msg[1-t]->status |= M_SYNCED;
                                                                                
nflags = srec->msg[1-t]->flags;
                                                                        }
@@ -653,9 +655,7 @@ sync_boxes( store_t *ctx[], const char *
                                                        } else {
                                                                debug( "  -> 
not %sing - still too big\n", str_hl[t] );
-                                                               
srec->msg[1-t]->status |= M_NOT_SYNCED;
                                                        }
                                                }
-                                       } else
-                                               srec->msg[1-t]->status |= 
M_NOT_SYNCED;
+                                       }
                                } else if (!del[t]) {
                                        /* a) & b.3) / c.3) */
@@ -726,5 +726,4 @@ sync_boxes( store_t *ctx[], const char *
                                        if ((chan->ops[t] & OP_EXPUNGE) && 
(tmsg->flags & F_DELETED)) {
                                                debug( "  not %sing - would be 
expunged anyway\n", str_hl[t] );
-                                               tmsg->status |= M_NOT_SYNCED;
                                        } else {
                                                if ((tmsg->flags & F_FLAGGED) 
|| !chan->stores[t]->max_size || tmsg->size <= chan->stores[t]->max_size) {
@@ -739,5 +738,5 @@ sync_boxes( store_t *ctx[], const char *
                                                        case DRV_STORE_BAD: 
return SYNC_BAD(1-t);
                                                        case DRV_BOX_BAD: 
return SYNC_FAIL;
-                                                       case DRV_MSG_BAD: /* ok 
*/ tmsg->status |= M_NOT_SYNCED; continue;
+                                                       case DRV_MSG_BAD: /* ok 
*/ continue;
                                                        }
                                                        tmsg->flags = 
msgdata.flags;
@@ -745,9 +744,8 @@ sync_boxes( store_t *ctx[], const char *
                                                        case DRV_STORE_BAD: 
return SYNC_BAD(t);
                                                        default: return 
SYNC_FAIL;
-                                                       case DRV_OK: break;
+                                                       case DRV_OK: 
tmsg->status |= M_SYNCED; break;
                                                        }
                                                } else {
                                                        debug( "  not %sing - 
too big\n", str_hl[t] );
-                                                       tmsg->status |= 
M_NOT_SYNCED;
                                                        uid = -1;
                                                }
@@ -766,6 +764,5 @@ sync_boxes( store_t *ctx[], const char *
                                                }
                                        }
-                               } else
-                                       tmsg->status |= M_NOT_SYNCED;
+                               }
                        }
                if (nmsgs)
@@ -783,5 +780,5 @@ sync_boxes( store_t *ctx[], const char *
                        if ((tmsg->status & M_DEAD) || (tmsg->flags & 
F_DELETED))
                                continue;
-                       if ((tmsg->flags & F_FLAGGED) || (tmsg->status & 
M_NOT_SYNCED)) /* add M_DESYNCED? */
+                       if ((tmsg->flags & F_FLAGGED) || !(tmsg->status & 
M_SYNCED)) /* add M_DESYNCED? */
                                todel--;
                        else if (!(tmsg->status & M_RECENT)) {
@@ -825,5 +822,5 @@ sync_boxes( store_t *ctx[], const char *
                                if (tmsg->flags & F_DELETED) {
                                        if (ctx[t]->conf->trash) {
-                                               if 
(!ctx[t]->conf->trash_only_new || (tmsg->status & M_NOT_SYNCED)) {
+                                               if 
(!ctx[t]->conf->trash_only_new || !(tmsg->status & M_SYNCED)) {
                                                        debug( "  trashing 
message %d\n", tmsg->uid );
                                                        switch 
(driver[t]->trash_msg( ctx[t], tmsg )) {
@@ -835,5 +832,5 @@ sync_boxes( store_t *ctx[], const char *
                                                        debug( "  not trashing 
message %d - not new\n", tmsg->uid );
                                        } else if (ctx[1-t]->conf->trash && 
ctx[1-t]->conf->trash_remote_new) {
-                                               if (tmsg->status & 
M_NOT_SYNCED) {
+                                               if (!(tmsg->status & M_SYNCED)) 
{
                                                        if 
(!ctx[1-t]->conf->max_size || tmsg->size <= ctx[1-t]->conf->max_size) {
                                                                debug( "  
remote trashing message %d\n", tmsg->uid );




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to