Mercurial > pidgin
changeset 17160:251ed95cc52c
merge of '211be57922bc0273e193942f976264ae52d8cf41'
and '7fa526ccf77d3d2da927a55aa8115be7e1be184d'
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 20 May 2007 15:02:03 +0000 |
parents | fdd52f7651c7 (diff) afb25cb38e75 (current diff) |
children | 51f8dac490d7 e4179a27f5be |
files | |
diffstat | 2 files changed, 59 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/purple-remote Sun May 20 14:57:33 2007 +0000 +++ b/libpurple/purple-remote Sun May 20 15:02:03 2007 +0000 @@ -94,6 +94,8 @@ def execute(uri): match = re.match(urlregexp, uri) protocol = match.group(2) + if protocol == "xmpp" + protocol = "jabber" if protocol == "aim" or protocol == "icq": protocol = "oscar" if protocol is not None:
--- a/libpurple/util.c Sun May 20 14:57:33 2007 +0000 +++ b/libpurple/util.c Sun May 20 15:02:03 2007 +0000 @@ -1874,6 +1874,11 @@ while (1) { if (badchar(*t) || badentity(t)) { + if ((!g_ascii_strncasecmp(c, "http://", 7) && (t - c == 7)) || + (!g_ascii_strncasecmp(c, "https://", 8) && (t - c == 8))) { + break; + } + if (*(t) == ',' && (*(t + 1) != ' ')) { t++; continue; @@ -1933,6 +1938,12 @@ t = c; while (1) { if (badchar(*t) || badentity(t)) { + + if ((!g_ascii_strncasecmp(c, "ftp://", 6) && (t - c == 6)) || + (!g_ascii_strncasecmp(c, "sftp://", 7) && (t - c == 7))) { + break; + } + if (*(t - 1) == '.') t--; if ((*(t - 1) == ')' && (inside_paren > 0))) { @@ -1984,8 +1995,21 @@ t = c; while (1) { if (badchar(*t) || badentity(t)) { + char *d; + if (t - c == 7) { + break; + } if (*(t - 1) == '.') t--; + if ((d = strstr(c + 7, "?")) != NULL && d < t) + url_buf = g_strndup(c + 7, d - c - 7); + else + url_buf = g_strndup(c + 7, t - c - 7); + if (!purple_email_is_valid(url_buf)) { + g_free(url_buf); + break; + } + g_free(url_buf); url_buf = g_strndup(c, t - c); tmpurlbuf = purple_unescape_html(url_buf); g_string_append_printf(ret, "<A HREF=\"%s\">%s</A>", @@ -2000,6 +2024,39 @@ t++; } + } else if ((*c=='x') && (!g_ascii_strncasecmp(c, "xmpp:", 5)) && + (c == text || badchar(c[-1]) || badentity(c-1))) { + t = c; + while (1) { + if (badchar(*t) || badentity(t)) { + + if (t - c == 5) { + break; + } + + if (*(t) == ',' && (*(t + 1) != ' ')) { + t++; + continue; + } + + if (*(t - 1) == '.') + t--; + if ((*(t - 1) == ')' && (inside_paren > 0))) { + t--; + } + + url_buf = g_strndup(c, t - c); + tmpurlbuf = purple_unescape_html(url_buf); + g_string_append_printf(ret, "<A HREF=\"%s\">%s</A>", + tmpurlbuf, url_buf); + g_free(url_buf); + g_free(tmpurlbuf); + c = t; + break; + } + t++; + + } } else if (c != text && (*c == '@')) { int flag; GString *gurl_buf = NULL;