From d383bc5305bc266d8ca34e61753bc47f7a2a83d4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 23 Jan 2024 11:18:41 -0500 Subject: [PATCH] Blockquotes are now rendered to console as dim instead of italic --- citadel/server/control.c | 25 ++++++++++--------- citadel/server/modules/upgrade/serv_upgrade.c | 6 +++++ libcitadel/lib/html_to_ascii.c | 4 +-- textclient/commands.c | 4 +-- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/citadel/server/control.c b/citadel/server/control.c index 51e9f7d60..a6ff32901 100644 --- a/citadel/server/control.c +++ b/citadel/server/control.c @@ -1,7 +1,7 @@ // // This module handles states which are global to the entire server. // -// Copyright (c) 1987-2023 by the citadel.org team +// Copyright (c) 1987-2024 by the citadel.org team // // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License, version 3. @@ -226,7 +226,7 @@ void cmd_conf(char *argbuf) { cprintf("%s\n", CtdlGetConfigStr("c_nodename")); cprintf("%s\n", CtdlGetConfigStr("c_fqdn")); cprintf("%s\n", CtdlGetConfigStr("c_humannode")); - cprintf("xxx\n"); // placeholder -- field no longer in use + cprintf("xxx\n"); cprintf("%d\n", CtdlGetConfigInt("c_creataide")); cprintf("%d\n", CtdlGetConfigInt("c_sleeping")); cprintf("%d\n", CtdlGetConfigInt("c_initax")); @@ -238,7 +238,7 @@ void cmd_conf(char *argbuf) { cprintf("%s\n", CtdlGetConfigStr("c_site_location")); cprintf("%s\n", CtdlGetConfigStr("c_sysadm")); cprintf("%d\n", CtdlGetConfigInt("c_maxsessions")); - cprintf("xxx\n"); // placeholder -- field no longer in use + cprintf("xxx\n"); cprintf("%d\n", CtdlGetConfigInt("c_userpurge")); cprintf("%d\n", CtdlGetConfigInt("c_roompurge")); cprintf("%s\n", CtdlGetConfigStr("c_logpages")); @@ -253,7 +253,7 @@ void cmd_conf(char *argbuf) { cprintf("%d\n", CtdlGetConfigInt("c_imap_port")); cprintf("%ld\n", CtdlGetConfigLong("c_net_freq")); cprintf("%d\n", CtdlGetConfigInt("c_disable_newu")); - cprintf("1\n"); // niu + cprintf("1\n"); cprintf("%d\n", CtdlGetConfigInt("c_purge_hour")); cprintf("%s\n", CtdlGetConfigStr("c_ldap_host")); cprintf("%d\n", CtdlGetConfigInt("c_ldap_port")); @@ -570,13 +570,14 @@ void cmd_conf(char *argbuf) { len = strlen(confptr); cprintf("%d %s\n", LISTING_FOLLOWS, confname); client_write(confptr, len); - if ((len > 0) && (confptr[len - 1] != 10)) + if ((len > 0) && (confptr[len - 1] != 10)) { client_write("\n", 1); + } cprintf("000\n"); free(confptr); - } else { - cprintf("%d No such configuration.\n", - ERROR + ILLEGAL_VALUE); + } + else { + cprintf("%d No such configuration.\n", ERROR + ILLEGAL_VALUE); } } @@ -646,7 +647,7 @@ void cmd_conf(char *argbuf) { cprintf("%d all configuration variables\n", LISTING_FOLLOWS); cdb_rewind(CDB_CONFIG); - while (cdbcfg = cdb_next_item(CDB_CONFIG), cdbcfg.val.ptr!=NULL) { // always read to the end + while (cdbcfg = cdb_next_item(CDB_CONFIG), cdbcfg.val.ptr!=NULL) { // MUST read to the end if (cdbcfg.val.len < 1020) { keylen = strlen(cdbcfg.val.ptr); key = cdbcfg.val.ptr; @@ -717,8 +718,7 @@ void cmd_gvdn(char *argbuf) { StrBufExtract_NextToken(CfgToken, Line, &PPos, '|'); if (GetHash(CfgNameHash, SKEY(CfgToken), &vptr) && (vptr != NULL)) { pCfg = (ConfType *) vptr; - if (pCfg->Type <= min) - { + if (pCfg->Type <= min) { Put(List, SKEY(Cfg), Cfg, HFreeStrBuf); Cfg = NULL; } @@ -748,8 +748,9 @@ char *ctdl_module_init_control(void) { int i; CfgNameHash = NewHash(1, NULL); - for (i = 0; CfgNames[i].Name.Key != NULL; i++) + for (i = 0; CfgNames[i].Name.Key != NULL; i++) { Put(CfgNameHash, CKEY(CfgNames[i].Name), &CfgNames[i], reference_free_handler); + } CtdlRegisterProtoHook(cmd_gvdn, "GVDN", "get valid domain names"); CtdlRegisterProtoHook(cmd_conf, "CONF", "get/set system configuration"); diff --git a/citadel/server/modules/upgrade/serv_upgrade.c b/citadel/server/modules/upgrade/serv_upgrade.c index 2df2db61c..4d9b176a6 100644 --- a/citadel/server/modules/upgrade/serv_upgrade.c +++ b/citadel/server/modules/upgrade/serv_upgrade.c @@ -393,6 +393,12 @@ void pre_startup_upgrades(void) { return; } + // After 2026-may-06 we will do the following: + // 1. Set the oldest upgradable version to 902 (it will then be ten years old) + // 2. Remove support for upgrading from the legacy config and control file formats. + + // Currently, the oldest upgradable version is 811, which was released on 2012-may-21 + if ((oldver > 000) && (oldver < 811)) { syslog(LOG_EMERG, "This database is too old to be upgraded. Citadel server will exit."); exit(EXIT_FAILURE); diff --git a/libcitadel/lib/html_to_ascii.c b/libcitadel/lib/html_to_ascii.c index c57a5020e..ca2de8df8 100644 --- a/libcitadel/lib/html_to_ascii.c +++ b/libcitadel/lib/html_to_ascii.c @@ -236,7 +236,7 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int ansi) ++blockquote; strcpy(nl, "\n"); if ( (blockquote == 1) && (ansi) ) { - strcat(nl, "\033[2m\033[3m"); + strcat(nl, "\033[2m\033[2m"); } for (j=0; j"); strcat(outbuf, nl); @@ -246,7 +246,7 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int ansi) strcat(outbuf, "\n"); --blockquote; if ( (blockquote == 0) && (ansi) ) { - strcat(outbuf, "\033[22m\033[23m"); + strcat(outbuf, "\033[22m\033[22m"); } strcpy(nl, "\n"); for (j=0; j"); diff --git a/textclient/commands.c b/textclient/commands.c index 6af74c788..cf3576d87 100644 --- a/textclient/commands.c +++ b/textclient/commands.c @@ -1439,7 +1439,7 @@ int fmout(int width, // screen width to use if ((in_quote) && (*e == '\n') && (enable_color)) { in_quote = 0; - scr_printf("\033[22m\033[23m"); + scr_printf("\033[22m\033[22m"); } if (*e == '\n') { // newline? @@ -1468,7 +1468,7 @@ int fmout(int width, // screen width to use if ((*e == '>') && (column <= 1) && (!fpout) && (enable_color)) { in_quote = 1; - scr_printf("\033[2m\033[3m"); + scr_printf("\033[2m\033[2m"); } // Or are we looking at a space? -- 2.30.2