]> code.citadel.org Git - citadel.git/blobdiff - citadel/control.c
* msgbase.c: when a summary mode message list is requested, and the room
[citadel.git] / citadel / control.c
index e497f3dbc650c39b2fb192e3dc9ad3a1b177230c..83a6c576daafe474b62fac4a7320dfbe1f4e8135 100644 (file)
@@ -5,10 +5,6 @@
  *
  */
 
-#ifdef DLL_EXPORT
-#define IN_LIBCIT
-#endif
-
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
@@ -64,13 +60,25 @@ void get_control(void)
         */
        memset(&CitControl, 0, sizeof(struct CitControl));
        if (control_fp == NULL) {
-               control_fp = fopen("citadel.control", "rb+");
+               control_fp = fopen(
+#ifndef HAVE_RUN_DIR
+                                                  "."
+#else
+                                                  RUN_DIR
+#endif
+                                                  "/citadel.control", "rb+");
                if (control_fp != NULL) {
                        fchown(fileno(control_fp), config.c_ctdluid, -1);
                }
        }
        if (control_fp == NULL) {
-               control_fp = fopen("citadel.control", "wb+");
+               control_fp = fopen(
+#ifndef HAVE_RUN_DIR
+                                                  "."
+#else
+                                                  RUN_DIR
+#endif
+                                                  "/citadel.control", "wb+");
                if (control_fp != NULL) {
                        fchown(fileno(control_fp), config.c_ctdluid, -1);
                        memset(&CitControl, 0, sizeof(struct CitControl));
@@ -194,7 +202,7 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_imap_port);
                cprintf("%ld\n", config.c_net_freq);
                cprintf("%d\n", config.c_disable_newu);
-               cprintf("%d\n", config.c_enable_fulltext);
+               cprintf("1\n"); /* niu */
                cprintf("%d\n", config.c_purge_hour);
 #ifdef HAVE_LDAP
                cprintf("%s\n", config.c_ldap_host);
@@ -214,6 +222,10 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_imaps_port);
                cprintf("%d\n", config.c_pop3s_port);
                cprintf("%d\n", config.c_smtps_port);
+               cprintf("%d\n", config.c_enable_fulltext);
+               cprintf("%d\n", config.c_auto_cull);
+               cprintf("%d\n", config.c_instant_expunge);
+               cprintf("%d\n", config.c_allow_spoofing);
                cprintf("000\n");
        }
 
@@ -344,7 +356,7 @@ void cmd_conf(char *argbuf)
                                        config.c_disable_newu = 1;
                                break;
                        case 30:
-                               config.c_enable_fulltext = atoi(buf);
+                               /* niu */
                                break;
                        case 31:
                                if ((config.c_purge_hour >= 0)
@@ -388,6 +400,18 @@ void cmd_conf(char *argbuf)
                        case 41:
                                config.c_smtps_port = atoi(buf);
                                break;
+                       case 42:
+                               config.c_enable_fulltext = atoi(buf);
+                               break;
+                       case 43:
+                               config.c_auto_cull = atoi(buf);
+                               break;
+                       case 44:
+                               config.c_instant_expunge = atoi(buf);
+                               break;
+                       case 45:
+                               config.c_allow_spoofing = atoi(buf);
+                               break;
                        }
                        ++a;
                }
@@ -399,6 +423,14 @@ void cmd_conf(char *argbuf)
 
                if (strlen(config.c_logpages) > 0)
                        create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
+
+               /* If full text indexing has been disabled, invalidate the
+                * index so it doesn't try to use it later.
+                */
+               if (!config.c_enable_fulltext == 0) {
+                       CitControl.fulltext_wordbreaker = 0;
+                       put_control();
+               }
        }
 
        else if (!strcasecmp(cmd, "GETSYS")) {