# HG changeset patch # User Richard Laager # Date 1179686458 0 # Node ID 1e674c0886b11942c60f6af031031963e24b5474 # Parent 2c10f77c2378f533a5e7ad403a13324238778c77# Parent ddf759c28d0b349a1dc0a0ac6ff5946e8f1f8be1 propagate from branch 'im.pidgin.pidgin' (head b917cc2cf9c46c7163ad3345b312dac1eea896cf) to branch 'im.pidgin.rlaager.merging.for_2_1_0' (head 6d4701b6ce24327540b11d93b4e203334a042c6e) diff -r 2c10f77c2378 -r 1e674c0886b1 ChangeLog --- a/ChangeLog Sun May 20 15:00:39 2007 +0000 +++ b/ChangeLog Sun May 20 18:40:58 2007 +0000 @@ -45,6 +45,7 @@ conversation tabs (Ma Xuan) * Fix IRC connection bug with dircproxy (xjoe) * Ctrl+[shift]+tab focuses the next most active tab (William Thompson) + * Fix Open Hotmail Inbox for MSN to work more reliably * Add a Google Talk item to the protocol list, to help users who think we don't support Google Talk. The item acts just like "XMPP". * Remember if the X server supports XScreenSaver, to avoid waking it @@ -54,6 +55,7 @@ and the XScreenSaver change will reduce Pidgin's effect on power consumption when running with NO_HZ. (Arjan van de Ven with Intel Corporation) + * Conversation -> Save As will now use aliases. Finch: * Userlist in chat windows, which can be turned on or off using diff -r 2c10f77c2378 -r 1e674c0886b1 libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Sun May 20 15:00:39 2007 +0000 +++ b/libpurple/protocols/msn/msn.c Sun May 20 18:40:58 2007 +0000 @@ -342,10 +342,8 @@ if (session->passport_info.file == NULL) { - MsnCmdProc *cmdproc = session->notification->cmdproc; purple_notify_error(gc, NULL, _("This Hotmail account may not be active."), NULL); - msn_cmdproc_send(cmdproc, "URL", "%s", "INBOX"); return; } @@ -621,7 +619,8 @@ account = purple_connection_get_account(gc); user = msn_normalize(account, purple_account_get_username(account)); - if (strstr(user, "@hotmail.") != NULL) + if ((strstr(user, "@hotmail.") != NULL) || + (strstr(user, "@msn.com") != NULL)) { m = g_list_append(m, NULL); act = purple_plugin_action_new(_("Open Hotmail Inbox"), diff -r 2c10f77c2378 -r 1e674c0886b1 libpurple/protocols/msn/session.c --- a/libpurple/protocols/msn/session.c Sun May 20 15:00:39 2007 +0000 +++ b/libpurple/protocols/msn/session.c Sun May 20 18:40:58 2007 +0000 @@ -404,4 +404,9 @@ /* Sync users */ msn_session_sync_users(session); + /* It seems that some accounts that haven't accessed hotmail for a while + * and @msn.com accounts don't automatically get the initial email + * notification so we always request it on login + */ + msn_cmdproc_send(session->notification->cmdproc, "URL", "%s", "INBOX"); } diff -r 2c10f77c2378 -r 1e674c0886b1 libpurple/purple-remote --- a/libpurple/purple-remote Sun May 20 15:00:39 2007 +0000 +++ b/libpurple/purple-remote Sun May 20 18:40:58 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: diff -r 2c10f77c2378 -r 1e674c0886b1 libpurple/util.c --- a/libpurple/util.c Sun May 20 15:00:39 2007 +0000 +++ b/libpurple/util.c Sun May 20 18:40:58 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, "%s", @@ -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, "%s", + 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; @@ -4155,7 +4212,7 @@ gunichar c = g_utf8_get_char(iter); /* If the character is an ASCII character and is alphanumeric, * or one of the specified values, no need to escape */ - if (c < 128 && (isalnum(c) || c == '@' || c == '-' || + if (c < 128 && (g_ascii_isalnum(c) || c == '@' || c == '-' || c == '_' || c == '.' || c == '#')) { buf[j++] = c; } else { diff -r 2c10f77c2378 -r 1e674c0886b1 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Sun May 20 15:00:39 2007 +0000 +++ b/pidgin/gtkconv.c Sun May 20 18:40:58 2007 +0000 @@ -1012,12 +1012,24 @@ { PidginWindow *win = data; PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win); + PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name); + const char *name; gchar *buf; - - buf = g_strdup_printf("%s.html", purple_normalize(conv->account, conv->name)); - + gchar *c; + + if (buddy != NULL) + name = purple_buddy_get_contact_alias(buddy); + else + name = purple_normalize(conv->account, conv->name); + + buf = g_strdup_printf("%s.html", name); + for (c = buf ; *c ; c++) + { + if (*c == '/' || *c == '\\') + *c = ' '; + } purple_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"), - purple_escape_filename(buf), + buf, TRUE, G_CALLBACK(savelog_writefile_cb), NULL, NULL, NULL, conv, conv);