$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)
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
int output_length = 0;
char new_window[SIZ];
int brak = 0;
- int in_link = 0;
int i;
int linklen;
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 */
}
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++;
{
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') {
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);
}
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;
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;
char looking_for[SIZ];
char question[SIZ];
char entryname[5];
- char entryname2[5];
char http_port[128];
char https_port[128];
char hostname[128];
#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"
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 */