From: Art Cancro Date: Sun, 6 Jul 2003 22:07:00 +0000 (+0000) Subject: * When converting "anything that looks like a URL" to a real link, first X-Git-Tag: v7.86~5829 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=01008640a5b0d110e76db7e885accf45abfd20d9 * When converting "anything that looks like a URL" to a real link, first make sure that it isn't already inside a link. This fixes most of the long, ugly URL strings sent by eBay. * Automatically dismantle mailto: links in HTML messages, and convert them to WebCit mail links (clicking on it sends the user to the Mail room and begins composing a new message with the recipient and subject fields pre-populated). --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index fee11c4de..15afc6872 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,13 @@ $Log$ +Revision 500.9 2003/07/06 22:06:59 ajc +* When converting "anything that looks like a URL" to a real link, first + make sure that it isn't already inside a link. This fixes most of the + long, ugly URL strings sent by eBay. +* Automatically dismantle mailto: links in HTML messages, and convert + them to WebCit mail links (clicking on it sends the user to the Mail + room and begins composing a new message with the recipient and subject + fields pre-populated). + Revision 500.8 2003/06/29 20:51:21 ajc * Worked around a rendering bug in Satan's Browser that was causing it to draw the calendar month view much wider than the actual screen wdith @@ -1518,3 +1527,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/html2html.c b/webcit/html2html.c index 023ab7c4a..3b6a9c3e8 100644 --- a/webcit/html2html.c +++ b/webcit/html2html.c @@ -44,6 +44,7 @@ void output_html(void) { int output_length = 0; char new_window[SIZ]; int brak = 0; + int in_link = 0; int i; int linklen; @@ -111,8 +112,23 @@ void output_html(void) { strcpy(converted_msg, ""); ptr = msgstart; while (ptr < msgend) { + /* Change mailto: links to WebCit mail, by replacing the + * link with one that points back to our mail room. Due to + * the way we parse URL's, it'll even handle mailto: links + * that have "?subject=" in them. + */ + if (!strncasecmp(ptr, "... + * tags, so we don't turn things that look like URL's into + * links, when they're already links. + */ + if (!strncasecmp(ptr, "') --brak; converted_msg[output_length] = *ptr++; diff --git a/webcit/messages.c b/webcit/messages.c index 5988a9599..67ee5a07f 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1131,8 +1131,11 @@ void display_enter(void) long now; struct wc_attachment *att; - output_headers(1); + if (strlen(bstr("force_room")) > 0) { + gotoroom(bstr("force_room"), 0); + } + output_headers(1); sprintf(buf, "ENT0 0|%s|0|0", bstr("recp")); serv_puts(buf); serv_gets(buf); diff --git a/webcit/webcit.c b/webcit/webcit.c index b5b9e18ce..90984f330 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -92,11 +92,11 @@ void addurls(char *url) for (a = 0; a <= b; ++a) ++up; - /* locate the & sign */ + /* locate "&" and "?" delimiters */ ptr = up; b = strlen(up); for (a = 0; a < strlen(up); ++a) { - if (!strncmp(ptr, "&", 1)) { + if ( (ptr[0] == '&') || (ptr[0] == '?') ) { b = a; break; } diff --git a/webcit/webcit.h b/webcit/webcit.h index e722af7cf..af858845c 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -409,6 +409,7 @@ void ical_dezonify(icalcomponent *cal); void partstat_as_string(char *buf, icalproperty *attendee); icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp); void check_attendee_availability(icalcomponent *supplied_vevent); +void do_freebusy(char *req); #endif extern char *months[];