* if a message subject is required, ask the user for it before opening the editor.
authorWilfried Göesgens <willi@citadel.org>
Mon, 25 Jun 2007 21:53:00 +0000 (21:53 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 25 Jun 2007 21:53:00 +0000 (21:53 +0000)
citadel/client_chat.c
citadel/messages.c
citadel/messages.h

index c1cc8f44fdaf54ba71957bbe1cac228fdda99c4e..08eff91d854a83f283ca1899320badf04f147dce 100644 (file)
@@ -256,7 +256,7 @@ void page_user(CtdlIPC *ipc)
                        scr_printf("%s\n", &buf[4]);
                        return;
                }
-               if (client_make_message(ipc, temp, touser, 0, 0, 0, NULL) != 0) {
+               if (client_make_message(ipc, temp, touser, 0, 0, 0, NULL, 0) != 0) {
                        scr_printf("No message sent.\n");
                        return;
                }
index 3dd851db2cb43ebf15056c7036638677d754f1df..7faebcec03142cf7f11050772e5257d358f6ce18 100644 (file)
@@ -806,12 +806,13 @@ void replace_string(char *filename, long int startpos)
  * Function to begin composing a new message
  */
 int client_make_message(CtdlIPC *ipc,
-               char *filename,         /* temporary file name */
-               char *recipient,        /* NULL if it's not mail */
-               int is_anonymous,
-               int format_type,
-               int mode,
-               char *subject)          /* buffer to store subject line */
+                                               char *filename,         /* temporary file name */
+                                               char *recipient,        /* NULL if it's not mail */
+                                               int is_anonymous,
+                                               int format_type,
+                                               int mode,
+                                               char *subject,          /* buffer to store subject line */
+                                               int subject_required)
 {
        FILE *fp;
        int a, b, e_ex_code;
@@ -856,6 +857,11 @@ int client_make_message(CtdlIPC *ipc,
        if (subject != NULL) if (strlen(subject) > 0) {
                scr_printf("Subject: %s\n", subject);
        }
+       
+       if (subject_required) {
+               scr_printf("Internet mail recommends a subject.\n");
+               newprompt("Subject: ", subject, 70);
+       }
 
        beg = 0L;
 
@@ -1229,7 +1235,7 @@ int entmsg(CtdlIPC *ipc,
 
        /* Now compose the message... */
        if (client_make_message(ipc, temp, message.recipient,
-          message.anonymous, 0, c, message.subject) != 0) {
+          message.anonymous, 0, c, message.subject, subject_required) != 0) {
            if (msgarr) free(msgarr);   
                return (2);
        }
index ce5c4a64cc29f6b7642100b000eee7567b7185f1..5b3e230f03e2977b3945512be551e28ea20af25c 100644 (file)
@@ -12,12 +12,13 @@ pid_t ka_wait(int *kstatus);
 void list_urls(CtdlIPC *ipc);
 void check_message_base(CtdlIPC *ipc);
 int client_make_message(CtdlIPC *ipc,
-               char *filename,         /* temporary file name */
-               char *recipient,        /* NULL if it's not mail */
-               int anon_type,          /* see MES_ types in header file */
-               int format_type,
-               int mode,
-               char *subject);
+                                               char *filename,         /* temporary file name */
+                                               char *recipient,        /* NULL if it's not mail */
+                                               int anon_type,          /* see MES_ types in header file */
+                                               int format_type,
+                                               int mode,
+                                               char *subject,
+                                               int subject_required);
 void citedit(CtdlIPC *ipc, FILE *);
 char *load_message_from_file(FILE *src);
 int file_checksum(char *filename);