html_to_ascii() , removed unused option do_citaformat
authorArt Cancro <ajc@citadel.org>
Mon, 17 Sep 2018 22:19:23 +0000 (18:19 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 17 Sep 2018 22:19:23 +0000 (18:19 -0400)
citadel/citadel.h
citadel/msgbase.c
libcitadel/lib/html_to_ascii.c
libcitadel/lib/libcitadel.h
libcitadel/tests/stringbuf_conversion.c
textclient/messages.c
webcit/messages.c
webcit/webcit.h

index 3a4ddf24621737965bae9182445b24d4faa0c92c..b7fbae097bc578323702508d80c4606b0706de13 100644 (file)
@@ -38,7 +38,7 @@ extern "C" {
 #define REV_LEVEL      922             // This version
 #define REV_MIN                591             // Oldest compatible database
 #define EXPORT_REV_MIN 760             // Oldest compatible export files
-#define LIBCITADEL_MIN 920             // Minimum required version of libcitadel
+#define LIBCITADEL_MIN 921             // Minimum required version of libcitadel
 
 #define SERVER_TYPE 0                  // zero for stock Citadel; other developers please
                                        // obtain SERVER_TYPE codes for your implementations
index a88a76369b5622251daf366d98fa0564bfd8b199..7f6b7c9dabecf7477a213aecbea99a1f67e1af03 100644 (file)
@@ -1308,7 +1308,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
        }
 
        if (!strcasecmp(cbtype, "text/html")) {
-               ptr = html_to_ascii(content, length, 80, 0);
+               ptr = html_to_ascii(content, length, 80);
                wlen = strlen(ptr);
                client_write(ptr, wlen);
                if ((wlen > 0) && (ptr[wlen-1] != '\n')) {
index 29d0e31c44924568b97f03756c22f7e64845fdab..9298dd6c7706bc5c071f277924c4a4df53175a37 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Functions which handle translation between HTML and plain text
- * Copyright (c) 2000-2010 by the citadel.org team
+ * Copyright (c) 2000-2018 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
@@ -47,9 +47,8 @@
  *
  * inputmsg      = pointer to raw HTML message
  * screenwidth   = desired output screenwidth
- * do_citaformat = set to 1 to indent newlines with spaces
  */
-char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_citaformat) {
+char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth) {
        char inbuf[SIZ];
        int inbuf_len = 0;
        char outbuf[SIZ];
@@ -543,11 +542,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                        strncpy(&outptr[output_len], outbuf, i+1);
                                        output_len += (i+1);
 
-                                       if (do_citaformat) {
-                                               strcpy(&outptr[output_len], " ");
-                                               ++output_len;
-                                       }
-
                                        strcpy(outbuf, &outbuf[i+1]);
                                        i = 0;
                                        did_out = 1;
@@ -567,10 +561,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                output_len += rb;
                                strcpy(&outptr[output_len], nl);
                                output_len += strlen(nl);
-                               if (do_citaformat) {
-                                       strcpy(&outptr[output_len], " ");
-                                       ++output_len;
-                               }
                                strcpy(outbuf, &outbuf[rb+1]);
                        } else {
                                strncpy(&outptr[output_len], outbuf,
@@ -578,10 +568,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                output_len += (screenwidth-2);
                                strcpy(&outptr[output_len], nl);
                                output_len += strlen(nl);
-                               if (do_citaformat) {
-                                       strcpy(&outptr[output_len], " ");
-                                       ++output_len;
-                               }
                                strcpy(outbuf, &outbuf[screenwidth-2]);
                        }
                }
index f22e77f1024ce83a821cfce9d84af88155c35b52..3dbea9588577052147fd05f887cac194813d6bdd 100644 (file)
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#define LIBCITADEL_VERSION_NUMBER      920
+#define LIBCITADEL_VERSION_NUMBER      921
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
@@ -463,7 +463,7 @@ char *rfc2047encode(const char *line, long length);
 int is_msg_in_mset(const char *mset, long msgnum);
 int pattern2(char *search, char *patn);
 void stripltlen(char *, int *);
-char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_citaformat);
+char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth);
 void LoadEntityList(char *FileName);
 
 
index 00cbbe426d77f9e8bb6661d4a15633aa299b085c..8305f4677918bef8682bedaea2f8f12d25bd0e1f 100644 (file)
@@ -362,7 +362,7 @@ static void TestHTML2ASCII_line(void)
                
                StrBufTCP_read_line(Source, &fdin, 0, &Err);
                printf("the source:>%s<\n", ChrPtr(Source));
-               Target = html_to_ascii(ChrPtr(Source), StrLength(Source), 80, 0);
+               Target = html_to_ascii(ChrPtr(Source), StrLength(Source), 80);
                
                printf("the target:>%s<\n", Target);
                FlushStrBuf(Source);
index a6d5201728b674ba694828eb0c2d3ce5dfc19718..b647229e19487cdeb0beae1fcf838907edc2e0bf 100644 (file)
@@ -596,7 +596,7 @@ int read_message(CtdlIPC * ipc, long num,   /* message number */
         * of the client screen.
         */
        if (!strcasecmp(message->content_type, "text/html")) {
-               converted_text = html_to_ascii(message->text, 0, screenwidth, 0);
+               converted_text = html_to_ascii(message->text, 0, screenwidth);
                if (converted_text != NULL) {
                        free(message->text);
                        message->text = converted_text;
index 7307d5eb6dc91d9953b7765d65df78e1043e6859..d1b0f20817cc3b2bbe6f5584573b2d5ae6380516 100644 (file)
@@ -923,7 +923,7 @@ void post_mime_to_server(void) {
                serv_puts("Content-type: text/plain; charset=utf-8");
                serv_puts("Content-Transfer-Encoding: quoted-printable");
                serv_puts("");
-               txtmail = html_to_ascii(bstr("msgtext"), 0, 80, 0);
+               txtmail = html_to_ascii(bstr("msgtext"), 0, 80);
                Buf = NewStrBufPlain(txtmail, -1);
                free(txtmail);
 
index 030b75a53ea46b18297bc5a25fed0a973a51e686..e6e10d07e671f5d41fce55738c122754dd4cb520 100644 (file)
@@ -129,7 +129,7 @@ extern char *ssl_cipher_list;
 #define CLIENT_ID              4
 #define CLIENT_VERSION         921             /* This version of WebCit */
 #define MINIMUM_CIT_VERSION    920             /* Minimum required version of Citadel server */
-#define        LIBCITADEL_MIN          920             /* Minimum required version of libcitadel */
+#define        LIBCITADEL_MIN          921             /* Minimum required version of libcitadel */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define TARGET                 "webcit01"      /* Window target for inline URL's */