* Changed some of the rev-level sensitive stuff to look at the actual version
authorArt Cancro <ajc@citadel.org>
Fri, 26 May 2000 19:27:51 +0000 (19:27 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 26 May 2000 19:27:51 +0000 (19:27 +0000)
  of Citadel running, not the last version with which we ran setup
* Added a moderation system.  Default filter level for new users is in the
  config file.  Per-user setting is in usersupp.  Moderation level of each
  message is in SuppMsgInfo.  Tweaked CONF, GETU, and SETU.  Read filter is
  working.  Moderate message up/down commands are not here yet.  See
  techdoc/moderation.txt for more info.

20 files changed:
citadel/ChangeLog
citadel/citadel.h
citadel/commands.c
citadel/control.c
citadel/msgbase.c
citadel/msgbase.h
citadel/network/mail.sysinfo
citadel/routines.c
citadel/routines2.c
citadel/serv_expire.c
citadel/serv_icq.c
citadel/serv_inetcfg.c
citadel/serv_pop3.c
citadel/serv_smtp.c
citadel/serv_upgrade.c
citadel/serv_vcard.c
citadel/server.h
citadel/techdoc/moderation.txt [new file with mode: 0644]
citadel/techdoc/session.txt
citadel/user_ops.c

index f58aba15020023357a11804da47a234e3e6ff7e6..9fe53ba4cbdcd2bd85a6ce36bf49bea82e33747c 100644 (file)
@@ -1,4 +1,13 @@
  $Log$
+ Revision 572.1  2000/05/26 19:27:51  ajc
+ * Changed some of the rev-level sensitive stuff to look at the actual version
+   of Citadel running, not the last version with which we ran setup
+ * Added a moderation system.  Default filter level for new users is in the
+   config file.  Per-user setting is in usersupp.  Moderation level of each
+   message is in SuppMsgInfo.  Tweaked CONF, GETU, and SETU.  Read filter is
+   working.  Moderate message up/down commands are not here yet.  See
+   techdoc/moderation.txt for more info.
+
  Revision 572.0  2000/05/23 02:09:30  ajc
  * Updated docs and tagged everything for the 5.72 release
 
@@ -1881,3 +1890,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index 6e467542d3d4ba14a545e30170cebe372cf6f00b..d31dc797596cbd6226fefc9bfa537bf19bb61ea7 100644 (file)
@@ -9,7 +9,7 @@
 #include "sysconfig.h"
 #include "ipcdef.h"
 
-#define CITADEL        "Citadel/UX 5.72"       /* Text description of this software */
+#define CITADEL        "Citadel/UX 5.73"       /* Text description of this software */
 
 /*
  * REV_LEVEL is the current version number (multiplied by 100 to avoid having
@@ -18,7 +18,7 @@
  * are older than REV_MIN, none of the programs will work until the setup
  * program is run again to bring things up to date.
  */
-#define REV_LEVEL      572             /* This version */
+#define REV_LEVEL      573             /* This version */
 #define REV_MIN                570             /* Oldest compatible version */
 
 #define SERVER_TYPE 0  /* zero for stock Citadel/UX; other developers please
@@ -89,6 +89,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  */
 };
 
 #define NODENAME               config.c_nodename
@@ -118,6 +119,7 @@ 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 da810085c8d351a6ec501f911e80d3c4641ccbdd..3a6fb8af6681f3a53cac56cc76cc2c4f61547f8f 100644 (file)
@@ -40,6 +40,7 @@
 #include "routines.h"
 #include "routines2.h"
 #include "tools.h"
+#include "rooms.h"
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
 #endif
@@ -485,7 +486,9 @@ int intprompt(char *prompt, int ival, int imin, int imax)
                strprompt(prompt, buf, 15);
                i = atoi(buf);
                for (p=0; p<strlen(buf); ++p) {
-                       if (!isdigit(buf[p])) i = imin - 1;
+                       if ( (!isdigit(buf[p]))
+                          && ( (buf[p]!='-') || (p!=0) )  )
+                               i = imin - 1;
                }
                if (i < imin)
                        printf("*** Must be no less than %d.\n", imin);
index da104026899e722724547a1add38ef94b70afc9a..3616a15c641df566f4fd269172daab6195a22c21 100644 (file)
@@ -167,6 +167,7 @@ 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("000\n");
                }
 
@@ -250,6 +251,8 @@ void cmd_conf(char *argbuf) {
                                break;
                        case 24: config.c_smtp_port = atoi(buf);
                                break;
+                       case 25: config.c_default_filter = atoi(buf);
+                               break;
                        }
                    ++a;
                    }
index f24c23cbd1f749d6e7fe4380e819e3dd0ba5b81a..1b819f8e833fcc05bb95fe08d4da7a61574864c0 100644 (file)
@@ -268,6 +268,7 @@ int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template) {
  * current room.
  */
 void CtdlForEachMessage(int mode, long ref,
+                       int moderation_level,
                        char *content_type,
                        struct CtdlMessage *compare,
                        void (*CallBack) (long msgnum))
@@ -299,18 +300,25 @@ void CtdlForEachMessage(int mode, long ref,
        }
 
 
-       /* If the caller is looking for a specific MIME type, then filter
-        * out all messages which are not of the type requested.
-        */
-       if (num_msgs > 0)
-               if (content_type != NULL)
-                       if (strlen(content_type) > 0)
-                               for (a = 0; a < num_msgs; ++a) {
-                                       GetSuppMsgInfo(&smi, msglist[a]);
-                                       if (strcasecmp(smi.smi_content_type, content_type)) {
-                                               msglist[a] = 0L;
-                                       }
-                               }
+       if (num_msgs > 0) for (a = 0; a < num_msgs; ++a) {
+               GetSuppMsgInfo(&smi, msglist[a]);
+
+               /* Filter out messages that are moderated below the level
+                * currently being viewed at.
+                */
+               if (smi.smi_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) {
+                       if (strcasecmp(smi.smi_content_type, content_type)) {
+                               msglist[a] = 0L;
+                       }
+               }
+       }
 
        num_msgs = sort_msglist(msglist, num_msgs);
 
@@ -419,7 +427,9 @@ void cmd_msgs(char *cmdbuf)
                cprintf("%d Message list...\n", LISTING_FOLLOWS);
        }
 
-       CtdlForEachMessage(mode, cm_ref, NULL, template, simple_listing);
+       CtdlForEachMessage(mode, cm_ref,
+               CC->usersupp.moderation_filter,
+               NULL, template, simple_listing);
        if (template != NULL) CtdlFreeMessage(template);
        cprintf("000\n");
 }
@@ -1463,7 +1473,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, NULL, template, check_repl);
+       CtdlForEachMessage(MSGS_ALL, 0L, (-127), NULL, template, check_repl);
 
        /* If a newer message exists with the same Extended ID, abort
         * this save.
@@ -2538,7 +2548,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, sysconfname, NULL,
+       CtdlForEachMessage(MSGS_LAST, 1, (-127), sysconfname, NULL,
                CtdlGetSysConfigBackend);
        msgnum = config_msgnum;
        end_critical_section(S_CONFIG);
index a87c01a4d7a677f75b94f32c99ed97f4255d2609..90be1d3af37a4aa11f6cd79be67c45db6cb9302c 100644 (file)
@@ -71,6 +71,7 @@ void AdjRefCount(long, int);
 void simple_listing(long);
 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
 void CtdlForEachMessage(int mode, long ref,
+                       int moderation_level,
                        char *content_type,
                        struct CtdlMessage *compare,
                         void (*CallBack) (long msgnum) );
index 906ae3e37e78df7202bf0aedbf47790be2f6f400..3eb9dfd984f2e22d87925109347cfb1a678a33c7 100644 (file)
 bin Mail
 bin Mail
-phonenum netproc[14852]: Adding neighbor system <bin Mail> to map
-gdom system <bin Mail> to map
+phonenum netproc[669]: Adding neighbor system <bin Mail> to map
+gdom stem <bin Mail> to map
 humannode ¸\94\ 4\b\88óÿ¿\8cóÿ¿
-lastcontact 954257820 Tue Mar 28 10:37:00 2000
+lastcontact 957973020 Wed May 10 11:37:00 2000
 
 bin Mail
 bin Mail
-phonenum netproc[4535]: Adding neighbor system <ctestsys> to map
-gdom ystem <ctestsys> to map
+phonenum netproc[13593]: Adding neighbor system <bin Mail> to map
+gdom system <bin Mail> to map
 humannode ¸\94\ 4\b\88óÿ¿\8cóÿ¿
-lastcontact 953919421 Fri Mar 24 12:37:01 2000
+lastcontact 957451021 Thu May  4 10:37:01 2000
 
-ctestsys
+dogpound2
 use uncnsrd
-phonenum US 612 470 9635
-gdom MN
-humannode C-86 Test System
-lastcontact 953365023 Sat Mar 18 02:37:03 2000
+phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
+gdom or system <sbn> to map
+humannode Dog Pound BBS II
+lastcontact 959351838 Fri May 26 10:37:18 2000
 
-bccs
+feathers
 use uncnsrd
-phonenum netproc[7145]: Adding non-neighbor system <internet> to map
-gdom or system <internet> to map
-humannode BCCS
-lastcontact 953519823 Sun Mar 19 21:37:03 2000
-
-internet
-uum %s
-humannode Internet Gateway
-lastcontact 954265024 Tue Mar 28 12:37:04 2000
-
-uncnsrd
-bin Mail
-phonenum US 914 244 3252
-humannode Uncensored
-lastcontact 953980623 Sat Mar 25 05:37:03 2000
-
-test
-bin Mail
+phonenum CA (604) 589-8539
+gdom BC
+humannode Feathers & Furballs
+lastcontact 957865023 Tue May  9 05:37:03 2000
 
-tesseract
-bin Mail
-phonenum US 800 555 1212
-humannode Tesseract Project
-lastcontact 954265024 Tue Mar 28 12:37:04 2000
+amigazon
+use uncnsrd
+phonenum US (609) 953 8159
+gdom NJ
+humannode The Amiga Zone
+lastcontact 959287024 Thu May 25 16:37:04 2000
 
-pixel
+haven
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <tesseract> to map
-gdom or system <tesseract> to map
-humannode PixelBBS
-lastcontact 953527024 Sun Mar 19 23:37:04 2000
+phonenum netproc[4026]: Adding non-neighbor system <barbaria> to map
+gdom or system <barbaria> to map
+humannode Haven BBS
+lastcontact 959200623 Wed May 24 16:37:03 2000
 
 barbaria
 use uncnsrd
 phonenum netproc[4026]: Adding non-neighbor system <pixel> to map
 gdom or system <pixel> to map
 humannode Barbaria
-lastcontact 953775424 Wed Mar 22 20:37:04 2000
+lastcontact 956889423 Thu Apr 27 22:37:03 2000
 
-haven
+pixel
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <barbaria> to map
-gdom or system <barbaria> to map
-humannode Haven BBS
-lastcontact 952879023 Sun Mar 12 11:37:03 2000
+phonenum netproc[4026]: Adding non-neighbor system <tesseract> to map
+gdom or system <tesseract> to map
+humannode PixelBBS
+lastcontact 959146623 Wed May 24 01:37:03 2000
 
-mnmensa
-use uncnsrd
-phonenum US (612) 757-7307
-gdom MN
-humannode MN-Mensa
-lastcontact 952138905 Fri Mar  3 22:01:45 2000
+tesseract
+bin Mail
+phonenum US 800 555 1212
+humannode Tesseract Project
+lastcontact 959366250 Fri May 26 14:37:30 2000
 
-cbbs
+test
+bin Mail
+
+uncnsrd
+bin Mail
+phonenum US 914 244 3252
+humannode Uncensored
+lastcontact 959362623 Fri May 26 13:37:03 2000
+
+internet
+uum %s
+humannode Internet Gateway
+lastcontact 959366250 Fri May 26 14:37:30 2000
+
+bccs
 use uncnsrd
-phonenum US (513) 939 1645
-gdom Cinci
-humannode The CBBS
-lastcontact 952138903 Fri Mar  3 22:01:43 2000
+phonenum netproc[7145]: Adding non-neighbor system <internet> to map
+gdom or system <internet> to map
+humannode BCCS
+lastcontact 959233023 Thu May 25 01:37:03 2000
 
-amigazon
+ctestsys
 use uncnsrd
-phonenum US (609) 953 8159
-gdom NJ
-humannode The Amiga Zone
-lastcontact 953764623 Wed Mar 22 17:37:03 2000
+phonenum US 612 470 9635
+gdom MN
+humannode C-86 Test System
+lastcontact 959301424 Thu May 25 20:37:04 2000
 
 gateway
 use uncnsrd
 phonenum US (609) 931-3014
 gdom NJ
 humannode Gateway
-lastcontact 952138913 Fri Mar  3 22:01:53 2000
+lastcontact 959027831 Mon May 22 16:37:11 2000
 
-charis
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <gateway> to map
-gdom or system <gateway> to map
-humannode MascotSpeak
-lastcontact 952138904 Fri Mar  3 22:01:44 2000
-
-feathers
-use uncnsrd
-phonenum CA (604) 589-8539
-gdom BC
-humannode Feathers & Furballs
-lastcontact 953325424 Fri Mar 17 15:37:04 2000
-
-sbn
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <feathers> to map
-gdom or system <feathers> to map
-humannode Super BBS Network
-lastcontact 952138908 Fri Mar  3 22:01:48 2000
-
-dogpound2
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
-gdom or system <sbn> to map
-humannode Dog Pound BBS II
-lastcontact 953771823 Wed Mar 22 19:37:03 2000
+bin Mail
+bin Mail
+phonenum netproc[25261]: Adding neighbor system <tfc> to map
+gdom system <tfc> to map
+humannode ¸\94\ 4\bHòÿ¿Lòÿ¿
+lastcontact 959025506 Mon May 22 15:58:26 2000
 
 jacs
 use uncnsrd
 phonenum US6093461224
 gdom NJ
 humannode JACS
-lastcontact 953678224 Tue Mar 21 17:37:04 2000
-
-rundale
-use uncnsrd
-phonenum US 609 854 9135
-gdom NJ
-humannode Rundale
-lastcontact 952138909 Fri Mar  3 22:01:49 2000
-
-catchat
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <rundale> to map
-gdom or system <rundale> to map
-humannode 'Cat Chat
-lastcontact 952138915 Fri Mar  3 22:01:55 2000
-
-future
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <catchat> to map
-gdom or system <catchat> to map
-humannode The Future BBS
-lastcontact 952979823 Mon Mar 13 15:37:03 2000
-
-bin Mail
-bin Mail
-phonenum netproc[4444]: Adding neighbor system <future> to map
-gdom ystem <future> to map
-humannode ¸\94\ 4\b\88óÿ¿\8cóÿ¿
-lastcontact 953915821 Fri Mar 24 11:37:01 2000
+lastcontact 959027831 Mon May 22 16:37:11 2000
 
 bin Mail
 bin Mail
-phonenum netproc[4627]: Adding neighbor system <bin Mail> to map
-gdom ystem <bin Mail> to map
-humannode ¸\94\ 4\b\88óÿ¿\8cóÿ¿
-lastcontact 953923020 Fri Mar 24 13:37:00 2000
-
-bin Mail
-bin Mail
-phonenum netproc[4963]: Adding neighbor system <bin Mail> to map
-gdom ystem <bin Mail> to map
-humannode ¸\94\ 4\b\88óÿ¿\8cóÿ¿
-lastcontact 953937420 Fri Mar 24 17:37:00 2000
-
-bin Mail
-bin Mail
-phonenum netproc[12030]: Adding neighbor system <bin Mail> to map
-gdom system <bin Mail> to map
+phonenum netproc[32515]: Adding neighbor system <jacs> to map
+gdom system <jacs> to map
 humannode ¸\94\ 4\b\88óÿ¿\8cóÿ¿
-lastcontact 954167821 Mon Mar 27 09:37:01 2000
+lastcontact 959272620 Thu May 25 12:37:00 2000
 
index 8d47314ae1a2653bb9092f9cca38d01d00f9dfe6..1f967e278e5e222344201eee9add81efc9fefa63 100644 (file)
@@ -161,7 +161,7 @@ int set_attr(int sval, char *prompt, unsigned int sbit)
  */
 void enter_config(int mode)
 {
-       int width,height,flags;
+       int width, height, flags, filter;
        char buf[128];
 
        sprintf(buf,"GETU");
@@ -175,6 +175,7 @@ void enter_config(int mode)
        width = extract_int(&buf[4],0);
        height = extract_int(&buf[4],1);
        flags = extract_int(&buf[4],2);
+       filter = extract_int(&buf[4],3);
 
        if ((mode==0)||(mode==1)) {
 
@@ -202,6 +203,9 @@ void enter_config(int mode)
          flags = set_attr(flags,
                "Enable color support",US_COLOR);
          }
+       
+        filter = intprompt("Moderation filter level", filter, -63, 63);
+
         }
 
        if (mode==2) {
@@ -226,7 +230,7 @@ void enter_config(int mode)
                }
         }
 
-       sprintf(buf,"SETU %d|%d|%d",width,height,flags);
+       sprintf(buf,"SETU %d|%d|%d|%d",width,height,flags,filter);
        serv_puts(buf);
        serv_gets(buf);
        if (buf[0]!='2') printf("%s\n",&buf[4]);
index 5af1700f54455a694b443afd571d944606ae5906..87a398aa7eccfdcb2ee6aa82e6abf42a07862995 100644 (file)
@@ -623,7 +623,7 @@ void read_bio(void)
 void do_system_configuration(void)
 {
        char buf[256];
-       char sc[25][256];
+       char sc[26][256];
        int expire_mode = 0;
        int expire_value = 0;
        int a;
@@ -637,7 +637,7 @@ void do_system_configuration(void)
        if (buf[0] == '1') {
                a = 0;
                while (serv_gets(buf), strcmp(buf, "000")) {
-                       if (a < 25)
+                       if (a < 26)
                                strcpy(&sc[a][0], buf);
                        ++a;
                }
@@ -662,7 +662,7 @@ void do_system_configuration(void)
        strprompt("Geographic location of this system", &sc[12][0], 31);
        strprompt("Name of system administrator", &sc[13][0], 25);
        strprompt("Paginator prompt", &sc[10][0], 79);
-
+       strprompt("Default moderation filter for new users", &sc[25][0], 4);
 
        /* Security parameters */
 
@@ -700,7 +700,6 @@ void do_system_configuration(void)
 
 
        /* Expiry settings */
-
        strprompt("Default user purge time (days)", &sc[16][0], 5);
        strprompt("Default room purge time (days)", &sc[17][0], 5);
 
@@ -735,7 +734,7 @@ void do_system_configuration(void)
                serv_puts("CONF set");
                serv_gets(buf);
                if (buf[0] == '4') {
-                       for (a = 0; a < 25; ++a)
+                       for (a = 0; a < 26; ++a)
                                serv_puts(&sc[a][0]);
                        serv_puts("000");
                }
index d38f1085f1e7e1127a533a92cb18288695a14d2f..8b78baedbdcba0caae21b370531bfca781e08bc3 100644 (file)
@@ -556,7 +556,7 @@ void do_fsck_msg(long msgnum) {
 void do_fsck_room(struct quickroom *qrbuf, void *data)
 {
        getroom(&CC->quickroom, qrbuf->QRname);
-       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, do_fsck_msg);
+       CtdlForEachMessage(MSGS_ALL, 0L, (-127), NULL, NULL, do_fsck_msg);
 }
 
 /*
index 0af084e111e5f597f10964e651e1c25737e4fb30..bb618ea3b7f5bb477d167ed35710a5d7629ba26c 100644 (file)
@@ -1799,7 +1799,7 @@ void CtdlICQ_Read_Config(void) {
        /* We want the last (and probably only) config in this room */
        lprintf(9, "We're in <%s> looking for config\n", 
                CC->quickroom.QRname);
-       CtdlForEachMessage(MSGS_LAST, 1, ICQMIME, NULL,
+       CtdlForEachMessage(MSGS_LAST, 1, (-127), ICQMIME, NULL,
                CtdlICQ_Read_Config_Backend);
        getroom(&CC->quickroom, hold_rm);
        return;
@@ -1928,7 +1928,7 @@ void CtdlICQ_Read_CL(void) {
        }
 
        /* We want the last (and probably only) list in this room */
-       CtdlForEachMessage(MSGS_LAST, 1, ICQCLMIME, NULL,
+       CtdlForEachMessage(MSGS_LAST, 1, (-127), ICQCLMIME, NULL,
                CtdlICQ_Read_CL_Backend);
        getroom(&CC->quickroom, hold_rm);
 }
index 47be34f1015be81536e5ca260b2ed47737ff2575..0f737910c8cff56d45fc3ceca62f42c83788f5f5 100644 (file)
@@ -105,7 +105,7 @@ void inetcfg_init_backend(long msgnum) {
 
 void inetcfg_init(void) {
        if (getroom(&CC->quickroom, SYSCONFIGROOM) != 0) return;
-       CtdlForEachMessage(MSGS_LAST, 1, INTERNETCFG, NULL,
+       CtdlForEachMessage(MSGS_LAST, 1, (-127), INTERNETCFG, NULL,
                inetcfg_init_backend);
 }
 
index 0a089c213b9968b81daa5364cb5448319c999f9f..1544ed48fee3a16b1180cdec59d26429b0e047ab 100644 (file)
@@ -153,7 +153,7 @@ int pop3_grab_mailbox(void) {
        if (getroom(&CC->quickroom, MAILROOM) != 0) return(-1);
 
        /* Load up the messages */
-       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, pop3_add_message);
+       CtdlForEachMessage(MSGS_ALL, 0L, (-63), NULL, NULL, pop3_add_message);
 
        /* Figure out which are old and which are new */
         CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
index 3e8edcb342f878617eae034f49ca105461d72dee..717fb17c550a13fc158fdde045a1be7cdca2520c 100644 (file)
@@ -1433,7 +1433,8 @@ void smtp_do_queue(void) {
                lprintf(3, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
                return;
        }
-       CtdlForEachMessage(MSGS_ALL, 0L, SPOOLMIME, NULL, smtp_do_procmsg);
+       CtdlForEachMessage(MSGS_ALL, 0L, (-127),
+               SPOOLMIME, NULL, smtp_do_procmsg);
 
        lprintf(7, "SMTP: queue run completed\n");
        doing_queue = 0;
index 7562c5f66c5a0ad67eff37d33f07b3e1a995ee68..942da05518460dd838b3db8fa2c434efb94e399e 100644 (file)
@@ -119,7 +119,7 @@ void check_server_upgrades(void) {
                (CitControl.version / 100),
                (CitControl.version % 100) );
 
-       if (CitControl.version < config.c_setup_level) {
+       if (CitControl.version < REV_LEVEL) {
                lprintf(5, "Server hosted updates need to be processed at "
                                "this time.  Please wait...\n");
        }
@@ -127,11 +127,9 @@ void check_server_upgrades(void) {
                return;
        }
 
-
        if (CitControl.version < 555) do_pre555_usersupp_upgrade();
 
-
-       CitControl.version = config.c_setup_level;
+       CitControl.version = REV_LEVEL;
        put_control();
 }
 
index 46bb37791ec52fccd9077a6612e3312e2359d8f2..90966312ebc1984f9ac5b3141ef1a84b92149a3e 100644 (file)
@@ -194,7 +194,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, "text/x-vcard",
+        CtdlForEachMessage(MSGS_LAST, 1, (-127), "text/x-vcard",
                NULL, vcard_gu_backend);
         getroom(&CC->quickroom, hold_rm);      /* return to saved room */
 
index a5a321a078905b49209854731b1b550baafc78ea..9f9e10fb0bdd64799b779b0098ad9fdd6dd8a3b7 100644 (file)
@@ -366,6 +366,7 @@ struct SuppMsgInfo {
        long smi_msgnum;        /* Message number in *local* message base */
        int smi_refcount;       /* Number of rooms which point to this msg */
        char smi_content_type[64];
+       char smi_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
new file mode 100644 (file)
index 0000000..d573495
--- /dev/null
@@ -0,0 +1,42 @@
+ TECHNICAL DISCUSSION OF THE CITADEL/UX MODERATION SYSTEM
+ Starting with version 5.73, 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 d2a8c535208bef3ba5aaba195c7f12b3c8068418..a0354843e8fb6dc4f1cc88128effbb0a9cbbeb71 100644 (file)
@@ -258,7 +258,7 @@ inaccessible private rooms.
  
  This command retrieves the screen dimensions and user options for the
 currently logged in account.  ERROR will be returned if no user is logged
-in, of course.  Otherwise, OK will be returned, followed by three parameters.
+in, of course.  Otherwise, OK will be returned, followed by four parameters.
 The first parameter is the user's screen width, the second parameter is the
 user's screen height, and the third parameter is a bag of bits with the
 following meanings:
@@ -272,14 +272,17 @@ following meanings:
  
  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 three parameters: the screen width, the screen height, and
-the option bits (see above).
+should be passed four parameters: the screen width, the screen height,
+the option bits (see above), and the desired moderation level to filter at.
  
  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
@@ -1684,6 +1687,7 @@ fails for any reason, ERROR is returned.
  19. Name of room to log express messages to (or a zero-length name for none)
  20. Access level required to create rooms
  21. Maximum message length which may be entered into the system
+ 22. Default moderation filter level for new users (-63 to +63)
  
   
  
index 9954505e58d43a5a17a9742c0bf93b6ca10fba87..d8c09642d6b9915690802f7d32af7feb8d6eb4d2 100644 (file)
@@ -59,6 +59,11 @@ int getuser(struct usersupp *usbuf, char name[]) {
                ( (cdbus->len > sizeof(struct usersupp)) ?
                sizeof(struct usersupp) : cdbus->len) );
        cdb_free(cdbus);
+
+       if (usbuf->version < 573) {
+               CC->usersupp.moderation_filter = config.c_default_filter;
+       }
+
        return(0);
        }
 
@@ -92,7 +97,7 @@ void putuser(struct usersupp *usbuf)
                }
        lowercase_name[sizeof(lowercase_name)-1] = 0;
 
-       usbuf->version = config.c_setup_level;
+       usbuf->version = REV_LEVEL;
        cdb_store(CDB_USERSUPP,
                lowercase_name, strlen(lowercase_name),
                usbuf, sizeof(struct usersupp));
@@ -620,6 +625,7 @@ int create_user(char *newusername)
        CC->usersupp.USscreenwidth = 80;
        CC->usersupp.USscreenheight = 24;
        time(&CC->usersupp.lastcall);
+       CC->usersupp.moderation_filter = config.c_default_filter;
 
        /* fetch a new user number */
        CC->usersupp.usernum = get_new_user_number();
@@ -738,11 +744,12 @@ void cmd_getu(void) {
                return;
                }
        getuser(&CC->usersupp,CC->curr_user);
-       cprintf("%d %d|%d|%d\n",
+       cprintf("%d %d|%d|%d|%d\n",
                OK,
                CC->usersupp.USscreenwidth,
                CC->usersupp.USscreenheight,
-               (CC->usersupp.flags & US_USER_SET)
+               (CC->usersupp.flags & US_USER_SET),
+               CC->usersupp.moderation_filter
                );
        }
 
@@ -751,8 +758,9 @@ void cmd_getu(void) {
  */
 void cmd_setu(char *new_parms)
 {
+       int new_mod;
 
-       if (num_parms(new_parms)!=3) {
+       if (num_parms(new_parms) < 3) {
                cprintf("%d Usage error.\n",ERROR);
                return;
                }       
@@ -766,6 +774,25 @@ void cmd_setu(char *new_parms)
        CC->usersupp.flags = CC->usersupp.flags & (~US_USER_SET);
        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",OK);
        }