From 1e2954195f205d1a2a1be50c1f145228ca4fe954 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 24 Jun 2007 04:23:52 +0000 Subject: [PATCH] Creating a mailbox room no longer automatically sets 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 | 2 +- citadel/msgbase.c | 15 ++++++++++++--- citadel/room_ops.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/citadel/ipcdef.h b/citadel/ipcdef.h index c052f781a..5ca5e552f 100644 --- a/citadel/ipcdef.h +++ b/citadel/ipcdef.h @@ -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 */ diff --git a/citadel/msgbase.c b/citadel/msgbase.c index dc0823e58..eadb635c3 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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); diff --git a/citadel/room_ops.c b/citadel/room_ops.c index cc83b369b..d2ce223e1 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -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 -- 2.39.2