commit bf9d7c769503a5418baee936ffa9b0d8d88cdf1a
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Mar 9 16:38:09 2014 +0100

    write Sync and Expunge to global section if applicable
    
    makes for leaner Channel sections.
    
    note: the global delete and expunge variables exist so the command line
    can override the config file despite the otherwise backwards behavior.

 src/compat/config.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/compat/config.c b/src/compat/config.c
index d17eaa7..ee15305 100644
--- a/src/compat/config.c
+++ b/src/compat/config.c
@@ -344,9 +344,9 @@ write_channel_parm( FILE *fp, config_t *cfg )
                fprintf( fp, "MaxSize %d\n", cfg->max_size );
        if (cfg->max_messages)
                fprintf( fp, "MaxMessages %d\n", cfg->max_messages );
-       if (!cfg->delete && !delete)
-               fputs( "Sync New ReNew Flags\n", fp );
-       if (cfg->expunge || expunge)
+       if (cfg->delete && !global.delete && !delete)
+               fputs( "Sync All\n", fp );
+       if (cfg->expunge && !global.expunge && !expunge)
                fputs( "Expunge Both\n", fp );
        fputc( '\n', fp );
 }
@@ -373,7 +373,12 @@ write_config( int fd )
                return;
        }
 
-       fprintf( fp, "SyncState *\n\n" );
+       fputs( "SyncState *\n", fp );
+       if (!global.delete && !delete)
+               fputs( "Sync New ReNew Flags\n", fp );
+       if (global.expunge || expunge)
+               fputs( "Expunge Both\n", fp );
+       fputc( '\n', fp );
        if (local_home || o2o)
                fprintf( fp, "MaildirStore local\nPath \"%s/\"\nInbox 
\"%s/INBOX\"\nAltMap %s\n\n",
                         maildir, maildir, tb( altmap > 0 ) );

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to