* Cleaned up a couple of FIXME's sitting around in the code
authorArt Cancro <ajc@citadel.org>
Sun, 6 Jun 2004 19:32:15 +0000 (19:32 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 6 Jun 2004 19:32:15 +0000 (19:32 +0000)
* Altered the conditions under which stray http://... strings are
  automatically turned into links, to prevent that logic from
  transforming IMG tags into gibberish.
* Set internal version number to 5.21

webcit/ChangeLog
webcit/html2html.c
webcit/messages.c
webcit/setup.c
webcit/webcit.h

index a7370a2699ee6ddb2baa349cda0865dca8dc5a5a..74a31e524d442a76d5c77f199020d47da18f915e 100644 (file)
@@ -1,4 +1,11 @@
 $Log$
+Revision 510.15  2004/06/06 19:32:15  ajc
+* Cleaned up a couple of FIXME's sitting around in the code
+* Altered the conditions under which stray http://... strings are
+  automatically turned into links, to prevent that logic from
+  transforming IMG tags into gibberish.
+* Set internal version number to 5.21
+
 Revision 510.14  2004/06/04 02:29:07  ajc
 * Fixed bug in "validate new users" screen (thanks Campy)
 
@@ -1862,3 +1869,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index a4931be33731a9e76ebdb1b887637f56fbe81ae9..fdab14556feeb0dba4f808114ea061d1bbf7fa45 100644 (file)
@@ -44,7 +44,6 @@ void output_html(void) {
        int output_length = 0;
        char new_window[SIZ];
        int brak = 0;
-       int in_link = 0;
        int i;
        int linklen;
 
@@ -136,8 +135,10 @@ void output_html(void) {
                        ptr = &ptr[8];
                        ++brak;
                }
-               /* Turn anything that looks like a URL into a real link */
-               else if ( (in_link == 0)
+               /* Turn anything that looks like a URL into a real link, as long
+                * as it's not inside a tag already
+                */
+               else if ( (brak == 0)
                     && (!strncasecmp(ptr, "http://", 7))) {
                                linklen = 0;
                                /* Find the end of the link */
@@ -175,16 +176,10 @@ void output_html(void) {
                }
                else {
                        /*
-                        * We need to know when we're inside a pair of <A>...</A>
-                        * tags, so we don't turn things that look like URL's into
-                        * links, when they're already links.
+                        * We need to know when we're inside a tag,
+                        * so we don't turn things that look like URL's into
+                        * links, when they're already links - or image sources.
                         */
-                       if (!strncasecmp(ptr, "<A ", 3)) {
-                               ++in_link;
-                       }
-                       if (!strncasecmp(ptr, "</A", 3)) {
-                               --in_link;
-                       }
                        if (*ptr == '<') ++brak;
                        if (*ptr == '>') --brak;
                        converted_msg[output_length] = *ptr++;
index a8dfeebde17aafcfaec887d93a09edc398666cee..c2aaa717390bf4317597a3da8cda6ae245951a4c 100644 (file)
@@ -932,8 +932,10 @@ int load_msg_ptrs(char *servcmd)
 {
        char buf[SIZ];
        int nummsgs;
+       int maxload = 0;
 
        nummsgs = 0;
+       maxload = sizeof(WC->msgarr) / sizeof(long) ;
        serv_puts(servcmd);
        serv_gets(buf);
        if (buf[0] != '1') {
@@ -941,9 +943,10 @@ int load_msg_ptrs(char *servcmd)
                return (nummsgs);
        }
        while (serv_gets(buf), strcmp(buf, "000")) {
-               WC->msgarr[nummsgs] = atol(buf);
-               /* FIXME check for overflow */
-               ++nummsgs;
+               if (nummsgs < maxload) {
+                       WC->msgarr[nummsgs] = atol(buf);
+                       ++nummsgs;
+               }
        }
        return (nummsgs);
 }
@@ -994,14 +997,13 @@ void readloop(char *oper)
                strcpy(cmd, "MSGS ALL");
        }
 
-       /* FIXME put in the correct constant #defs */
-       if ((WC->wc_view == 1) && (maxmsgs > 1)) {
+       if ((WC->wc_view == VIEW_MAILBOX) && (maxmsgs > 1)) {
                is_summary = 1;
                strcpy(cmd, "MSGS ALL");
                maxmsgs = 32767;
        }
 
-       if ((WC->wc_view == 2) && (maxmsgs > 1)) {
+       if ((WC->wc_view == VIEW_ADDRESSBOOK) && (maxmsgs > 1)) {
                is_addressbook = 1;
                strcpy(cmd, "MSGS ALL");
                maxmsgs = 32767;
@@ -1040,12 +1042,12 @@ void readloop(char *oper)
                wprintf("<HR width=100%%>\n");
        }
 
-       if (WC->wc_view == 3) {         /* calendar */
+       if (WC->wc_view == VIEW_CALENDAR) {             /* calendar */
                is_calendar = 1;
                strcpy(cmd, "MSGS ALL");
                maxmsgs = 32767;
        }
-       if (WC->wc_view == 4) {         /* tasks */
+       if (WC->wc_view == VIEW_TASKS) {                /* tasks */
                is_tasks = 1;
                strcpy(cmd, "MSGS ALL");
                maxmsgs = 32767;
index d37f983e31eb8af823dba75fd1e90642ef4cd452..4478728c6f1021120d31db98cb0f21c4ed33dfdd 100644 (file)
@@ -386,7 +386,6 @@ void check_inittab_entry(void)
        char looking_for[SIZ];
        char question[SIZ];
        char entryname[5];
-       char entryname2[5];
        char http_port[128];
        char https_port[128];
        char hostname[128];
index e94d0efcfd9994882cc1af6decced2a330fd03fd..dec7db575ce953a8beac4723cc3a86db26123b78 100644 (file)
 #define SLEEPING               180             /* TCP connection timeout */
 #define WEBCIT_TIMEOUT         900             /* WebCit session timeout */
 #define PORT_NUM               2000            /* port number to listen on */
-#define SERVER                 "WebCit v5.20"  /* who's in da house */
+#define SERVER                 "WebCit v5.21"  /* who's in da house */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         520             /* This version of WebCit */
+#define CLIENT_VERSION         521             /* This version of WebCit */
 #define MINIMUM_CIT_VERSION    611             /* min required Citadel vers */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
@@ -468,3 +468,11 @@ int client_read_ssl(char *buf, int bytes, int timeout);
 void client_write_ssl(char *buf, int nbytes);
 #endif
 
+
+
+/* Views (from citadel.h) */
+#define        VIEW_BBS                0       /* Traditional Citadel BBS view */
+#define VIEW_MAILBOX           1       /* Mailbox summary */
+#define VIEW_ADDRESSBOOK       2       /* Address book view */
+#define VIEW_CALENDAR          3       /* Calendar view */
+#define VIEW_TASKS             4       /* Tasks view */