Creating a mailbox room no longer automatically sets
authorArt Cancro <ajc@citadel.org>
Sun, 24 Jun 2007 04:23:52 +0000 (04:23 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 24 Jun 2007 04:23:52 +0000 (04:23 +0000)
the 'subject required' bit.  Instead, the server recommends a subject at ENT0 time
if the 'subject required' bit is set *or* there is at least one Internet email
recipient.  This allows local citadel users to send mail to each other without
subjects, which is customary.
* Also made the ENT0 result for this function numeric instead of a string.

citadel/ipcdef.h
citadel/msgbase.c
citadel/room_ops.c

index c052f781a32635d1535e0078d482fde5c1531ac6..5ca5e552f733d53424ef72244d7858ff917459a0 100644 (file)
@@ -56,7 +56,7 @@ extern "C" {
 #define QR2_SYSTEM     1               /* System room; hide by default     */
 #define QR2_SELFLIST   2               /* Self-service mailing list mgmt   */
 #define QR2_COLLABDEL  4               /* Anyone who can post can delete   */
-#define QR2_SUBJECTREQ   8   /* Subject strongly recommended */
+#define QR2_SUBJECTREQ 8               /* Subject strongly recommended */
 
 #define US_NEEDVALID   1               /* User needs to be validated       */
 #define US_EXTEDIT     2               /* Always use external editor       */
index dc0823e58830d825b3988662dc53039b822ebcbc..eadb635c384b78c786b5ea0a2b1a045c801b258b 100644 (file)
@@ -3334,6 +3334,7 @@ void cmd_ent0(char *entargs)
        struct recptypes *valid_cc = NULL;
        struct recptypes *valid_bcc = NULL;
        char subject[SIZ];
+       int subject_required = 0;
        int do_confirm = 0;
        long msgnum;
        int i, j;
@@ -3516,14 +3517,22 @@ void cmd_ent0(char *entargs)
                recp[0] = 0;
        }
 
+       /* Recommend to the client that the use of a message subject is
+        * strongly recommended in this room, if either the SUBJECTREQ flag
+        * is set, or if there is one or more Internet email recipients.
+        */
+       if (CC->room.QRflags2 & QR2_SUBJECTREQ) subject_required = 1;
+       if (valid_to) if (valid_to->num_internet > 0) subject_required = 1;
+       if (valid_cc) if (valid_cc->num_internet > 0) subject_required = 1;
+       if (valid_bcc) if (valid_bcc->num_internet > 0) subject_required = 1;
+
        /* If we're only checking the validity of the request, return
         * success without creating the message.
         */
        if (post == 0) {
-               cprintf("%d %s|%s\n", CIT_OK,
+               cprintf("%d %s|%d\n", CIT_OK,
                        ((valid_to != NULL) ? valid_to->display_recp : ""), 
-                        ((CC->room.QRflags2 & QR2_SUBJECTREQ)? 
-                          "SUBJECTREQ" : "SUBJECTOPT") );
+                       subject_required);
                free_recipients(valid_to);
                free_recipients(valid_cc);
                free_recipients(valid_bcc);
index cc83b369bdcef73f9c6431f08128d637514de27d..d2ce223e17ca3bf37e9d211704942d10d4cb76db 100644 (file)
@@ -1758,7 +1758,7 @@ unsigned create_room(char *new_room_name,
                qrbuf.QRflags = (qrbuf.QRflags | QR_PASSWORDED);
        if ( (new_room_type == 4) || (new_room_type == 5) ) {
                qrbuf.QRflags = (qrbuf.QRflags | QR_MAILBOX);
-               qrbuf.QRflags2 |= QR2_SUBJECTREQ; 
+               /* qrbuf.QRflags2 |= QR2_SUBJECTREQ; */
        }
 
        /* If the user is requesting a personal room, set up the room