* added subject required line to the room config tab
authorWilfried Göesgens <willi@citadel.org>
Sat, 23 Jun 2007 21:56:34 +0000 (21:56 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 23 Jun 2007 21:56:34 +0000 (21:56 +0000)
* evaluate the flag in the message create box.

webcit/messages.c
webcit/roomops.c
webcit/webcit.h

index d5438d38897964b0008c092c082f845bed32fb4a..61ce15f9dfe250238828233c058f9a1fd242278c 100644 (file)
@@ -2838,6 +2838,7 @@ void display_enter(void)
        char *display_name;
        struct wc_attachment *att;
        int recipient_required = 0;
+       int subject_required = 0;
        int recipient_bad = 0;
        int i;
        int is_anonymous = 0;
@@ -2858,6 +2859,7 @@ void display_enter(void)
        /** First test to see whether this is a room that requires recipients to be entered */
        serv_puts("ENT0 0");
        serv_getln(buf, sizeof buf);
+
        if (!strncmp(buf, "570", 3)) {          /** 570 means that we need a recipient here */
                recipient_required = 1;
        }
@@ -2867,6 +2869,12 @@ void display_enter(void)
                return;
        }
 
+       if ((buf[3] != '\0') && 
+               (buf[4] != '\0') && 
+               !strncmp(&(buf[5]), "SUBJECTREQ", 10)) {
+               subject_required = 1;
+       }
+
        /**
         * Are we perhaps in an address book view?  If so, then an "enter
         * message" command really means "add new entry."
@@ -3053,7 +3061,7 @@ void display_enter(void)
        }
 
        wprintf("<div style=\"clear: both;\"><label for=\"subject_id\" > ");
-       if (recipient_required) {
+       if (recipient_required || subject_required) {
                wprintf(_("Subject:"));
        }
        else {
index 8e28bc8eaebaec294e723f8363d812fdf786f1c8..b6b69977d2fdda50674f85945a74120cb78f3307 100644 (file)
@@ -1304,6 +1304,12 @@ void display_editroom(void)
                wprintf("> ");
                wprintf(_("Permanent (does not auto-purge)"));
 
+               wprintf("\n<LI><INPUT TYPE=\"checkbox\" NAME=\"subjectreq\" VALUE=\"yes\" ");
+               if (er_flags2 & QR2_SUBJECTREQ)
+                       wprintf("CHECKED ");
+               wprintf("> ");
+               wprintf(_("Subject Required (Force users to specify a message subject)"));
+
                /** start of anon options */
        
                wprintf("\n<LI>");
@@ -1830,6 +1836,12 @@ void editroom(void)
                er_flags &= ~QR_PERMANENT;
        }
 
+       if (!strcmp(bstr("subjectreq"), "yes")) {
+               er_flags2 |= QR2_SUBJECTREQ;
+       } else {
+               er_flags2 &= ~QR2_SUBJECTREQ;
+       }
+
        if (!strcmp(bstr("network"), "yes")) {
                er_flags |= QR_NETWORK;
        } else {
index c273800b2f68022af27a40bca725a1c926f89249..25a5f9710844be491b55cb71f1ac174f1b66618c 100644 (file)
@@ -169,6 +169,7 @@ extern locale_t wc_locales[];
 #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 also delete*/
+#define QR2_SUBJECTREQ   8   /**< Subject strongly recommended */
 
 /**
  * user/room access