# HG changeset patch # User Marcus Lundblad # Date 1251398815 0 # Node ID 1da2ea10c2d063d2f803207d8da21f7499f5f81e # Parent 268b821de5c57450649efafca63bb981105091f7# Parent 7763697a85c80d702458f70fb84fabc3dfca6095 propagate from branch 'im.pidgin.pidgin' (head 4b37450c5470f1f61cdba5cf5de7a6abb166b2c1) to branch 'im.pidgin.cpw.malu.ft_thumbnails' (head 915c5ec9bac6452b45224235189df617d5aa6a95) diff -r 7763697a85c8 -r 1da2ea10c2d0 ChangeLog --- a/ChangeLog Mon Aug 24 19:21:21 2009 +0000 +++ b/ChangeLog Thu Aug 27 18:46:55 2009 +0000 @@ -5,7 +5,7 @@ * Fix --disable-avahi to actually disable it in configure, as opposed to just making the warning non-fatal. * Sending custom smileys in MSN chats is now supported. - * Fix using GNOME proxy settings properly. + * Fix using GNOME proxy settings properly. (Erik van Pienbroek) XMPP: * Prompt the user before cancelling a presence subscription. @@ -13,10 +13,14 @@ * Fix connecting to XMPP domains with no SRV records from Pidgin on Windows. * Fix typing notifications with Pidgin 2.5.9 or earlier. + * Fix connecting using BOSH and legacy authentication (XEP-0078). Finch: * Properly detect libpanel on OpenBSD. (Brad Smith) + Pidgin: + * Fix the auto-personize functionality in the Buddy List. + version 2.6.1 (08/18/2009): * Fix a crash when some users send you a link in a Yahoo IM * Fix compilation with GTK+ < 2.6.0 diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/account.c --- a/libpurple/account.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/account.c Thu Aug 27 18:46:55 2009 +0000 @@ -1206,11 +1206,14 @@ purple_account_disconnect(PurpleAccount *account) { PurpleConnection *gc; + const char *username; g_return_if_fail(account != NULL); g_return_if_fail(!purple_account_is_disconnected(account)); - purple_debug_info("account", "Disconnecting account %p\n", account); + username = purple_account_get_username(account); + purple_debug_info("account", "Disconnecting account %s (%p)\n", + username ? username : "(null)", account); account->disconnecting = TRUE; diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/media.c --- a/libpurple/media.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/media.c Thu Aug 27 18:46:55 2009 +0000 @@ -2134,7 +2134,7 @@ GstElement *lastElement = NULL; while (!GST_IS_PIPELINE(element)) { if (element == media->priv->confbin) { - purple_media_error("media", _("Conference error.")); + purple_media_error(media, _("Conference error.")); purple_media_end(media, NULL, NULL); break; } diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/plugin.c diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/jabber/auth.c --- a/libpurple/protocols/jabber/auth.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/jabber/auth.c Thu Aug 27 18:46:55 2009 +0000 @@ -575,6 +575,7 @@ xmlnode *packet, gpointer data) { if (type == JABBER_IQ_RESULT) { + jabber_stream_set_state(js, JABBER_STREAM_POST_AUTH); jabber_disco_items_server(js); } else { PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; @@ -1072,7 +1073,12 @@ } #endif - jabber_stream_set_state(js, JABBER_STREAM_REINITIALIZING); + /* + * The stream will be reinitialized later in jabber_recv_cb_ssl() or + * jabber_bosh_connection_send. + */ + js->reinit = TRUE; + jabber_stream_set_state(js, JABBER_STREAM_POST_AUTH); } void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet) diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/jabber/bosh.c --- a/libpurple/protocols/jabber/bosh.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/jabber/bosh.c Thu Aug 27 18:46:55 2009 +0000 @@ -70,7 +70,6 @@ gboolean pipelining; gboolean ssl; - gboolean needs_restart; enum { BOSH_CONN_OFFLINE, @@ -197,7 +196,6 @@ conn->path = g_strdup_printf("/%s", path); g_free(path); conn->pipelining = TRUE; - conn->needs_restart = FALSE; if ((user && user[0] != '\0') || (passwd && passwd[0] != '\0')) { purple_debug_info("jabber", "Ignoring unexpected username and password " @@ -377,10 +375,10 @@ conn->sid, conn->js->user->domain); - if (conn->needs_restart) { + if (conn->js->reinit) { packet = g_string_append(packet, " xmpp:restart='true'/>"); /* TODO: Do we need to wait for a response? */ - conn->needs_restart = FALSE; + conn->js->reinit = FALSE; } else { gsize read_amt; if (type == PACKET_TERMINATE) @@ -406,12 +404,6 @@ jabber_bosh_connection_send(conn, PACKET_TERMINATE, NULL); } -static void jabber_bosh_connection_stream_restart(PurpleBOSHConnection *conn) -{ - conn->needs_restart = TRUE; - jabber_bosh_connection_send(conn, PACKET_NORMAL, NULL); -} - static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node) { const char *type; @@ -490,35 +482,8 @@ } } -static void auth_response_cb(PurpleBOSHConnection *conn, xmlnode *node) { - xmlnode *child; - - g_return_if_fail(node != NULL); - if (jabber_bosh_connection_error_check(conn, node)) - return; - - child = node->child; - while(child != NULL && child->type != XMLNODE_TYPE_TAG) { - child = child->next; - } - - /* We're only expecting one XML node here, so only process the first one */ - if (child != NULL && child->type == XMLNODE_TYPE_TAG) { - JabberStream *js = conn->js; - if (!strcmp(child->name, "success")) { - jabber_bosh_connection_stream_restart(conn); - jabber_process_packet(js, &child); - conn->receive_cb = jabber_bosh_connection_received; - } else { - js->state = JABBER_STREAM_AUTHENTICATING; - jabber_process_packet(js, &child); - } - } else { - purple_debug_warning("jabber", "Received unexepcted empty BOSH packet.\n"); - } -} - static void boot_response_cb(PurpleBOSHConnection *conn, xmlnode *node) { + JabberStream *js = conn->js; const char *sid, *version; const char *inactivity, *requests; xmlnode *packet; @@ -536,7 +501,7 @@ if (sid) { conn->sid = g_strdup(sid); } else { - purple_connection_error_reason(conn->js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("No session ID given")); return; @@ -553,7 +518,7 @@ minor = atoi(dot + 1); if (major != 1 || minor < 6) { - purple_connection_error_reason(conn->js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unsupported version of BOSH protocol")); return; @@ -583,11 +548,13 @@ if (requests) conn->max_requests = atoi(requests); + jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); + /* FIXME: Depending on receiving features might break with some hosts */ packet = xmlnode_get_child(node, "features"); conn->state = BOSH_CONN_ONLINE; - conn->receive_cb = auth_response_cb; - jabber_stream_features_parse(conn->js, packet); + conn->receive_cb = jabber_bosh_connection_received; + jabber_stream_features_parse(js, packet); } static void jabber_bosh_connection_boot(PurpleBOSHConnection *conn) { @@ -663,8 +630,8 @@ conn->headers_done = FALSE; conn->handled_len = conn->body_len = 0; - if (conn->bosh->needs_restart) - jabber_bosh_connection_stream_restart(conn->bosh); + if (conn->bosh->js->reinit) + jabber_bosh_connection_send(conn->bosh, PACKET_NORMAL, NULL); else if (conn->bosh->state == BOSH_CONN_ONLINE) { purple_debug_info("jabber", "BOSH session already exists. Trying to reuse it.\n"); if (conn->bosh->requests == 0 || conn->bosh->pending->bufused > 0) { diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/jabber/google.c --- a/libpurple/protocols/jabber/google.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/jabber/google.c Thu Aug 27 18:46:55 2009 +0000 @@ -296,6 +296,9 @@ gchar *sid, gchar *name, gboolean local, GoogleSession *session) { + if (sid != NULL || name != NULL) + return; + if (type == PURPLE_MEDIA_INFO_HANGUP) { xmlnode *sess; JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET); @@ -314,6 +317,8 @@ xmlnode_insert_child(iq->node, sess); jabber_iq_send(iq); + } else if (type == PURPLE_MEDIA_INFO_ACCEPT && local == TRUE) { + google_session_ready(session); } } diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Thu Aug 27 18:46:55 2009 +0000 @@ -1605,13 +1605,10 @@ jabber_auth_start_old(js); } break; - case JABBER_STREAM_REINITIALIZING: + case JABBER_STREAM_POST_AUTH: purple_connection_update_progress(js->gc, _("Re-initializing Stream"), (js->gsc ? 8 : 4), JABBER_CONNECT_STEPS); - /* The stream will be reinitialized later, in jabber_recv_cb_ssl() */ - js->reinit = TRUE; - break; case JABBER_STREAM_CONNECTED: /* Send initial presence */ diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/jabber/jabber.h --- a/libpurple/protocols/jabber/jabber.h Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.h Thu Aug 27 18:46:55 2009 +0000 @@ -87,7 +87,7 @@ JABBER_STREAM_INITIALIZING, JABBER_STREAM_INITIALIZING_ENCRYPTION, JABBER_STREAM_AUTHENTICATING, - JABBER_STREAM_REINITIALIZING, + JABBER_STREAM_POST_AUTH, JABBER_STREAM_CONNECTED } JabberStreamState; diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.c Thu Aug 27 18:46:55 2009 +0000 @@ -2405,6 +2405,21 @@ if (purple_markup_find_tag("body", tmp, &start, &end, &attribs)) { const char *ichattextcolor, *ichatballooncolor; + const char *start2, *end2; + GData *unused; + + /* + * Find the ending so we can strip off the outer + * and + */ + if (purple_markup_find_tag("/body", end + 1, &start2, &end2, &unused)) + { + gchar *tmp2; + tmp2 = g_strndup(end + 1, (start2 - 1) - (end + 1) + 1); + g_free(tmp); + tmp = tmp2; + g_datalist_clear(&unused); + } ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor"); if (ichattextcolor != NULL) diff -r 7763697a85c8 -r 1da2ea10c2d0 libpurple/protocols/yahoo/libymsg.c --- a/libpurple/protocols/yahoo/libymsg.c Mon Aug 24 19:21:21 2009 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Thu Aug 27 18:46:55 2009 +0000 @@ -4425,7 +4425,7 @@ else yahoo_packet_hash(pkt, "ssssss", 49, "TYPING", 1, purple_connection_get_display_name(gc), 14, " ", 13, state == PURPLE_TYPING ? "1" : "0", - 5, who+4, 1002, "1"); + 5, who, 1002, "1"); yahoo_packet_send_and_free(pkt, yd); } @@ -4774,6 +4774,7 @@ void yahoo_add_deny(PurpleConnection *gc, const char *who) { YahooData *yd = (YahooData *)gc->proto_data; struct yahoo_packet *pkt; + gboolean msn = FALSE; if (!yd->logged_in) return; @@ -4781,15 +4782,21 @@ if (!who || who[0] == '\0') return; + msn = !g_ascii_strncasecmp(who, "msn/", 4); pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id); - yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), - 7, who, 13, "1"); + + if(msn) + yahoo_packet_hash(pkt, "ssss", 1, purple_connection_get_display_name(gc), 7, who+4, 241, "2", 13, "1"); + else + yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "1"); + yahoo_packet_send_and_free(pkt, yd); } void yahoo_rem_deny(PurpleConnection *gc, const char *who) { YahooData *yd = (YahooData *)gc->proto_data; struct yahoo_packet *pkt; + gboolean msn = FALSE; if (!yd->logged_in) return; @@ -4797,8 +4804,14 @@ if (!who || who[0] == '\0') return; + msn = !g_ascii_strncasecmp(who, "msn/", 4); pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id); - yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "2"); + + if(msn) + yahoo_packet_hash(pkt, "ssss", 1, purple_connection_get_display_name(gc), 7, who+4, 241, "2", 13, "2"); + else + yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "2"); + yahoo_packet_send_and_free(pkt, yd); } diff -r 7763697a85c8 -r 1da2ea10c2d0 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Mon Aug 24 19:21:21 2009 +0000 +++ b/pidgin/gtkblist.c Thu Aug 27 18:46:55 2009 +0000 @@ -501,10 +501,12 @@ type = purple_blist_node_get_type(node); - if(type == PURPLE_BLIST_BUDDY_NODE) + if (type == PURPLE_BLIST_BUDDY_NODE) { node = purple_blist_node_get_parent(node); - - if(type == PURPLE_BLIST_CONTACT_NODE) + type = purple_blist_node_get_type(node); + } + + if (type != PURPLE_BLIST_CONTACT_NODE) continue; for (b = purple_blist_node_get_first_child(node); diff -r 7763697a85c8 -r 1da2ea10c2d0 pidgin/gtkdialogs.c --- a/pidgin/gtkdialogs.c Mon Aug 24 19:21:21 2009 +0000 +++ b/pidgin/gtkdialogs.c Thu Aug 27 18:46:55 2009 +0000 @@ -476,9 +476,11 @@ " " "mailing list, and messages sent here are" " publicly" - " archived! Furthermore, we do not support" - " MXit, Facebook, Skype, or any other third-party plugins on" - " this list.)

")); + " archived! Please note that this list's primary language" + " is English. Posts in other languages may not receive answers" + " as complete or as helpful as those in English. Additionally," + " we do not support MXit, Facebook, Skype," + " or any other third-party plugins on this list.)

")); g_string_append_printf(str, _("IRC Channel: " "#pidgin on irc.freenode.net

")); g_string_append_printf(str, _("XMPP MUC: " diff -r 7763697a85c8 -r 1da2ea10c2d0 pidgin/gtkmedia.c --- a/pidgin/gtkmedia.c Mon Aug 24 19:21:21 2009 +0000 +++ b/pidgin/gtkmedia.c Thu Aug 27 18:46:55 2009 +0000 @@ -499,13 +499,14 @@ } gtkmedia->priv->request_type = PURPLE_MEDIA_NONE; - - purple_request_accept_cancel(gtkmedia, _("Incoming Call"), - message, NULL, PURPLE_DEFAULT_ACTION_NONE, - (void*)account, gtkmedia->priv->screenname, NULL, - gtkmedia->priv->media, - pidgin_media_accept_cb, - pidgin_media_reject_cb); + if (!purple_media_accepted(gtkmedia->priv->media, NULL, NULL)) { + purple_request_accept_cancel(gtkmedia, _("Incoming Call"), + message, NULL, PURPLE_DEFAULT_ACTION_NONE, + (void*)account, gtkmedia->priv->screenname, + NULL, gtkmedia->priv->media, + pidgin_media_accept_cb, + pidgin_media_reject_cb); + } pidgin_media_emit_message(gtkmedia, message); g_free(message); return FALSE; @@ -772,6 +773,8 @@ pidgin_media_emit_message(gtkmedia, _("You have rejected the call.")); } else if (type == PURPLE_MEDIA_INFO_ACCEPT) { + if (local == TRUE) + purple_request_close_with_handle(gtkmedia); pidgin_media_set_state(gtkmedia, PIDGIN_MEDIA_ACCEPTED); pidgin_media_emit_message(gtkmedia, _("Call in progress.")); gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar), diff -r 7763697a85c8 -r 1da2ea10c2d0 pidgin/win32/nsis/pidgin-installer.nsi --- a/pidgin/win32/nsis/pidgin-installer.nsi Mon Aug 24 19:21:21 2009 +0000 +++ b/pidgin/win32/nsis/pidgin-installer.nsi Thu Aug 27 18:46:55 2009 +0000 @@ -12,6 +12,7 @@ Var ISSILENT Var STARTUP_RUN_KEY Var SPELLCHECK_SEL +Var LANGUAGE_SET ;-------------------------------- ;Configuration @@ -74,7 +75,7 @@ !define PERL_REG_KEY "SOFTWARE\Perl" !define PERL_DLL "perl510.dll" !define GTK_DEFAULT_INSTALL_PATH "$COMMONFILES\GTK\2.0" -!define GTK_RUNTIME_INSTALLER "..\..\..\..\gtk_installer\gtk-runtime*.exe" +!define GTK_RUNTIME_INSTALLER "..\..\..\..\gtk_installer\gtk-runtime-${GTK_INSTALL_VERSION}*.exe" !define ASPELL_REG_KEY "SOFTWARE\Aspell" !define DOWNLOADER_URL "http://pidgin.im/win32/download_redir.php" @@ -1341,10 +1342,12 @@ IfSilent 0 +2 StrCpy $ISSILENT "/NOUI" + StrCpy $LANGUAGE_SET "0" ClearErrors ${GetOptions} "$R3" "/L=" $R1 IfErrors +3 StrCpy $LANGUAGE $R1 + StrCpy $LANGUAGE_SET "1" Goto skip_lang ; Select Language @@ -1407,6 +1410,17 @@ Pop $R0 FunctionEnd +Function .onInstSuccess + ; NSIS doesn't appear to save the language when in Silent Mode, so we do so manually + IfSilent 0 done + + StrCmp $LANGUAGE_SET "0" done + + WriteRegStr "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" $LANGUAGE + + done: +FunctionEnd + Function un.onInit Call un.RunCheck StrCpy $name "Pidgin ${PIDGIN_VERSION}"