From: Art Cancro Date: Fri, 23 Mar 2012 16:26:46 +0000 (-0400) Subject: Removed obsolete features from client X-Git-Tag: v8.11~122 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=fd07872e0d4e368fbde54d32f3a1fa56cad8ddd1;p=citadel.git Removed obsolete features from client --- diff --git a/citadel/citadel.rc b/citadel/citadel.rc index 6ca24feb8..b52515938 100644 --- a/citadel/citadel.rc +++ b/citadel/citadel.rc @@ -20,30 +20,14 @@ encrypt=default # # 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

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 @@ -116,14 +100,10 @@ remember_passwords=0 # 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" @@ -153,53 +133,10 @@ opencmd=xdg-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 ew will display a new message -# at most once, unless last old on new is turned on. -# * Reading orward or everse does not mark messages as read. -# * When you leave a room with oto, 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 erminate, no additional messages are marked -# as read. -# * The kip and 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 # @@ -290,7 +227,6 @@ cmd=70,2,&.,&Aide,&Message edit: 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 diff --git a/citadel/include/citadel_ipc.h b/citadel/include/citadel_ipc.h index b066127f8..c67cfd310 100644 --- a/citadel/include/citadel_ipc.h +++ b/citadel/include/citadel_ipc.h @@ -327,7 +327,6 @@ int CtdlIPCStartEncryption(CtdlIPC *ipc, char *cret); 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 */ diff --git a/citadel/textclient/citadel.c b/citadel/textclient/citadel.c index af0df8527..5821df404 100644 --- a/citadel/textclient/citadel.c +++ b/citadel/textclient/citadel.c @@ -76,7 +76,6 @@ extern char *moreprompt; 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]; @@ -852,10 +851,6 @@ void gotoroomstep(CtdlIPC *ipc, int direction, int mode) if (mode == 0) { /* not skipping */ updatels(ipc); - } else { - if (rc_alt_semantics) { - updatelsa(ipc); - } } /* Free the room list */ @@ -972,7 +967,7 @@ void read_config(CtdlIPC *ipc) 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); @@ -1811,14 +1806,9 @@ NEWUSR: if (IsEmptyStr(rc_password)) { gotonext(ipc); break; case 47: /* 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: /* ail */ @@ -1833,9 +1823,6 @@ NEWUSR: if (IsEmptyStr(rc_password)) { break; case 52: if (!IsEmptyStr(argbuf)) { - if (rc_alt_semantics) { - updatelsa(ipc); - } dotgoto(ipc, argbuf, 0, 0); } break; @@ -1933,9 +1920,7 @@ NEWUSR: if (IsEmptyStr(rc_password)) { break; case 29: case 30: - if (!rc_alt_semantics) { - updatels(ipc); - } + updatels(ipc); termn8 = 1; break; case 48: @@ -1993,8 +1978,7 @@ NEWUSR: if (IsEmptyStr(rc_password)) { case 15: scr_printf("Are you sure (y/n)? "); if (yesno() == 1) { - if (!rc_alt_semantics) - updatels(ipc); + updatels(ipc); a = 0; termn8 = 1; } @@ -2004,8 +1988,7 @@ NEWUSR: if (IsEmptyStr(rc_password)) { 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) { @@ -2058,9 +2041,6 @@ NEWUSR: if (IsEmptyStr(rc_password)) { break; case 6: - if (rc_alt_semantics) { - updatelsa(ipc); - } gotonext(ipc); break; @@ -2088,10 +2068,6 @@ NEWUSR: if (IsEmptyStr(rc_password)) { do_internet_configuration(ipc); break; - case 83: - check_message_base(ipc); - break; - case 84: quiet_mode(ipc); break; @@ -2265,17 +2241,8 @@ NEWUSR: if (IsEmptyStr(rc_password)) { 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); diff --git a/citadel/textclient/commands.c b/citadel/textclient/commands.c index 5e5aec5d8..525e3ce62 100644 --- a/citadel/textclient/commands.c +++ b/citadel/textclient/commands.c @@ -61,6 +61,7 @@ #include "rooms.h" #include "client_chat.h" #include "citadel_dirs.h" +#include "tuiconfig.h" #ifndef HAVE_SNPRINTF #include "snprintf.h" #endif @@ -654,18 +655,14 @@ void load_command_set(void) { 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, ""); @@ -685,7 +682,6 @@ void load_command_set(void) #ifdef HAVE_OPENSSL rc_encrypt = RC_DEFAULT; #endif - rc_alt_semantics = 0; /* now try to open the citadel.rc file */ @@ -730,14 +726,8 @@ void load_command_set(void) #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)) @@ -808,15 +798,6 @@ void load_command_set(void) 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]); diff --git a/citadel/textclient/messages.c b/citadel/textclient/messages.c index e20888f29..5f29bf0ad 100644 --- a/citadel/textclient/messages.c +++ b/citadel/textclient/messages.c @@ -48,6 +48,7 @@ #include "citadel_decls.h" #include "messages.h" #include "commands.h" +#include "tuiconfig.h" #include "rooms.h" #ifndef HAVE_SNPRINTF #include "snprintf.h" @@ -76,7 +77,6 @@ void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax); 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; @@ -879,21 +879,11 @@ int client_make_message(CtdlIPC *ipc, 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); @@ -1659,11 +1649,6 @@ RMSGREAD: } 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)) @@ -1963,37 +1948,6 @@ void edit_system_message(CtdlIPC *ipc, char *which_message) -/* - * 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. diff --git a/citadel/textclient/messages.h b/citadel/textclient/messages.h index 0ece30f22..a624db5ab 100644 --- a/citadel/textclient/messages.h +++ b/citadel/textclient/messages.h @@ -9,15 +9,15 @@ void readmsgs(CtdlIPC *ipc, enum MessageList c, enum MessageDirection rdir, int 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); diff --git a/citadel/textclient/rooms.c b/citadel/textclient/rooms.c index ce6124ed3..6dcc99bb6 100644 --- a/citadel/textclient/rooms.c +++ b/citadel/textclient/rooms.c @@ -32,6 +32,7 @@ #include "rooms.h" #include "commands.h" #include "messages.h" +#include "tuiconfig.h" #ifndef HAVE_SNPRINTF #include "snprintf.h" #endif @@ -1188,7 +1189,7 @@ void do_edit(CtdlIPC *ipc, 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; @@ -1204,7 +1205,7 @@ void do_edit(CtdlIPC *ipc, 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') { @@ -1218,7 +1219,7 @@ void do_edit(CtdlIPC *ipc, cksum = file_checksum(temp); - if (!IsEmptyStr(editor_paths[0])) { + if (!IsEmptyStr(editor_path)) { char tmp[SIZ]; snprintf(tmp, sizeof tmp, "WINDOW_TITLE=%s", desc); @@ -1227,7 +1228,7 @@ void do_edit(CtdlIPC *ipc, 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) @@ -1236,7 +1237,7 @@ void do_edit(CtdlIPC *ipc, 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); diff --git a/citadel/textclient/routines.c b/citadel/textclient/routines.c index 3c02792c0..6d8018e34 100644 --- a/citadel/textclient/routines.c +++ b/citadel/textclient/routines.c @@ -53,6 +53,7 @@ struct utmp *getutline(struct utmp *ut); #include "commands.h" #include "citadel_decls.h" #include "routines2.h" +#include "tuiconfig.h" #define IFAIDE if(axlevel>=AxAideU) #define IFNAIDE if (axlevelflags = set_attr( ipc, user->flags, diff --git a/citadel/textclient/routines2.c b/citadel/textclient/routines2.c index caf7c9e17..7f5db8e45 100644 --- a/citadel/textclient/routines2.c +++ b/citadel/textclient/routines2.c @@ -191,20 +191,8 @@ void updatels(CtdlIPC *ipc) 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); } diff --git a/citadel/textclient/screen.c b/citadel/textclient/screen.c index c79d693fd..829e6b730 100644 --- a/citadel/textclient/screen.c +++ b/citadel/textclient/screen.c @@ -4,18 +4,12 @@ * 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 */ diff --git a/citadel/textclient/tuiconfig.c b/citadel/textclient/tuiconfig.c index df5c43bd5..3ec778329 100644 --- a/citadel/textclient/tuiconfig.c +++ b/citadel/textclient/tuiconfig.c @@ -63,6 +63,7 @@ extern long highest_msg_read; extern long maxmsgnum; extern unsigned room_flags; extern int screenwidth; +char editor_path[PATH_MAX]; /* @@ -567,7 +568,7 @@ void network_config_management(CtdlIPC *ipc, char *entrytype, char *comment) 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; @@ -619,7 +620,7 @@ void network_config_management(CtdlIPC *ipc, char *entrytype, char *comment) 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) { diff --git a/citadel/textclient/tuiconfig.h b/citadel/textclient/tuiconfig.h index e810871fd..1c5094fc3 100644 --- a/citadel/textclient/tuiconfig.h +++ b/citadel/textclient/tuiconfig.h @@ -5,3 +5,5 @@ void do_filterlist_configuration(CtdlIPC *ipc); void do_pop3client_configuration(CtdlIPC *ipc); void do_rssclient_configuration(CtdlIPC *ipc); void do_system_configuration(CtdlIPC *ipc); + +extern char editor_path[PATH_MAX]; diff --git a/citadel/utillib/citadel_ipc.c b/citadel/utillib/citadel_ipc.c index b8d345dea..15e860a4b 100644 --- a/citadel/utillib/citadel_ipc.c +++ b/citadel/utillib/citadel_ipc.c @@ -2147,18 +2147,6 @@ int CtdlIPCInternalProgram(CtdlIPC *ipc, int secret, char *cret) } -/* 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: