]> code.citadel.org Git - citadel.git/blobdiff - webcit/sieve.c
Migrated the sieve screens to room_banner_override. This removes the last of the...
[citadel.git] / webcit / sieve.c
index 3761b11319efc22a03ef82f3beb1bc3ea2bcd42b..52d68f7574612c1340a8a47c6cb9b98fb979923c 100644 (file)
@@ -429,25 +429,22 @@ void create_script(void) {
 
        serv_printf("MSIV getscript|%s", bstr("script_name"));
        serv_getln(buf, sizeof buf);
-       if (buf[0] == '1') {
+       if (buf[0] == '1') {            // does script exist already?
                while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) {
-                       /* flush */
+                                       // yes -- flush the output
                }
-               return;
        }
-       
-       serv_printf("MSIV putscript|%s", bstr("script_name"));
-       serv_getln(buf, sizeof buf);
-       if (buf[0] == '4') {
-               serv_puts("keep;");
-               serv_puts("000");
-       output_headers(1, 1, 2, 0, 0, 0);
-       do_template("sieve_add");
-       wDumpContent(1);
-               return;
+       else {
+                                       // no -- safe to create a new one by this name
+               serv_printf("MSIV putscript|%s", bstr("script_name"));
+               serv_getln(buf, sizeof buf);
+               if (buf[0] == '4') {
+                       serv_puts("keep;");
+                       serv_puts("000");
+               }
        }
 
-       output_headers(1, 1, 2, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
        do_template("sieve_add");
        wDumpContent(1);
 }
@@ -461,7 +458,7 @@ void delete_script(void) {
 
        serv_printf("MSIV deletescript|%s", bstr("script_name"));
        serv_getln(buf, sizeof buf);
-       output_headers(1, 1, 2, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
        do_template("sieve_add");
        wDumpContent(1);
 }
@@ -472,7 +469,7 @@ void delete_script(void) {
  */
 void display_no_sieve(void) {
 
-       output_headers(1, 1, 2, 0, 0, 0);
+       output_headers(1, 1, 1, 0, 0, 0);
        do_template("sieve_none");
        wDumpContent(1);
 }