X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsieve.c;fp=webcit%2Fsieve.c;h=735cffc0c7729b59df9618a338dbb6ee73e56abf;hb=e830265f9a3238898ea25e8ed4782e50f2b7a775;hp=cce70574ae927c451f165af0488e47215e27ac8c;hpb=554b4865ddb1cd09b9311b13307b61abf4f1b22d;p=citadel.git diff --git a/webcit/sieve.c b/webcit/sieve.c index cce70574a..735cffc0c 100644 --- a/webcit/sieve.c +++ b/webcit/sieve.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996-2012 by the citadel.org team + * Copyright (c) 1996-2020 by the citadel.org team * * This program is open source software. You can redistribute it and/or * modify it under the terms of the GNU General Public License version 3. @@ -9,7 +9,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * FIXME: add logic to exclude the webcit-generated script from the manual script selection + * + * Implementation note: this was kind of hacked up when we switched from Sieve to custom rules. + * As a result there's probably some cruft in here... + * ajc 2020jul12 + * */ #include "webcit.h" @@ -22,220 +26,6 @@ CtxType CTX_SIEVESCRIPT = CTX_NONE; #define RULES_SCRIPT "__WebCit_Generated_Script__" -/* - * Helper function for output_sieve_rule() to output strings with quotes escaped - */ -void osr_sanitize(char *str) { - int i, len; - - if (str == NULL) return; - len = strlen(str); - for (i=0; i 0) { - for (i=0; i sizeof(WC_RULE_HEADER) - 1) && - (!strncasecmp(ChrPtr(Line), HKEY(WC_RULE_HEADER)))) + if ((StrLength(Line) > sizeof(WC_RULE_HEADER) - 1) && (!strncasecmp(ChrPtr(Line), HKEY(WC_RULE_HEADER)))) { StrBufSkip_NTokenS(Line, &pch, '|', 1); n = StrBufExtractNext_int(Line, &pch, '|'); @@ -962,7 +640,5 @@ InitModule_SIEVE /* fetch our room into WCC->ThisRoom, to evaluate while iterating over rooms with COND:THIS:THAT:ROOM */ RegisterNamespace("SIEVE:SCRIPT:LOOKUP_FILEINTO", 0, 1, tmplput_SieveRule_lookup_FileIntoRoom, NULL, CTX_SIEVESCRIPT); WebcitAddUrlHandler(HKEY("save_sieve"), "", 0, save_sieve, 0); - WebcitAddUrlHandler(HKEY("create_script"), "", 0, create_script, 0); - WebcitAddUrlHandler(HKEY("delete_script"), "", 0, delete_script, 0); WebcitAddUrlHandler(HKEY("display_sieve_add_or_delete"), "", 0, display_sieve_add_or_delete, 0); }