Blockquotes are now rendered to console as dim instead of italic
authorArt Cancro <ajc@citadel.org>
Tue, 23 Jan 2024 16:18:41 +0000 (11:18 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 23 Jan 2024 16:18:41 +0000 (11:18 -0500)
citadel/server/control.c
citadel/server/modules/upgrade/serv_upgrade.c
libcitadel/lib/html_to_ascii.c
textclient/commands.c

index 51e9f7d60a64f58f12743d606f2803fa851c9675..a6ff329016082ac1886caa9a5a154d0a2d7d353e 100644 (file)
@@ -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");
index 2df2db61c63e5cfecba7ce9225315ea613bf405a..4d9b176a6b331fdb8ffc84aba0c70df8c146b7c4 100644 (file)
@@ -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);
index c57a5020e88b5d9cd9b458acdb3a2b473ebab879..ca2de8df8d9e7b0eb756ca1a7186a16d5f571641 100644 (file)
@@ -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<blockquote; ++j) strcat(nl, ">");
                                        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<blockquote; ++j) strcat(nl, ">");
index 6af74c788ab20c55512a658fc5949025765871b5..cf3576d878eb6c3f7b21e051c656dfd20490aee6 100644 (file)
@@ -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?