* Added a per-user client option to always compose messages using the
authorArt Cancro <ajc@citadel.org>
Wed, 11 Jan 2006 03:27:09 +0000 (03:27 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 11 Jan 2006 03:27:09 +0000 (03:27 +0000)
  external editor.
* Removed the "always reply with external editor" option from citadel.rc
  because the per-user editor choice makes it superfluous.

citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/citadel_decls.h
citadel/commands.c
citadel/docs/citadel.html
citadel/ipcdef.h
citadel/journaling.c
citadel/messages.c
citadel/routines.c
citadel/serv_smtp.c

index 894bd03328a091c3f7bd888b73e7619b972bffc4..8d18dfb2bea4755ef40e75fec75d1bfc06d859f9 100644 (file)
@@ -1,5 +1,11 @@
 $Id$
 
+Tue Jan 10 22:26:00 EST 2006 ajc
+* Added a per-user client option to always compose messages using the
+  external editor.
+* Removed the "always reply with external editor" option from citadel.rc
+  because the per-user editor choice makes it superfluous.
+
 Tue Jan 10 17:20:30 EST 2006 ajc
 * Added "Content-Identifer: ExJournalReport" to journal envelope headers
   (Requested by SECCAS for compatibility with their archival service.)
index 84c4c1e453bd7460802f5230a4056ae252a61d2a..ac21ebc9011695c8482d6569f899762181fd6207 100644 (file)
@@ -1416,7 +1416,7 @@ NEWUSR:   if (strlen(rc_password) == 0) {
                                formout(ipc, "help");
                                break;
                        case 4:
-                               entmsg(ipc, 0, 0);
+                               entmsg(ipc, 0, ((userflags & US_EXTEDIT) ? 2 : 0));
                                break;
                        case 36:
                                entmsg(ipc, 0, 1);
index 6f7ca30c75c9c42691dce7d63caa91b45e6cb056..39278f1cbcf104680344d6ccca6c3a7e4c53c3fa 100644 (file)
@@ -188,12 +188,6 @@ remember_passwords=0
 alternate_semantics=no
 
 
-# When the user hits the <R>eply key after reading a message, reply_with_editor
-# selects whether it uses the built-in editor (select 'no') or an external
-# editor (select 'yes').
-#
-reply_with_external_editor=no
-
 
 # COMMAND SET CONFIGURATION
 #
index 9a50aabc92f8a6f67fea539d538ebbe97f3f13fc..8e95f1ad6c67404db55622d4fbfa3841cf0caa1c 100644 (file)
@@ -24,7 +24,6 @@ extern char rc_screen;
 extern char arg_screen;
 #endif
 extern char rc_alt_semantics;
-extern char rc_reply_extedit;
 extern char instant_msgs;
 void ctdl_logoff(char *file, int line, CtdlIPC *ipc, int code);
 #define logoff(ipc, code)      ctdl_logoff(__FILE__, __LINE__, (ipc), (code))
index 4fd1d39508b53282f272cfbf766a9c008e4e1cc0..17cb60853a9343c015602885ae92b42d18b5bb65 100644 (file)
@@ -749,7 +749,6 @@ void load_command_set(void)
        rc_force_mail_prompts = 0;
        rc_ansi_color = 0;
        rc_color_use_bg = 0;
-       rc_reply_extedit = 0;
        strcpy(rc_url_cmd, "");
        strcpy(rc_gotmail_cmd, "");
 #ifdef HAVE_OPENSSL
@@ -905,14 +904,7 @@ void load_command_set(void)
                                rc_alt_semantics = 0;
                        }
                }
-               if (!strncasecmp(buf, "reply_with_external_editor=", 27)) {
-                       if (!strncasecmp(&buf[27], "yes", 3)) {
-                               rc_reply_extedit = 1;
-                       }
-                       else {
-                               rc_reply_extedit = 0;
-                       }
-               }
+
                if (!strncasecmp(buf, "cmd=", 4)) {
                        strcpy(buf, &buf[4]);
 
index 430c8243db325f06c6815c3c0f82fb499042b5eb..ce8d991d9624c8d4bda4b138ba7d420a698a0e39 100644 (file)
@@ -780,7 +780,9 @@ your favorite text editor to write messages. To do this you simply put
 a line in your citadel.rc file like this:</p>
 <pre>editor=/usr/bin/vi<br></pre>
 <p>The above example would make Citadel call the vi editor when using
-the <tt><b>.E</b>nter <b>E</b>ditor</tt> command. You can also make
+the <tt><b>.E</b>nter <b>E</b>ditor</tt> command, or when a user
+selects the &quot;Always compose messages with the full-screen
+editor&quot; option.  You can also make
 it the default editor for the <tt><b>E</b>nter</tt> command by editing
 the <tt>citadel.rc</tt> file. <b>But be warned:</b> external editors
 on public systems can
index 998255ca85de9ef12f2adabbcc4b0d7c35009f4e..85372f0ffd67c18735fbb48fdbef68cdd1d1237c 100644 (file)
@@ -57,6 +57,7 @@ extern "C" {
 #define QR2_SELFLIST   2               /* Self-service mailing list mgmt   */
 
 #define US_NEEDVALID   1               /* User needs to be validated       */
+#define US_EXTEDIT     2               /* Always use external editor       */
 #define US_PERM                4               /* Permanent user                   */
 #define US_LASTOLD     16              /* Print last old message with new  */
 #define US_EXPERT      32              /* Experienced user                 */
@@ -71,7 +72,7 @@ extern "C" {
 #define US_COLOR       16384           /* User wants ANSI color support    */
 #define US_USER_SET    (US_LASTOLD | US_EXPERT | US_UNLISTED | \
                        US_NOPROMPT | US_DISAPPEAR | US_PAGINATOR | \
-                       US_FLOORS | US_COLOR | US_PROMPTCTL )
+                       US_FLOORS | US_COLOR | US_PROMPTCTL | US_EXTEDIT)
 
 #define UA_KNOWN                2
 #define UA_GOTOALLOWED          4
index f45d601c6fcc054b2b9d4388e744945a843011fe..e13b2d4e5713c1470ea27f36748c1bfd43e35b81 100644 (file)
@@ -227,7 +227,7 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
  * Run the queue.
  */
 void JournalRunQueue(void) {
-       struct jnlq *jptr;
+       struct jnlq *jptr = NULL;
 
        while (jnlq != NULL) {
                begin_critical_section(S_JOURNAL_QUEUE);
index b71ca5d79ec2b4c1c5107d8bee1a2ddde51d0ffc..442089552e2e1f32bbbd90f1a4dd76c9498d6a71 100644 (file)
@@ -69,7 +69,6 @@ unsigned long *msg_arr = NULL;
 int msg_arr_size = 0;
 int num_msgs;
 char rc_alt_semantics;
-char rc_reply_extedit;
 extern char room_name[];
 extern unsigned room_flags;
 extern long highest_msg_read;
@@ -1826,7 +1825,7 @@ RMSGREAD: scr_flush();
                        goto RMSGREAD;
                case 'r':
                        savedpos = num_msgs;
-                       entmsg(ipc, 1, (rc_reply_extedit ? 2 : 0));
+                       entmsg(ipc, 1, ((userflags & US_EXTEDIT) ? 2 : 0));
                        num_msgs = savedpos;
                        goto RMSGREAD;
                case 'u':
index 83c383739b63c6245759aefda01b254ebd985394..65798e27f7065491ecbff55d45bb1c03f7918dc6 100644 (file)
@@ -180,7 +180,7 @@ int set_attr(CtdlIPC *ipc, unsigned int sval, char *prompt, unsigned int sbit, i
 
        temp = sval;
        color(DIM_WHITE);
-       scr_printf("%45s ", prompt);
+       scr_printf("%50s ", prompt);
        color(DIM_MAGENTA);
        scr_printf("[");
        color(BRIGHT_MAGENTA);
@@ -282,6 +282,13 @@ void enter_config(CtdlIPC *ipc, int mode)
                user->flags = set_attr(ipc, user->flags,
                                       "Be unlisted in userlog",
                                       US_UNLISTED, 0);
+
+               if (strlen(editor_paths[0]) > 0) {
+                       user->flags = set_attr(ipc, user->flags,
+                               "Always enter messages with the full-screen editor",
+                               US_EXTEDIT, 0);
+               }
+
        }
 
        if (mode == 2) {
index 6d1d3ec0ed4f849d5478f60f87cfe6f5f1f89e8a..8cc2b9bf5c64ef979908dbac527936d58257c050 100644 (file)
@@ -668,7 +668,7 @@ void smtp_rcpt(char *argbuf) {
 void smtp_data(void) {
        char *body;
        struct CtdlMessage *msg;
-       long msgnum;
+       long msgnum = (-1L);
        char nowstamp[SIZ];
        struct recptypes *valid;
        int scan_errors;