* Removed the unfinished moderation system.
authorArt Cancro <ajc@citadel.org>
Sun, 12 May 2002 22:57:06 +0000 (22:57 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 12 May 2002 22:57:06 +0000 (22:57 +0000)
* CtdlForEachMessage() - only fetch metadata when hunting for messages with
  a specified Content-type.  Serious performance boost.

21 files changed:
citadel/ChangeLog
citadel/Makefile.in
citadel/citadel.h
citadel/control.c
citadel/msgbase.c
citadel/msgbase.h
citadel/routines.c
citadel/routines2.c
citadel/serv_expire.c
citadel/serv_imap.c
citadel/serv_inetcfg.c
citadel/serv_moderate.c [deleted file]
citadel/serv_network.c
citadel/serv_pop3.c
citadel/serv_smtp.c
citadel/serv_vandelay.c
citadel/serv_vcard.c
citadel/server.h
citadel/techdoc/moderation.txt [deleted file]
citadel/techdoc/session.txt
citadel/user_ops.c

index 8f094406a1ea4b6e2a540f55905838d52a08e8fe..8880aca360ec6b3ca577af0e6e99dc189f57587e 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 591.19  2002/05/12 22:57:04  ajc
+ * Removed the unfinished moderation system.
+ * CtdlForEachMessage() - only fetch metadata when hunting for messages with
+   a specified Content-type.  Serious performance boost.
+
  Revision 591.18  2002/05/05 17:33:09  error
  * screen.c: fix lack of beeps in curses mode
 
@@ -3634,4 +3639,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 90b6589156f60490691dd9e3b63535dfb7d4c280..9d6654ba491c79057a3a16b6cdcb80ad97122888 100644 (file)
@@ -35,7 +35,6 @@ SERV_MODULES=modules/libchat.la modules/libvcard.la \
        modules/libpas2.la \
        modules/libinetcfg.la \
        modules/librwho.la \
-       modules/libmoderate.la \
        modules/libbio.la \
        modules/libexpire.la \
        modules/libvandelay.la \
@@ -86,7 +85,7 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c \
        auth.c chkpwd.c html.c vcard.c serv_upgrade.c serv_vandelay.c \
        serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
        $(DOMAIN) clientsocket.c serv_inetcfg.c serv_rwho.c serv_bio.c \
-       serv_moderate.c client_passwords.c imap_misc.c serv_netfilter.c \
+       client_passwords.c imap_misc.c serv_netfilter.c \
        serv_imap.c imap_tools.c imap_fetch.c imap_search.c imap_store.c \
        serv_network.c serv_pas2.c serv_ical.c md5.c server_main.c
 
@@ -161,9 +160,6 @@ modules/libinetcfg.la: serv_inetcfg.lo $(LIBTOOL) libcitserver.la
 modules/librwho.la: serv_rwho.lo $(LIBTOOL) libcitserver.la
        $(LTSHARE) -o librwho.la ../serv_rwho.lo ../libcitserver.la
 
-modules/libmoderate.la: serv_moderate.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libmoderate.la ../serv_moderate.lo ../libcitserver.la
-
 modules/libbio.la: serv_bio.lo $(LIBTOOL) libcitserver.la
        $(LTSHARE) -o libbio.la ../serv_bio.lo ../libcitserver.la
 
index 77102c3671e1baa1b2bafeeea19333ad55ef1dcd..e0119bfffe6fa775ed56a1419eaa701c4bcd660c 100644 (file)
@@ -114,7 +114,7 @@ struct config {
        int c_max_workers;              /* Upper limit on number of threads */
        int c_pop3_port;                /* POP3 listener port (usually 110) */
        int c_smtp_port;                /* SMTP listener port (usually 25)  */
-       int c_default_filter;           /* Default moderation filter level  */
+       int c_unused_1;                 /* Nothin' here anymore...          */
        int c_aide_zap;                 /* Are Aides allowed to zap rooms?  */
        int c_imap_port;                /* IMAP listener port (usually 143) */
        time_t c_net_freq;              /* how often to run the networker   */
@@ -149,7 +149,6 @@ struct usersupp {                   /* User record                      */
        char fullname[64];              /* Name for Citadel messages & mail */
        CIT_UBYTE USscreenwidth;        /* Screen width (for textmode users)*/
        CIT_UBYTE USscreenheight;       /* Screen height(for textmode users)*/
-       char moderation_filter;         /* Moderation filter level          */
 };
 
 
index 62b0ac2885bf8d12f245e656c9ed44a8901f42c5..8a507f22c7edceae28d93a5b3570428657cc356d 100644 (file)
@@ -56,7 +56,8 @@ FILE *control_fp = NULL;
 /*
  * get_control  -  read the control record into memory.
  */
-void get_control(void) {
+void get_control(void)
+{
 
        /* Zero it out.  If the control record on disk is missing or short,
         * the system functions with all control record fields initialized
@@ -75,7 +76,7 @@ void get_control(void) {
                        fchown(fileno(control_fp), config.c_bbsuid, -1);
                        memset(&CitControl, 0, sizeof(struct CitControl));
                        fwrite(&CitControl, sizeof(struct CitControl),
-                               1, control_fp);
+                              1, control_fp);
                        rewind(control_fp);
                }
        }
@@ -87,66 +88,72 @@ void get_control(void) {
 
        rewind(control_fp);
        fread(&CitControl, sizeof(struct CitControl), 1, control_fp);
-       }
+}
 
 /*
  * put_control  -  write the control record to disk.
  */
-void put_control(void) {
+void put_control(void)
+{
 
        if (control_fp != NULL) {
                rewind(control_fp);
-               fwrite(&CitControl, sizeof(struct CitControl), 1, control_fp);
+               fwrite(&CitControl, sizeof(struct CitControl), 1,
+                      control_fp);
                fflush(control_fp);
-               }
        }
+}
 
 
 /*
  * get_new_message_number()  -  Obtain a new, unique ID to be used for a message.
  */
-long get_new_message_number(void) {
+long get_new_message_number(void)
+{
        begin_critical_section(S_CONTROL);
        get_control();
        ++CitControl.MMhighest;
        put_control();
        end_critical_section(S_CONTROL);
-       return(CitControl.MMhighest);
-       }
+       return (CitControl.MMhighest);
+}
 
 
 /*
  * get_new_user_number()  -  Obtain a new, unique ID to be used for a user.
  */
-long get_new_user_number(void) {
+long get_new_user_number(void)
+{
        begin_critical_section(S_CONTROL);
        get_control();
        ++CitControl.MMnextuser;
        put_control();
        end_critical_section(S_CONTROL);
-       return(CitControl.MMnextuser);
-       }
+       return (CitControl.MMnextuser);
+}
 
 
 
 /*
  * get_new_room_number()  -  Obtain a new, unique ID to be used for a room.
  */
-long get_new_room_number(void) {
+long get_new_room_number(void)
+{
        begin_critical_section(S_CONTROL);
        get_control();
        ++CitControl.MMnextroom;
        put_control();
        end_critical_section(S_CONTROL);
-       return(CitControl.MMnextroom);
-       }
+       return (CitControl.MMnextroom);
+}
 
 
 
 /* 
  * Get or set global configuration options
  */
-void cmd_conf(char *argbuf) {
+void cmd_conf(char *argbuf)
+{
        char cmd[SIZ];
        char buf[SIZ];
        int a;
@@ -183,125 +190,156 @@ void cmd_conf(char *argbuf) {
                cprintf("%d\n", config.c_max_workers);
                cprintf("%d\n", config.c_pop3_port);
                cprintf("%d\n", config.c_smtp_port);
-               cprintf("%d\n", config.c_default_filter);
+               cprintf("0\n"); /* position 25 no longer exists */
                cprintf("%d\n", config.c_aide_zap);
                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_aide_mailboxes);
                cprintf("000\n");
-               }
+       }
 
        else if (!strcasecmp(cmd, "SET")) {
                cprintf("%d Send configuration...\n", SEND_LISTING);
                a = 0;
                while (client_gets(buf), strcmp(buf, "000")) {
-                   switch(a) {
-                       case 0: safestrncpy(config.c_nodename, buf,
-                                       sizeof config.c_nodename);
+                       switch (a) {
+                       case 0:
+                               safestrncpy(config.c_nodename, buf,
+                                           sizeof config.c_nodename);
                                break;
-                       case 1: safestrncpy(config.c_fqdn, buf,
-                                       sizeof config.c_fqdn);
+                       case 1:
+                               safestrncpy(config.c_fqdn, buf,
+                                           sizeof config.c_fqdn);
                                break;
-                       case 2: safestrncpy(config.c_humannode, buf,
-                                       sizeof config.c_humannode);
+                       case 2:
+                               safestrncpy(config.c_humannode, buf,
+                                           sizeof config.c_humannode);
                                break;
-                       case 3: safestrncpy(config.c_phonenum, buf,
-                                       sizeof config.c_phonenum);
+                       case 3:
+                               safestrncpy(config.c_phonenum, buf,
+                                           sizeof config.c_phonenum);
                                break;
-                       case 4: config.c_creataide = atoi(buf);
+                       case 4:
+                               config.c_creataide = atoi(buf);
                                break;
-                       case 5: config.c_sleeping = atoi(buf);
+                       case 5:
+                               config.c_sleeping = atoi(buf);
                                break;
-                       case 6: config.c_initax = atoi(buf);
-                               if (config.c_initax < 1) config.c_initax = 1;
-                               if (config.c_initax > 6) config.c_initax = 6;
+                       case 6:
+                               config.c_initax = atoi(buf);
+                               if (config.c_initax < 1)
+                                       config.c_initax = 1;
+                               if (config.c_initax > 6)
+                                       config.c_initax = 6;
                                break;
-                       case 7: config.c_regiscall = atoi(buf);
+                       case 7:
+                               config.c_regiscall = atoi(buf);
                                if (config.c_regiscall != 0)
                                        config.c_regiscall = 1;
                                break;
-                       case 8: config.c_twitdetect = atoi(buf);
+                       case 8:
+                               config.c_twitdetect = atoi(buf);
                                if (config.c_twitdetect != 0)
                                        config.c_twitdetect = 1;
                                break;
-                       case 9: safestrncpy(config.c_twitroom, buf,
-                                       sizeof config.c_twitroom);
+                       case 9:
+                               safestrncpy(config.c_twitroom, buf,
+                                           sizeof config.c_twitroom);
                                break;
-                       case 10: safestrncpy(config.c_moreprompt, buf,
-                                       sizeof config.c_moreprompt);
+                       case 10:
+                               safestrncpy(config.c_moreprompt, buf,
+                                           sizeof config.c_moreprompt);
                                break;
-                       case 11: config.c_restrict = atoi(buf);
+                       case 11:
+                               config.c_restrict = atoi(buf);
                                if (config.c_restrict != 0)
                                        config.c_restrict = 1;
                                break;
-                       case 12: safestrncpy(config.c_bbs_city, buf,
-                                       sizeof config.c_bbs_city);
+                       case 12:
+                               safestrncpy(config.c_bbs_city, buf,
+                                           sizeof config.c_bbs_city);
                                break;
-                       case 13: safestrncpy(config.c_sysadm, buf,
-                                       sizeof config.c_sysadm);
+                       case 13:
+                               safestrncpy(config.c_sysadm, buf,
+                                           sizeof config.c_sysadm);
                                break;
-                       case 14: config.c_maxsessions = atoi(buf);
+                       case 14:
+                               config.c_maxsessions = atoi(buf);
                                if (config.c_maxsessions < 1)
                                        config.c_maxsessions = 1;
                                break;
-                       case 15: safestrncpy(config.c_net_password, buf,
-                                       sizeof config.c_net_password);
+                       case 15:
+                               safestrncpy(config.c_net_password, buf,
+                                           sizeof config.c_net_password);
                                break;
-                       case 16: config.c_userpurge = atoi(buf);
+                       case 16:
+                               config.c_userpurge = atoi(buf);
                                break;
-                       case 17: config.c_roompurge = atoi(buf);
+                       case 17:
+                               config.c_roompurge = atoi(buf);
                                break;
-                       case 18: safestrncpy(config.c_logpages, buf,
-                                       sizeof config.c_logpages);
+                       case 18:
+                               safestrncpy(config.c_logpages, buf,
+                                           sizeof config.c_logpages);
                                break;
-                       case 19: config.c_createax = atoi(buf);
+                       case 19:
+                               config.c_createax = atoi(buf);
                                if (config.c_createax < 1)
                                        config.c_createax = 1;
                                if (config.c_createax > 6)
                                        config.c_createax = 6;
                                break;
-                       case 20: if (atoi(buf) >= 8192)
+                       case 20:
+                               if (atoi(buf) >= 8192)
                                        config.c_maxmsglen = atoi(buf);
                                break;
-                       case 21: if (atoi(buf) >= 2)
+                       case 21:
+                               if (atoi(buf) >= 2)
                                        config.c_min_workers = atoi(buf);
-                       case 22: if (atoi(buf) >= config.c_min_workers)
+                       case 22:
+                               if (atoi(buf) >= config.c_min_workers)
                                        config.c_max_workers = atoi(buf);
-                       case 23: config.c_pop3_port = atoi(buf);
+                       case 23:
+                               config.c_pop3_port = atoi(buf);
                                break;
-                       case 24: config.c_smtp_port = atoi(buf);
+                       case 24:
+                               config.c_smtp_port = atoi(buf);
                                break;
-                       case 25: config.c_default_filter = atoi(buf);
-                               break;
-                       case 26: config.c_aide_zap = atoi(buf);
+                               /* case 25 no longer exists */
+                       case 26:
+                               config.c_aide_zap = atoi(buf);
                                if (config.c_aide_zap != 0)
                                        config.c_aide_zap = 1;
                                break;
-                       case 27: config.c_imap_port = atoi(buf);
+                       case 27:
+                               config.c_imap_port = atoi(buf);
                                break;
-                       case 28: config.c_net_freq = atol(buf);
+                       case 28:
+                               config.c_net_freq = atol(buf);
                                break;
-                       case 29: config.c_disable_newu = atoi(buf);
+                       case 29:
+                               config.c_disable_newu = atoi(buf);
                                if (config.c_disable_newu != 0)
                                        config.c_disable_newu = 1;
                                break;
-                       case 30: config.c_aide_mailboxes = atoi(buf);
+                       case 30:
+                               config.c_aide_mailboxes = atoi(buf);
                                if (config.c_aide_mailboxes != 0)
                                        config.c_aide_mailboxes = 1;
                                break;
                        }
-                   ++a;
-                   }
+                       ++a;
+               }
                put_config();
-               snprintf(buf,sizeof buf,
+               snprintf(buf, sizeof buf,
                         "Global system configuration edited by %s\n",
                         CC->curr_user);
                aide_message(buf);
 
                if (strlen(config.c_logpages) > 0)
                        create_room(config.c_logpages, 3, "", 0, 1, 1);
-               }
+       }
 
        else if (!strcasecmp(cmd, "GETSYS")) {
                extract(confname, argbuf, 1);
@@ -309,27 +347,27 @@ void cmd_conf(char *argbuf) {
                if (confptr != NULL) {
                        cprintf("%d %s\n", LISTING_FOLLOWS, confname);
                        client_write(confptr, strlen(confptr));
-                       if (confptr[strlen(confptr)-1] != 10)
+                       if (confptr[strlen(confptr) - 1] != 10)
                                client_write("\n", 1);
                        cprintf("000\n");
                        phree(confptr);
-               }
-               else {
+               } else {
                        cprintf("%d No such configuration.\n",
-                               ERROR+ILLEGAL_VALUE);
+                               ERROR + ILLEGAL_VALUE);
                }
        }
 
        else if (!strcasecmp(cmd, "PUTSYS")) {
                extract(confname, argbuf, 1);
                cprintf("%d %s\n", SEND_LISTING, confname);
-               confptr = CtdlReadMessageBody("000", config.c_maxmsglen, NULL);
+               confptr =
+                   CtdlReadMessageBody("000", config.c_maxmsglen, NULL);
                CtdlPutSysConfig(confname, confptr);
                phree(confptr);
        }
 
        else {
                cprintf("%d Illegal option(s) specified.\n",
-                       ERROR+ILLEGAL_VALUE);
-               }
+                       ERROR + ILLEGAL_VALUE);
        }
+}
index c7683b0649510672f36ae16d811e7cf87a643233..7495257a3f23c1dbd364e298725faa68eedb38fc 100644 (file)
@@ -373,7 +373,6 @@ void CtdlSetSeen(long target_msgnum, int target_setting) {
  * current room.  (Returns the number of messages processed.)
  */
 int CtdlForEachMessage(int mode, long ref,
-                       int moderation_level,
                        char *content_type,
                        struct CtdlMessage *compare,
                        void (*CallBack) (long, void *),
@@ -414,19 +413,23 @@ int CtdlForEachMessage(int mode, long ref,
         * Now begin the traversal.
         */
        if (num_msgs > 0) for (a = 0; a < num_msgs; ++a) {
-               GetMetaData(&smi, msglist[a]);
-
-               /* Filter out messages that are moderated below the level
-                * currently being viewed at.
-                */
-               if (smi.meta_mod < moderation_level) {
-                       msglist[a] = 0L;
-               }
 
                /* If the caller is looking for a specific MIME type, filter
                 * out all messages which are not of the type requested.
                 */
                if (content_type != NULL) if (strlen(content_type) > 0) {
+
+                       /* This call to GetMetaData() sits inside this loop
+                        * so that we only do the extra database read per msg
+                        * if we need to.  Doing the extra read all the time
+                        * really kills the server.  If we ever need to use
+                        * metadata for another search criterion, we need to
+                        * move the read somewhere else -- but still be smart
+                        * enough to only do the read if the caller has
+                        * specified something that will need it.
+                        */
+                       GetMetaData(&smi, msglist[a]);
+
                        if (strcasecmp(smi.meta_content_type, content_type)) {
                                msglist[a] = 0L;
                        }
@@ -550,7 +553,6 @@ void cmd_msgs(char *cmdbuf)
        }
 
        CtdlForEachMessage(mode, cm_ref,
-               CC->usersupp.moderation_filter,
                NULL, template, simple_listing, NULL);
        if (template != NULL) CtdlFreeMessage(template);
        cprintf("000\n");
@@ -1691,8 +1693,7 @@ int ReplicationChecks(struct CtdlMessage *msg) {
        memset(template, 0, sizeof(struct CtdlMessage));
        template->cm_fields['E'] = strdoop(msg->cm_fields['E']);
 
-       CtdlForEachMessage(MSGS_ALL, 0L, (-127), NULL, template,
-               check_repl, NULL);
+       CtdlForEachMessage(MSGS_ALL, 0L, NULL, template, check_repl, NULL);
 
        /* If a newer message exists with the same Extended ID, abort
         * this save.
@@ -2946,7 +2947,7 @@ char *CtdlGetSysConfig(char *sysconfname) {
        /* We want the last (and probably only) config in this room */
        begin_critical_section(S_CONFIG);
        config_msgnum = (-1L);
-       CtdlForEachMessage(MSGS_LAST, 1, (-127), sysconfname, NULL,
+       CtdlForEachMessage(MSGS_LAST, 1, sysconfname, NULL,
                CtdlGetSysConfigBackend, NULL);
        msgnum = config_msgnum;
        end_critical_section(S_CONFIG);
index fd9389ba4c58541108dd1ea0089f91d51d538db9..9edb221cc5f4a335808408c97865b908340c8463 100644 (file)
@@ -85,7 +85,6 @@ void AdjRefCount(long, int);
 void simple_listing(long, void *);
 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
 int CtdlForEachMessage(int mode, long ref,
-                       int moderation_level,
                        char *content_type,
                        struct CtdlMessage *compare,
                         void (*CallBack) (long, void *),
index 8781a4077737150770893dd16b96fdaf3cf5ade6..9d75ee47b915139b9c537353e8fd652ad4b7c6b8 100644 (file)
@@ -249,8 +249,6 @@ void enter_config(int mode)
                "Enable color support",US_COLOR);
          }
        
-        /* filter = intprompt("Moderation filter level", filter, -63, 63); */
-
         }
 
        if (mode==2) {
index c38531e4260b3377d9b45612683f8e2635c87d1c..77d36c5758df3bb23a7a3d6d7913bd0c7946c4d8 100644 (file)
@@ -732,10 +732,6 @@ void do_system_configuration(void)
        strprompt("Name of system administrator", &sc[13][0], 25);
        strprompt("Paginator prompt", &sc[10][0], 79);
 
-       /* this prompt is commented out until we finish the moderation system
-       strprompt("Default moderation filter for new users", &sc[25][0], 4);
-       */
-
        /* Security parameters */
 
        snprintf(sc[7], sizeof sc[7], "%d", (boolprompt(
index c65fee436587cc1d947dd25535db3611936daf85..31f9a73fb4a2218ac37b9181c909b5598065cd91 100644 (file)
@@ -651,8 +651,7 @@ void do_fsck_msg(long msgnum, void *userdata) {
 void do_fsck_room(struct quickroom *qrbuf, void *data)
 {
        getroom(&CC->quickroom, qrbuf->QRname);
-       CtdlForEachMessage(MSGS_ALL, 0L, (-127), NULL, NULL,
-               do_fsck_msg, NULL);
+       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, do_fsck_msg, NULL);
 }
 
 /*
index fea7360e5c8a40f7b42faaec1164fc6161e56f1b..05acf5c0fafd1812e7f2c06dd427d67d98a74fe7 100644 (file)
@@ -156,7 +156,7 @@ void imap_load_msgids(void) {
 
        imap_free_msgids();     /* If there was already a map, free it */
 
-       CtdlForEachMessage(MSGS_ALL, 0L, (-63), NULL, NULL,
+       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL,
                imap_add_single_msgid, NULL);
 
        imap_set_seen_flags();
@@ -187,7 +187,7 @@ void imap_rescan_msgids(void) {
         for (i=0; i<IMAP->num_msgs; ++i) {
 
                count = CtdlForEachMessage(MSGS_EQ, IMAP->msgids[i],
-                       (-63), NULL, NULL, NULL, NULL);
+                       NULL, NULL, NULL, NULL);
 
                if (count == 0) {
                        cprintf("* %d EXPUNGE\r\n", i+1);
@@ -221,7 +221,7 @@ void imap_rescan_msgids(void) {
        /*
         * Now peruse the room for *new* messages only.
         */
-       CtdlForEachMessage(MSGS_GT, original_highest, (-63), NULL, NULL,
+       CtdlForEachMessage(MSGS_GT, original_highest, NULL, NULL,
                imap_add_single_msgid, NULL);
 
        imap_set_seen_flags();
index c9dbd2d7af5ba9f7e9e8d54468bed59b70dec240..99ad26586869b6b7a43a707ae2aa7aaa253c7910 100644 (file)
@@ -117,7 +117,7 @@ void inetcfg_init_backend(long msgnum, void *userdata) {
 
 void inetcfg_init(void) {
        if (getroom(&CC->quickroom, SYSCONFIGROOM) != 0) return;
-       CtdlForEachMessage(MSGS_LAST, 1, (-127), INTERNETCFG, NULL,
+       CtdlForEachMessage(MSGS_LAST, 1, INTERNETCFG, NULL,
                inetcfg_init_backend, NULL);
 }
 
diff --git a/citadel/serv_moderate.c b/citadel/serv_moderate.c
deleted file mode 100644 (file)
index 7d730eb..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * $Id$
- *
- * Server-side functions which handle message moderation.
- *
- */
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pwd.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include <sys/wait.h>
-#include <string.h>
-#include <limits.h>
-#include "citadel.h"
-#include "server.h"
-#include "sysdep_decls.h"
-#include "citserver.h"
-#include "support.h"
-#include "config.h"
-#include "control.h"
-#include "dynloader.h"
-#include "room_ops.h"
-#include "user_ops.h"
-#include "policy.h"
-#include "database.h"
-#include "msgbase.h"
-#include "tools.h"
-
-
-
-/*
- * moderate a message
- */
-void cmd_mmod(char *argbuf) {
-       long msgnum;
-       int newlevel;
-       struct MetaData smi;
-       int is_message_in_room;
-
-       /* user must be at least a Room Aide to moderate */
-       if (CtdlAccessCheck(ac_room_aide)) return;
-
-       msgnum = extract_long(argbuf, 0);
-       newlevel = extract_int(argbuf, 1);
-
-       if ( (newlevel < (-63)) || (newlevel > (+63)) ) {
-               cprintf("%d %d is not a valid moderation level.\n",
-                       ERROR+ILLEGAL_VALUE, newlevel);
-               return;
-       }
-
-       is_message_in_room = CtdlForEachMessage(MSGS_EQ, msgnum, (-127),
-                               NULL, NULL, NULL, NULL);
-       if (!is_message_in_room) {
-               cprintf("%d Message %ld is not in this room.\n",
-                       ERROR+ILLEGAL_VALUE, msgnum);
-               return;
-       }
-
-       GetMetaData(&smi, msgnum);
-       smi.meta_mod = newlevel;
-       PutMetaData(&smi);
-
-       cprintf("%d Message %ld is moderated to %d\n", CIT_OK, msgnum, newlevel);
-}
-
-
-char *Dynamic_Module_Init(void)
-{
-        CtdlRegisterProtoHook(cmd_mmod, "MMOD", "Moderate a message");
-        return "$Id$";
-}
index f6f79e5931568715b760e7854fbe350fd612348e..b8412e2d1e6e41a0ce5f3da93e29a5d51ae70e44 100644 (file)
@@ -615,7 +615,7 @@ void network_spoolout_room(char *room_to_spool) {
 
 
        /* Do something useful */
-       CtdlForEachMessage(MSGS_GT, sc.lastsent, (-63), NULL, NULL,
+       CtdlForEachMessage(MSGS_GT, sc.lastsent, NULL, NULL,
                network_spool_msg, &sc);
 
 
index 92a02c12b23864b88e56e3583bd790ccef072cc2..093764746427c5d4b6936a490073e905615b7dd9 100644 (file)
@@ -164,7 +164,7 @@ int pop3_grab_mailbox(void) {
        if (getroom(&CC->quickroom, MAILROOM) != 0) return(-1);
 
        /* Load up the messages */
-       CtdlForEachMessage(MSGS_ALL, 0L, (-63), NULL, NULL,
+       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL,
                pop3_add_message, NULL);
 
        /* Figure out which are old and which are new */
index b809a54ded360cf7bc483159784c78675b13eac5..6617cc2c4e465376e6e29afd4586ba190fb42624 100644 (file)
@@ -1293,7 +1293,7 @@ void smtp_do_queue(void) {
                lprintf(3, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
                return;
        }
-       CtdlForEachMessage(MSGS_ALL, 0L, (-127),
+       CtdlForEachMessage(MSGS_ALL, 0L,
                SPOOLMIME, NULL, smtp_do_procmsg, NULL);
 
        lprintf(7, "SMTP: queue run completed\n");
index 0a15b9275359d57e40888c2a6e78c0b202e763a6..41c6e5e1473e90d73b1b5bfc82898e9ef8d2113c 100644 (file)
@@ -65,7 +65,6 @@ void artv_export_users_backend(struct usersupp *usbuf, void *data) {
        cprintf("%s\n", usbuf->fullname);
        cprintf("%d\n", usbuf->USscreenwidth);
        cprintf("%d\n", usbuf->USscreenheight);
-       cprintf("%d\n", usbuf->moderation_filter);
 }
 
 
@@ -103,7 +102,7 @@ void artv_export_rooms_backend(struct quickroom *qrbuf, void *data) {
        /* format of message list export is all message numbers output
         * one per line terminated by a 0.
         */
-       CtdlForEachMessage(MSGS_ALL, 0L, (-127), NULL, NULL,
+       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL,
                artv_export_room_msg, NULL);
        cprintf("0\n");
 
@@ -200,7 +199,6 @@ void artv_export_message(long msgnum) {
        cprintf("%ld\n", msgnum);
        cprintf("%d\n", smi.meta_refcount);
        cprintf("%s\n", smi.meta_content_type);
-       cprintf("%d\n", smi.meta_mod);
 
        serialize_message(&smr, msg);
        CtdlFreeMessage(msg);
@@ -287,7 +285,6 @@ void artv_do_export(void) {
        cprintf("%d\n", config.c_max_workers);
        cprintf("%d\n", config.c_pop3_port);
        cprintf("%d\n", config.c_smtp_port);
-       cprintf("%d\n", config.c_default_filter);
 
        /* Export the control file */
        get_control();
@@ -348,7 +345,6 @@ void artv_import_config(void) {
        client_gets(buf);       config.c_max_workers = atoi(buf);
        client_gets(buf);       config.c_pop3_port = atoi(buf);
        client_gets(buf);       config.c_smtp_port = atoi(buf);
-       client_gets(buf);       config.c_default_filter = atoi(buf);
        put_config();
        lprintf(7, "Imported config file\n");
 }
@@ -386,7 +382,6 @@ void artv_import_user(void) {
        client_gets(usbuf.fullname);
        client_gets(buf);       usbuf.USscreenwidth = atoi(buf);
        client_gets(buf);       usbuf.USscreenheight = atoi(buf);
-       client_gets(buf);       usbuf.moderation_filter = atoi(buf);
        putuser(&usbuf);
 }
 
@@ -482,7 +477,6 @@ void artv_import_message(void) {
                                smi.meta_msgnum = msgnum;
        client_gets(buf);       smi.meta_refcount = atoi(buf);
        client_gets(smi.meta_content_type);
-       client_gets(buf);       smi.meta_mod = atoi(buf);
 
        lprintf(7, "message #%ld\n", msgnum);
 
index 4c78a62c8bad83f8f2ec216728fdff98b70f3452..8fa14ffc81248b01a2358c1bb7761a6df01f873a 100644 (file)
@@ -185,7 +185,7 @@ void cmd_igab(char *argbuf) {
        CtdlDirectoryInit();
 
         /* We want the last (and probably only) vcard in this room */
-        CtdlForEachMessage(MSGS_ALL, 0, (-127), "text/x-vcard",
+        CtdlForEachMessage(MSGS_ALL, 0, "text/x-vcard",
                NULL, vcard_add_to_directory, NULL);
 
         getroom(&CC->quickroom, hold_rm);      /* return to saved room */
@@ -419,7 +419,7 @@ struct vCard *vcard_get_user(struct usersupp *u) {
 
         /* We want the last (and probably only) vcard in this room */
        VC->msgnum = (-1);
-        CtdlForEachMessage(MSGS_LAST, 1, (-127), "text/x-vcard",
+        CtdlForEachMessage(MSGS_LAST, 1, "text/x-vcard",
                NULL, vcard_gu_backend, NULL);
         getroom(&CC->quickroom, hold_rm);      /* return to saved room */
 
index 380ebc3b6e2ac00dcb130931541f0265f4d5ac0e..30c190ec8291f3dcd0a8abed0170d7662fa1925e 100644 (file)
@@ -430,7 +430,6 @@ struct MetaData {
        long meta_msgnum;       /* Message number in *local* message base */
        int meta_refcount;      /* Number of rooms which point to this msg */
        char meta_content_type[64];
-       char meta_mod;          /* Moderated to what level? */
        /* more stuff will be added to this record in the future */
 };
 
diff --git a/citadel/techdoc/moderation.txt b/citadel/techdoc/moderation.txt
deleted file mode 100644 (file)
index 2f4d7cd..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-(NOTE: the moderation system is not finished yet, and as such, as been
-disabled in the current release.)
-
- TECHNICAL DISCUSSION OF THE CITADEL/UX MODERATION SYSTEM
- Starting with version ?.??, the Citadel system supports moderation of
-messages.  This is used for both internal processing and for the more
-traditional filtering purposes.
- The central design thrust behind this design is to maximize the
-"signal to noise ratio" while minimizing "censorship."  Users may choose to
-filter at a very low threshold, reading everything, or at a higher threshold,
-reading only selected messages.
- Each message now carries a moderation level in its supplementary message base
-record (smi.smi_mod).  This is an 8-bit signed integer with values ranging from
--127 to 127.  The following standards apply:
-
-
-       LEVEL           PURPOSE
-
-       -127            "System overhead" message.  These should never be
-                       shown to users.  An overhead message might contain
-                       the room's network configuration or something to that
-                       effect.  (Not yet implemented, but we probably will
-                       do it this way.)
-
-       -100            Deleted message.  Aides might choose to browse deleted
-                       messages, un-deleting them if appropriate.
-
-       -63 to +63      Normal user-mode messages.  All messages start out at
-                       level 0 when first posted (or when no supplementary
-                       message base record exists).
-
-
- On a typical hobbyist BBS with a small administrative staff, most messages
-will remain at level 0, with perhaps the off-topic ones getting moderated
-to -1 or -2, providing the less tolerant users with a way of avoiding reading
-through drivel.
- On a very large system with many active moderators, there might be a high
-level of activity involving moderating _up_ the messages that are the most
-poignant or pertinent.  In this case, users might choose to filter at a level
-higher than 0, seeing only the messages that someone decided were worth
-reading.
index 25d1e91a80329b945a7fd753b908309c17eb0423..494fdef8c37f5b756f65b9b605d1f9e9d1a56fa3 100644 (file)
@@ -297,18 +297,15 @@ following meanings:
  #define US_PAGINATOR  2048            /* Pause after each screen of text  */
  
  There are other bits, too, but they can't be changed by the user (see below).
- The fourth parameter, if present, is the moderation level this user is
-filtering at.
+  
+  
  SETU   (SET User configuration)
  
  This command does the opposite of SETU: it takes the screen dimensions and
 user options (which were probably obtained with a GETU command, and perhaps
 modified by the user) and writes them to the user account.  This command
-should be passed four parameters: the screen width, the screen height,
-the option bits (see above), and the desired moderation level to filter at.
+should be passed three parameters: the screen width, the screen height, and
+the option bits (see above).
  
  Note that there exist bits here which are not listed in this document.  Some
 are flags that can only be set by Aides or the system administrator.  SETU
@@ -1708,7 +1705,7 @@ fails for any reason, ERROR is returned.
  23. Maximum number of worker threads
  24. Port number for POP3 service
  25. Port number for SMTP service
- 26. Default moderation filter level for new users (-63 to +63)
+ 26. (unused)
  27. Flag (0 or 1) - allow Aides to zap (forget) rooms
  28. Port number for IMAP service
  29. How often (in seconds) to run the networker
@@ -1792,20 +1789,6 @@ The command returns ERROR if it fails; otherwise, it returns OK followed by a
 number representing the current state of the flag.
  
   
- MMOD   (MODerate a Message)
-  
- Set or change the moderation level of a message.  The two parameters passed
-to this command should be the message number and the desired moderation level.
-Please refer to the "moderation.txt" document for a description of some
-commonly used moderation levels.
- If the command succeeds, OK is returned.  If the specified message does not
-exist in the current room, or if the specified moderation level is not within
-acceptable limits, ERROR+ILLEGAL_VALUE is returned.  This command requires at
-least Room Aide access; if the calling user is not an Aide, or a Room Aide for
-the current room, ERROR+HIGHER_ACCESS_REQUIRED is returned.
  REQT   (REQuest client Termination)
  
  Request that the specified client (or all clients) log off.  Aide level
index 046e60e04487fca899746a6159ab74e5fc49fb0c..180b55c8fb16ea9294d47f42dfc6b873c044a008 100644 (file)
@@ -81,9 +81,6 @@ int getuser(struct usersupp *usbuf, char name[])
                sizeof(struct usersupp) : cdbus->len));
        cdb_free(cdbus);
 
-       if (usbuf->version < 573) {
-               CC->usersupp.moderation_filter = config.c_default_filter;
-       }
        return (0);
 }
 
@@ -722,7 +719,6 @@ int create_user(char *newusername, int become_user)
        usbuf.USscreenwidth = 80;
        usbuf.USscreenheight = 24;
        usbuf.lastcall = time(NULL);
-       usbuf.moderation_filter = config.c_default_filter;
 
        /* fetch a new user number */
        usbuf.usernum = get_new_user_number();
@@ -900,12 +896,11 @@ void cmd_getu(void)
                return;
 
        getuser(&CC->usersupp, CC->curr_user);
-       cprintf("%d %d|%d|%d|%d\n",
+       cprintf("%d %d|%d|%d|\n",
                CIT_OK,
                CC->usersupp.USscreenwidth,
                CC->usersupp.USscreenheight,
-               (CC->usersupp.flags & US_USER_SET),
-               CC->usersupp.moderation_filter
+               (CC->usersupp.flags & US_USER_SET)
            );
 }
 
@@ -930,25 +925,6 @@ void cmd_setu(char *new_parms)
        CC->usersupp.flags = CC->usersupp.flags |
            (extract_int(new_parms, 2) & US_USER_SET);
 
-       if (num_parms(new_parms) >= 4) {
-               new_mod = extract_int(new_parms, 3);
-               lprintf(9, "new_mod extracted to %d\n", new_mod);
-
-               /* Aides cannot set the filter level lower than -100 */
-               if (new_mod < (-100))
-                       new_mod = -100;
-
-               /* Normal users cannot set the filter level lower than -63 */
-               if ((new_mod < (-63)) && (CC->usersupp.axlevel < 6))
-                       new_mod = -63;
-
-               /* Nobody can set the filter level higher than +63 */
-               if (new_mod > 63)
-                       new_mod = 63;
-
-               CC->usersupp.moderation_filter = new_mod;
-               lprintf(9, "new_mod processed to %d\n", new_mod);
-       }
        lputuser(&CC->usersupp);
        cprintf("%d Ok\n", CIT_OK);
 }