From: Art Cancro
Date: Wed, 11 Jan 2006 03:27:09 +0000 (+0000)
Subject: * Added a per-user client option to always compose messages using the
X-Git-Tag: v7.86~4333
X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=44bdabdda4dc6e9823e0464c37157c960abac9f7
* 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.
---
diff --git a/citadel/ChangeLog b/citadel/ChangeLog
index 894bd0332..8d18dfb2b 100644
--- a/citadel/ChangeLog
+++ b/citadel/ChangeLog
@@ -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.)
diff --git a/citadel/citadel.c b/citadel/citadel.c
index 84c4c1e45..ac21ebc90 100644
--- a/citadel/citadel.c
+++ b/citadel/citadel.c
@@ -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);
diff --git a/citadel/citadel.rc b/citadel/citadel.rc
index 6f7ca30c7..39278f1cb 100644
--- a/citadel/citadel.rc
+++ b/citadel/citadel.rc
@@ -188,12 +188,6 @@ remember_passwords=0
alternate_semantics=no
-# When the user hits the 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
#
diff --git a/citadel/citadel_decls.h b/citadel/citadel_decls.h
index 9a50aabc9..8e95f1ad6 100644
--- a/citadel/citadel_decls.h
+++ b/citadel/citadel_decls.h
@@ -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))
diff --git a/citadel/commands.c b/citadel/commands.c
index 4fd1d3950..17cb60853 100644
--- a/citadel/commands.c
+++ b/citadel/commands.c
@@ -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]);
diff --git a/citadel/docs/citadel.html b/citadel/docs/citadel.html
index 430c8243d..ce8d991d9 100644
--- a/citadel/docs/citadel.html
+++ b/citadel/docs/citadel.html
@@ -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:
editor=/usr/bin/vi
The above example would make Citadel call the vi editor when using
-the .Enter Editor command. You can also make
+the .Enter Editor command, or when a user
+selects the "Always compose messages with the full-screen
+editor" option. You can also make
it the default editor for the Enter command by editing
the citadel.rc file. But be warned: external editors
on public systems can
diff --git a/citadel/ipcdef.h b/citadel/ipcdef.h
index 998255ca8..85372f0ff 100644
--- a/citadel/ipcdef.h
+++ b/citadel/ipcdef.h
@@ -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
diff --git a/citadel/journaling.c b/citadel/journaling.c
index f45d601c6..e13b2d4e5 100644
--- a/citadel/journaling.c
+++ b/citadel/journaling.c
@@ -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);
diff --git a/citadel/messages.c b/citadel/messages.c
index b71ca5d79..442089552 100644
--- a/citadel/messages.c
+++ b/citadel/messages.c
@@ -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':
diff --git a/citadel/routines.c b/citadel/routines.c
index 83c383739..65798e27f 100644
--- a/citadel/routines.c
+++ b/citadel/routines.c
@@ -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) {
diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c
index 6d1d3ec0e..8cc2b9bf5 100644
--- a/citadel/serv_smtp.c
+++ b/citadel/serv_smtp.c
@@ -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;