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 3a4ddf2..b7fbae0 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 a88a763..7f6b7c9 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 29d0e31..9298dd6 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 f22e77f..3dbea95 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 00cbbe4..8305f46 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 a6d5201..b647229 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 7307d5e..d1b0f20 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 030b75a..e6e10d0 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 */