#
# editor=vi
-# Or, you could have multiple editors available, like this:
-# ("editor" and "editor0" are the same internally)
-# You can go up to MAX_EDITORS number of editors (5 by default)
-# editor0=pico
-# editor1=vi
-# editor2=nano
-
# If you define PRINTCMD, it will be a pipe through which messages are
# printed when the user hits the <P>rint key after a message.
#
#printcmd=lpr
# If you define EXPCMD, it will be a pipe through which any incoming
-# express messages will be printed.
-#expcmd=xmessage -title "Express Message" -center -buttons OK -file -
-
-# If LOCAL_SCREEN_DIMENSIONS is set to 1, then the screen dimensions will
-# be requested from the underlying operating system instead of asking the
-# user. On modern networks this is almost always the case: telnet, SSH,
-# xterm, and Unix/Linux consoles all properly report the screen dimensions.
-# Set this option to 0 only if you are running the Citadel client on a
-# direct-dial modem or hardwired terminals.
-#
-local_screen_dimensions=1
+# instant messages will be printed.
+#expcmd=xmessage -title "Instant message" -center -buttons OK -file -
# ANSI_COLOR should be set to on/off/auto/user to control the use of
# color on the screen. If it is set to "auto" then an autodetect will be
# for 'safe' public clients.)
#
# This one ought to work on any Linux that has the "Portland" API's installed.
-# If properly configured, xdg-open will open the URL in the user's perferred
+# If properly configured, xdg-open will open the URL in the user's preferred
# web browser.
#urlcmd=xdg-open "%s"
#
-# This one works on non-Portland Linux and most other X11-based Unices.
-# Specify the full path to Firefox if necessary.
-#urlcmd=/usr/bin/firefox -a firefox -remote "openURL(%s)" >/dev/null 2>&1
-#
# This one works really well on a Macintosh -- it opens URL's in whatever
# browser you have configured as the system default.
#urlcmd=open "%s"
# xdg-open - on Linux systems with the Portland API's installed, this ought
# to open the image in the user's preferred viewer.
#imagecmd=xdg-open "%s"
-
-# XV - This is an oldie but goodie, shareware with source code included, no
-# longer included with some Linux distributions due to licensing.
-#imagecmd=xv "%s"
-
-# The following 2 image viewers are included with KDE:
-# KuickShow has a brightness/gamma option and is simple and ubobtrusive
-#imagecmd=kuickshow "%s"
-
-# KView has no brightness/gamma but can do some minimal cropping and clipboard
-# operations
-#imagecmd=kview "%s"
-
-# Eye of Gnome, the Gnome/Nautilus image viewer component (bare bones
-# view/print):
-#imagecmd=eog "%s"
-
-# GIMP is a free-software attempt at a PhotoShop-like application.
-#imagecmd=gimp "%s"
-
+#
# Preview on Mac OS X
#imagecmd=/Applications/Preview.app/Contents/MacOS/Preview "%s"
-# MESSAGE READING SEMANTICS (experimental)
-#
-# A new set of message reading semantics is now available. If you set
-# alternate_semantics, the following changes are made:
-#
-# * Messages are marked as read when you read them, rather than when you
-# leave the room. This means read <N>ew will display a new message
-# at most once, unless last old on new is turned on.
-# * Reading <F>orward or <R>everse does not mark messages as read.
-# * When you leave a room with <G>oto, <J>ump, etc., only messages that
-# were in the room when you arrived are marked as read. The original
-# semantics mark all messages read that were in the room at the time
-# you leave the room. This occasionally causes messages to be "lost."
-# * When you leave with <T>erminate, no additional messages are marked
-# as read.
-# * The <S>kip and <A>bandon commands are reversed.
-#
-# This set of semantics should make Citadel easier to use on very busy
-# systems, where many messages may be posted while reading. Users
-# accustomed to D.O.C. or its variants will want to set this option.
-#
-alternate_semantics=no
-
-
# COMMAND SET CONFIGURATION
#
cmd=78,1,&.,&Aide,&Post
cmd=80,2,&.,&Aide,&System configuration,&General
cmd=82,2,&.,&Aide,&System configuration,&Internet
-cmd=83,2,&.,&Aide,&System configuration,check &Message base
cmd=88,2,&.,&Aide,&System configuration,&Network
cmd=92,2,&.,&Aide,&System configuration,network &Filter list
cmd=85,2,&.,&Aide,&Terminate server,&Now
int CtdlIPCDirectoryLookup(CtdlIPC *ipc, const char *address, char *cret);
int CtdlIPCSpecifyPreferredFormats(CtdlIPC *ipc, char *cret, char *formats);
int CtdlIPCInternalProgram(CtdlIPC *ipc, int secret, char *cret);
-int CtdlIPCMessageBaseCheck(CtdlIPC *ipc, char **mret, char *cret);
/* ************************************************************************** */
/* Stuff below this line is not for public consumption */
char temp[PATH_MAX]; /* Name of general-purpose temp file */
char temp2[PATH_MAX]; /* Name of general-purpose temp file */
char tempdir[PATH_MAX]; /* Name of general-purpose temp directory */
-char editor_paths[MAX_EDITORS][SIZ]; /* paths to external editors */
char printcmd[SIZ]; /* print command */
int editor_pid = (-1);
char fullname[USERNAME_SIZE];
if (mode == 0) { /* not skipping */
updatels(ipc);
- } else {
- if (rc_alt_semantics) {
- updatelsa(ipc);
- }
}
/* Free the room list */
scr_printf("Enable color support: "); color(BRIGHT_CYAN); scr_printf("%s\n", (user->flags & US_COLOR)? "Yes" : "No"); color(DIM_WHITE);
}
scr_printf("Be unlisted in userlog: "); color(BRIGHT_CYAN); scr_printf("%s\n", (user->flags & US_UNLISTED)? "Yes" : "No"); color(DIM_WHITE);
- if (!IsEmptyStr(editor_paths[0])) {
+ if (!IsEmptyStr(editor_path)) {
scr_printf("Always enter messages with the full-screen editor: "); color(BRIGHT_CYAN); scr_printf("%s\n", (user->flags & US_EXTEDIT)? "Yes" : "No"); color(DIM_WHITE);
}
free(user);
gotonext(ipc);
break;
case 47: /* <A>bandon */
- if (!rc_alt_semantics) {
- updatelsa(ipc);
- }
gotonext(ipc);
break;
case 90: /* <.A>bandon */
- if (!rc_alt_semantics)
- updatelsa(ipc);
dotgoto(ipc, argbuf, 0, 0);
break;
case 58: /* <M>ail */
break;
case 52:
if (!IsEmptyStr(argbuf)) {
- if (rc_alt_semantics) {
- updatelsa(ipc);
- }
dotgoto(ipc, argbuf, 0, 0);
}
break;
break;
case 29:
case 30:
- if (!rc_alt_semantics) {
- updatels(ipc);
- }
+ updatels(ipc);
termn8 = 1;
break;
case 48:
case 15:
scr_printf("Are you sure (y/n)? ");
if (yesno() == 1) {
- if (!rc_alt_semantics)
- updatels(ipc);
+ updatels(ipc);
a = 0;
termn8 = 1;
}
scr_printf("All users will be disconnected! "
"Really terminate the server? ");
if (yesno() == 1) {
- if (!rc_alt_semantics)
- updatels(ipc);
+ updatels(ipc);
r = CtdlIPCTerminateServerNow(ipc, aaa);
scr_printf("%s\n", aaa);
if (r / 100 == 2) {
break;
case 6:
- if (rc_alt_semantics) {
- updatelsa(ipc);
- }
gotonext(ipc);
break;
do_internet_configuration(ipc);
break;
- case 83:
- check_message_base(ipc);
- break;
-
case 84:
quiet_mode(ipc);
break;
do_rssclient_configuration(ipc);
break;
- default: /* allow some math on the command */
- /* commands 100... to 100+MAX_EDITORS-1 will
- call the appropriate editor... in other
- words, command numbers 100+ will match
- the citadel.rc keys editor0, editor1, etc.*/
- if (mcmd >= 100 && mcmd < (100+MAX_EDITORS))
- {
- /* entmsg mode >=2 select editor */
- entmsg(ipc, 0, mcmd - 100 + 2, 0);
- break;
- }
+ default:
+ break;
} /* end switch */
} while (termn8 == 0);
#include "rooms.h"
#include "client_chat.h"
#include "citadel_dirs.h"
+#include "tuiconfig.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
#endif
{
FILE *ccfile;
char buf[1024];
- char editor_key[100];
struct citcmd *cptr;
struct citcmd *lastcmd = NULL;
int a, d;
int b = 0;
- int i;
-
/* first, set up some defaults for non-required variables */
- for (i = 0; i < MAX_EDITORS; i++)
- strcpy(editor_paths[i], "");
+ strcpy(editor_path, "");
strcpy(printcmd, "");
strcpy(imagecmd, "");
strcpy(rc_username, "");
#ifdef HAVE_OPENSSL
rc_encrypt = RC_DEFAULT;
#endif
- rc_alt_semantics = 0;
/* now try to open the citadel.rc file */
#endif
}
- if (!strncasecmp(buf, "editor=", 7))
- strcpy(editor_paths[0], &buf[7]);
-
- for (i = 0; i < MAX_EDITORS; i++)
- {
- sprintf(editor_key, "editor%d=", i);
- if (!strncasecmp(buf, editor_key, strlen(editor_key)))
- strcpy(editor_paths[i], &buf[strlen(editor_key)]);
+ if (!strncasecmp(buf, "editor=", 7)) {
+ strcpy(editor_path, &buf[7]);
}
if (!strncasecmp(buf, "printcmd=", 9))
if (!strncasecmp(buf, "gotmailcmd=", 11))
strcpy(rc_gotmail_cmd, &buf[11]);
- if (!strncasecmp(buf, "alternate_semantics=", 20)) {
- if (!strncasecmp(&buf[20], "yes", 3)) {
- rc_alt_semantics = 1;
- }
- else {
- rc_alt_semantics = 0;
- }
- }
-
if (!strncasecmp(buf, "cmd=", 4)) {
strcpy(buf, &buf[4]);
#include "citadel_decls.h"
#include "messages.h"
#include "commands.h"
+#include "tuiconfig.h"
#include "rooms.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
unsigned long *msg_arr = NULL;
int msg_arr_size = 0;
int num_msgs;
-char rc_alt_semantics;
extern char room_name[];
extern char tempdir[];
extern unsigned room_flags;
long beg;
char datestr[SIZ];
char header[SIZ];
- char *editor_path = NULL;
int cksum = 0;
- if (mode >= 2)
- {
- if ((mode-2) < MAX_EDITORS && !IsEmptyStr(editor_paths[mode-2]))
- {
- editor_path = editor_paths[mode-2];
- } else if (!IsEmptyStr(editor_paths[0]))
- {
- editor_path = editor_paths[0];
- } else {
- scr_printf("*** No editor available; using built-in editor.\n");
- mode = 0;
- }
+ if ( (mode == 2) && (IsEmptyStr(editor_path)) ) {
+ scr_printf("*** No editor available; using built-in editor.\n");
+ mode = 0;
}
fmt_date(datestr, sizeof datestr, time(NULL), 0);
} while ((g != f) && (g >= 0));
scr_printf("Message printed.\n");
}
- if (rc_alt_semantics && c == 1) {
- char buf[SIZ];
-
- r = CtdlIPCSetMessageSeen(ipc, msg_arr[a], 1, buf);
- }
if (e == SIGQUIT)
return;
if (((userflags & US_NOPROMPT) || (e == SIGINT))
-/*
- * Verify the message base
- */
-void check_message_base(CtdlIPC *ipc)
-{
- char buf[SIZ];
- char *transcript = NULL;
- int r; /* IPC response code */
-
- scr_printf
- ("Please read the documentation before running this command.\n"
- "Having done so, do you still want to check the message base? ");
- if (yesno() == 0)
- return;
-
- r = CtdlIPCMessageBaseCheck(ipc, &transcript, buf);
- if (r / 100 != 1) {
- scr_printf("%s\n", buf);
- return;
- }
-
- while (transcript && !IsEmptyStr(transcript)) {
- extract_token(buf, transcript, 0, '\n', sizeof buf);
- remove_token(transcript, 0, '\n');
- scr_printf("%s\n", buf);
- }
- if (transcript) free(transcript);
- return;
-}
-
-
/*
* Loads the contents of a file into memory. Caller must free the allocated
* memory.
void edit_system_message(CtdlIPC *ipc, char *which_message);
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,
- int subject_required);
+ 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(FILE *);
char *load_message_from_file(FILE *src);
int file_checksum(char *filename);
#include "rooms.h"
#include "commands.h"
#include "messages.h"
+#include "tuiconfig.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
#endif
char cmd[SIZ];
int b, cksum, editor_exit;
- if (IsEmptyStr(editor_paths[0])) {
+ if (IsEmptyStr(editor_path)) {
scr_printf("Do you wish to re-enter %s? ", desc);
if (yesno() == 0)
return;
return;
}
- if (!IsEmptyStr(editor_paths[0])) {
+ if (!IsEmptyStr(editor_path)) {
CtdlIPC_chat_send(ipc, read_cmd);
CtdlIPC_chat_recv(ipc, cmd);
if (cmd[0] == '1') {
cksum = file_checksum(temp);
- if (!IsEmptyStr(editor_paths[0])) {
+ if (!IsEmptyStr(editor_path)) {
char tmp[SIZ];
snprintf(tmp, sizeof tmp, "WINDOW_TITLE=%s", desc);
editor_pid = fork();
if (editor_pid == 0) {
chmod(temp, 0600);
- execlp(editor_paths[0], editor_paths[0], temp, NULL);
+ execlp(editor_path, editor_path, temp, NULL);
exit(1);
}
if (editor_pid > 0)
b = ka_wait(&editor_exit);
} while ((b != editor_pid) && (b >= 0));
editor_pid = (-1);
- scr_printf("Executed %s\n", editor_paths[0]);
+ scr_printf("Executed %s\n", editor_path);
stty_ctdl(0);
} else {
scr_printf("Entering %s. Press return twice when finished.\n", desc);
#include "commands.h"
#include "citadel_decls.h"
#include "routines2.h"
+#include "tuiconfig.h"
#define IFAIDE if(axlevel>=AxAideU)
#define IFNAIDE if (axlevel<AxAideU)
0
);
- if (!IsEmptyStr(editor_paths[0])) {
+ if (!IsEmptyStr(editor_path)) {
user->flags = set_attr(
ipc,
user->flags,
char buf[256];
int r; /* IPC response code */
- if (rc_alt_semantics) {
- if (maxmsgnum == 0 && highest_msg_read == 0) {
- return;
- }
- r = CtdlIPCSetLastRead(ipc, (maxmsgnum > highest_msg_read) ?
- maxmsgnum : highest_msg_read, buf);
- } else {
- r = CtdlIPCSetLastRead(ipc, (maxmsgnum > highest_msg_read) ?
- maxmsgnum : highest_msg_read, buf);
-/* r = CtdlIPCSetLastRead(ipc, maxmsgnum, buf); */
-/* This is a quick-and-dirty fix to all msgs becoming new in Mail>.
- * It will need to be rethought when messages.c is rewritten.
- */
- }
+ r = CtdlIPCSetLastRead(ipc, (maxmsgnum > highest_msg_read) ? maxmsgnum : highest_msg_read, buf);
+
if (r / 100 != 2)
scr_printf("%s\n", buf);
}
* Copyright (c) 1987-2011 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
extern long maxmsgnum;
extern unsigned room_flags;
extern int screenwidth;
+char editor_path[PATH_MAX];
/*
char *listing = NULL;
int r;
- if (IsEmptyStr(editor_paths[0])) {
+ if (IsEmptyStr(editor_path)) {
scr_printf("You must have an external editor configured in"
" order to use this function.\n");
return;
if (editor_pid == 0) {
chmod(filename, 0600);
putenv("WINDOW_TITLE=Network configuration");
- execlp(editor_paths[0], editor_paths[0], filename, NULL);
+ execlp(editor_path, editor_path, filename, NULL);
exit(1);
}
if (editor_pid > 0) {
void do_pop3client_configuration(CtdlIPC *ipc);
void do_rssclient_configuration(CtdlIPC *ipc);
void do_system_configuration(CtdlIPC *ipc);
+
+extern char editor_path[PATH_MAX];
}
-/* FSCK */
-int CtdlIPCMessageBaseCheck(CtdlIPC *ipc, char **mret, char *cret)
-{
- size_t size = 0;
-
- if (!cret) return -2;
- if (!mret) return -2;
- if (*mret) return -2;
-
- return CtdlIPCGenericCommand(ipc, "FSCK", NULL, 0, mret, &size, cret);
-}
-
/*
* Not implemented: