would cause heavy load if there are lots of users with lots of scripts.
rewrite_ctdl_sieve_config() was rewriting the sieve config every time
regardless of the yes_write_to_disk flag thus calling quickie_message()
which takes a bit of time (an extra 0.3mS).
sprintf(&text[strlen(text)], CTDLSIEVECONFIGSEPARATOR);
}
sprintf(&text[strlen(text)], CTDLSIEVECONFIGSEPARATOR);
}
- /* Save the config */
- quickie_message("Citadel", NULL, NULL, u->config_roomname,
- text,
- 4,
- "Sieve configuration"
- );
-
- free (text);
- /* And delete the old one */
- if (u->config_msgnum > 0) {
- CtdlDeleteMessages(u->config_roomname, &u->config_msgnum, 1, "");
+ if (yes_write_to_disk)
+ {
+ /* Save the config */
+ quickie_message("Citadel", NULL, NULL, u->config_roomname,
+ text,
+ 4,
+ "Sieve configuration"
+ );
+
+ /* And delete the old one */
+ if (u->config_msgnum > 0) {
+ CtdlDeleteMessages(u->config_roomname, &u->config_msgnum, 1, "");
+ }