# HG changeset patch # User Ethan Blanton # Date 1308933846 0 # Node ID 47c604efed32aff87d164e0d771bf4729088f91e # Parent 6e5d46ea82f9a124bae92e85a73562de8f52dc14# Parent ad61eb7068abf838d3af4e26dc12b3c9c1eb24b9 propagate from branch 'im.pidgin.pidgin.2.9.0' (head d3dccc0843de29ce8d5c7e2e017028396dc2b46b) to branch 'im.pidgin.pidgin' (head cfa2120bb1d7c408937f3075c018fb10c1e6eefa) diff -r ad61eb7068ab -r 47c604efed32 ChangeLog --- a/ChangeLog Wed Jun 22 07:16:29 2011 +0000 +++ b/ChangeLog Fri Jun 24 16:44:06 2011 +0000 @@ -1,5 +1,11 @@ Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul +version 2.9.1 (MM/DD/YYYY): + Gadu-Gadu: + * Fixed searching for buddies in public directory. (Tomasz Wasilczyk) + (#5242) + * Better status message handling. (Tomasz Wasilczyk) (#14314) + version 2.9.0 (06/23/2011): Pidgin: * Fix a potential remote denial-of-service bug related to displaying diff -r ad61eb7068ab -r 47c604efed32 ChangeLog.API diff -r ad61eb7068ab -r 47c604efed32 configure.ac --- a/configure.ac Wed Jun 22 07:16:29 2011 +0000 +++ b/configure.ac Fri Jun 24 16:44:06 2011 +0000 @@ -46,8 +46,8 @@ m4_define([purple_lt_current], [9]) m4_define([purple_major_version], [2]) m4_define([purple_minor_version], [9]) -m4_define([purple_micro_version], [0]) -m4_define([purple_version_suffix], []) +m4_define([purple_micro_version], [1]) +m4_define([purple_version_suffix], [devel]) m4_define([purple_version], [purple_major_version.purple_minor_version.purple_micro_version]) m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix])) @@ -56,7 +56,7 @@ m4_define([gnt_major_version], [2]) m4_define([gnt_minor_version], [8]) m4_define([gnt_micro_version], [9]) -m4_define([gnt_version_suffix], []) +m4_define([gnt_version_suffix], [devel]) m4_define([gnt_version], [gnt_major_version.gnt_minor_version.gnt_micro_version]) m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix])) @@ -565,15 +565,12 @@ if test "x$enable_gevolution" = "xyes"; then evo_deps="libebook-1.2 libedata-book-1.2" PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, , [ - AC_MSG_RESULT(yes) enable_gevolution="no" ]) if test "x$enable_gevolution" = "xno"; then evo_deps="libebook-1.0 libedata-book-1.0" PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, [ enable_gevolution="yes" - ], [ - AC_MSG_RESULT(yes) ]) fi if test "x$enable_gevolution" = "xyes"; then diff -r ad61eb7068ab -r 47c604efed32 libpurple/Makefile.am --- a/libpurple/Makefile.am Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/Makefile.am Fri Jun 24 16:44:06 2011 +0000 @@ -156,7 +156,6 @@ theme-manager.h \ upnp.h \ util.h \ - valgrind.h \ value.h \ xmlnode.h \ whiteboard.h diff -r ad61eb7068ab -r 47c604efed32 libpurple/account.c diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/gg/gg.c Fri Jun 24 16:44:06 2011 +0000 @@ -487,15 +487,16 @@ GGPSearchForm *form = user_data; guint32 seq; - g_free(form->offset); - form->offset = g_strdup(form->last_uin); + form->page_number++; ggp_search_remove(info->searches, form->seq); - purple_debug_info("gg", "ggp_callback_show_next(): Removed seq %u", form->seq); + purple_debug_info("gg", "ggp_callback_show_next(): Removed seq %u\n", + form->seq); seq = ggp_search_start(gc, form); ggp_search_add(info->searches, seq, form); - purple_debug_info("gg", "ggp_callback_show_next(): Added seq %u", seq); + purple_debug_info("gg", "ggp_callback_show_next(): Added seq %u\n", + seq); } static void ggp_callback_add_buddy(PurpleConnection *gc, GList *row, gpointer user_data) @@ -526,21 +527,16 @@ form = ggp_search_form_new(GGP_SEARCH_TYPE_FULL); form->user_data = info; - form->lastname = charset_convert( - purple_request_fields_get_string(fields, "lastname"), - "UTF-8", "CP1250"); - form->firstname = charset_convert( - purple_request_fields_get_string(fields, "firstname"), - "UTF-8", "CP1250"); - form->nickname = charset_convert( - purple_request_fields_get_string(fields, "nickname"), - "UTF-8", "CP1250"); - form->city = charset_convert( - purple_request_fields_get_string(fields, "city"), - "UTF-8", "CP1250"); - form->birthyear = charset_convert( - purple_request_fields_get_string(fields, "year"), - "UTF-8", "CP1250"); + form->lastname = g_strdup( + purple_request_fields_get_string(fields, "lastname")); + form->firstname = g_strdup( + purple_request_fields_get_string(fields, "firstname")); + form->nickname = g_strdup( + purple_request_fields_get_string(fields, "nickname")); + form->city = g_strdup( + purple_request_fields_get_string(fields, "city")); + form->birthyear = g_strdup( + purple_request_fields_get_string(fields, "year")); switch (purple_request_fields_get_choice(fields, "gender")) { case 1: @@ -557,11 +553,10 @@ form->active = purple_request_fields_get_bool(fields, "active") ? g_strdup(GG_PUBDIR50_ACTIVE_TRUE) : NULL; - form->offset = g_strdup("0"); - seq = ggp_search_start(gc, form); ggp_search_add(info->searches, seq, form); - purple_debug_info("gg", "ggp_callback_find_buddies(): Added seq %u", seq); + purple_debug_info("gg", "ggp_callback_find_buddies(): Added seq %u\n", + seq); } static void ggp_find_buddies(PurplePluginAction *action) @@ -1076,6 +1071,7 @@ { gchar *from; const char *st; + char *status_msg = NULL; ggp_update_buddy_avatar(gc, uin); @@ -1113,14 +1109,24 @@ break; } - purple_debug_info("gg", "st = %s\n", st); - //msg = charset_convert(descr, "CP1250", "UTF-8"); - if (descr == NULL) { + if (descr != NULL) { + status_msg = g_strdup(descr); + g_strstrip(status_msg); + if (status_msg[0] == '\0') { + g_free(status_msg); + status_msg = NULL; + } + } + + purple_debug_info("gg", "status of %u is %s [%s]\n", uin, st, + status_msg ? status_msg : ""); + if (status_msg == NULL) { purple_prpl_got_user_status(purple_connection_get_account(gc), - from, st, NULL); + from, st, NULL); } else { purple_prpl_got_user_status(purple_connection_get_account(gc), - from, st, "message", descr, NULL); + from, st, "message", status_msg, NULL); + g_free(status_msg); } g_free(from); } @@ -1131,7 +1137,8 @@ GGPInfo *info = form->user_data; ggp_search_remove(info->searches, form->seq); - purple_debug_info("gg", "ggp_sr_close_cb(): Removed seq %u", form->seq); + purple_debug_info("gg", "ggp_sr_close_cb(): Removed seq %u\n", + form->seq); ggp_search_form_destroy(form); } @@ -1246,6 +1253,8 @@ res_count = gg_pubdir50_count(req); res_count = (res_count > PUBDIR_RESULTS_MAX) ? PUBDIR_RESULTS_MAX : res_count; + if (form->page_size == 0) + form->page_size = res_count; results = purple_notify_searchresults_new(); @@ -1255,7 +1264,8 @@ purple_notify_error(gc, NULL, _("Unable to display the search results."), NULL); - ggp_sr_close_cb(form); + if (form->window == NULL) + ggp_sr_close_cb(form); return; } @@ -1297,11 +1307,6 @@ (birth && strncmp(birth, "0", 1)) ? birth : g_strdup("-")); purple_notify_searchresults_row_add(results, row); - - if (i == res_count - 1) { - g_free(form->last_uin); - form->last_uin = ggp_search_get_result(req, i, GG_PUBDIR50_UIN); - } } purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_CONTINUE, @@ -1342,7 +1347,8 @@ seq = gg_pubdir50_seq(req); form = ggp_search_get(info->searches, seq); - purple_debug_info("gg", "ggp_pubdir_reply_handler(): seq %u --> form %p", seq, form); + purple_debug_info("gg", + "ggp_pubdir_reply_handler(): seq %u --> form %p\n", seq, form); /* * this can happen when user will request more results * and close the results window before they arrive. @@ -1355,7 +1361,8 @@ purple_notify_error(gc, NULL, _("No matching users found"), _("There are no users matching your search criteria.")); - ggp_sr_close_cb(form); + if (form->window == NULL) + ggp_sr_close_cb(form); return; } @@ -1914,6 +1921,17 @@ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Connection failed")); break; + case GG_EVENT_MSG: + if (ev->event.msg.sender == 0) + /* system messages are mostly ads */ + purple_debug_info("gg", "System message:\n%s\n", + ev->event.msg.message); + else + purple_debug_warning("gg", "GG_EVENT_MSG: message from user %u " + "unexpected while connecting:\n%s\n", + ev->event.msg.sender, + ev->event.msg.message); + break; default: purple_debug_error("gg", "strange event: %d\n", ev->type); break; @@ -1938,23 +1956,18 @@ char *text; char *tmp; - status = purple_presence_get_active_status(purple_buddy_get_presence(b)); - + status = purple_presence_get_active_status( + purple_buddy_get_presence(b)); msg = purple_status_get_attr_string(status, "message"); - if (msg != NULL) { - tmp = purple_markup_strip_html(msg); - text = g_markup_escape_text(tmp, -1); - g_free(tmp); - - return text; - } else { - tmp = purple_utf8_salvage(purple_status_get_name(status)); - text = g_markup_escape_text(tmp, -1); - g_free(tmp); - - return text; - } + if (msg == NULL) + return NULL; + + tmp = purple_markup_strip_html(msg); + text = g_markup_escape_text(tmp, -1); + g_free(tmp); + + return text; } static void ggp_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) @@ -2371,8 +2384,6 @@ form->user_data = info; form->uin = g_strdup(name); - form->offset = g_strdup("0"); - form->last_uin = g_strdup("0"); seq = ggp_search_start(gc, form); ggp_search_add(info->searches, seq, form); diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/gg/lib/libgadu.h --- a/libpurple/protocols/gg/lib/libgadu.h Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/gg/lib/libgadu.h Fri Jun 24 16:44:06 2011 +0000 @@ -1442,6 +1442,7 @@ int gg_file_hash_sha1(int fd, uint8_t *result) GG_DEPRECATED; +#undef printf #ifdef __GNUC__ char *gg_saprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))) GG_DEPRECATED; #else diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/gg/lib/resolver.c --- a/libpurple/protocols/gg/lib/resolver.c Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/gg/lib/resolver.c Fri Jun 24 16:44:06 2011 +0000 @@ -249,6 +249,7 @@ #endif /* GG_CONFIG_HAVE_GETHOSTBYNAME_R */ } +#if defined(GG_CONFIG_HAVE_PTHREAD) || !defined(_WIN32) /** * \internal Rozwiązuje nazwę i zapisuje wynik do podanego desktyptora. * @@ -286,6 +287,7 @@ return res; } +#endif /** * \internal Odpowiednik \c gethostbyname zapewniający współbieżność. diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/gg/search.c --- a/libpurple/protocols/gg/search.c Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/gg/search.c Fri Jun 24 16:44:06 2011 +0000 @@ -38,6 +38,8 @@ form->window = NULL; form->user_data = NULL; form->seq = 0; + form->page_number = 0; + form->page_size = 0; form->uin = NULL; form->lastname = NULL; @@ -47,8 +49,6 @@ form->birthyear = NULL; form->gender = NULL; form->active = NULL; - form->offset = NULL; - form->last_uin = NULL; return form; } @@ -62,6 +62,8 @@ form->window = NULL; form->user_data = NULL; form->seq = 0; + form->page_number = 0; + form->page_size = 0; g_free(form->uin); g_free(form->lastname); @@ -71,8 +73,6 @@ g_free(form->birthyear); g_free(form->gender); g_free(form->active); - g_free(form->offset); - g_free(form->last_uin); g_free(form); } /* }}} */ @@ -137,7 +137,7 @@ { GGPInfo *info = gc->proto_data; gg_pubdir50_t req; - guint seq; + guint seq, offset; purple_debug_info("gg", "It's time to perform a search...\n"); @@ -187,8 +187,10 @@ } } - purple_debug_info("gg", "offset: %s\n", form->offset); - gg_pubdir50_add(req, GG_PUBDIR50_START, g_strdup(form->offset)); + offset = form->page_size * form->page_number; + purple_debug_info("gg", "page number: %u, page size: %u, offset: %u\n", + form->page_number, form->page_size, offset); + gg_pubdir50_add(req, GG_PUBDIR50_START, g_strdup_printf("%u", offset)); if ((seq = gg_pubdir50(info->session, req)) == 0) { purple_debug_warning("gg", "ggp_bmenu_show_details: Search failed.\n"); diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/gg/search.h --- a/libpurple/protocols/gg/search.h Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/gg/search.h Fri Jun 24 16:44:06 2011 +0000 @@ -46,12 +46,11 @@ char *birthyear; char *gender; char *active; - char *offset; - - char *last_uin; GGPSearchType search_type; guint32 seq; + guint16 page_number; + guint16 page_size; /* how many contacts fits into one page of results */ void *user_data; void *window; diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/mxit/profile.c --- a/libpurple/protocols/mxit/profile.c Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/mxit/profile.c Fri Jun 24 16:44:06 2011 +0000 @@ -322,9 +322,9 @@ purple_notify_searchresults_button_add( results, PURPLE_NOTIFY_BUTTON_INVITE, mxit_search_results_add_cb ); if ( searchType == CP_SUGGEST_FRIENDS ) - text = g_strdup_printf( _( "You have %i suggested friends." ), maxResults ); + text = g_strdup_printf( dngettext( PACKAGE, "You have %i suggested friend.", "You have %i suggested friends.", maxResults ), maxResults ); else - text = g_strdup_printf( _( "We found %i contacts that match your search." ), maxResults ); + text = g_strdup_printf( dngettext( PACKAGE, "We found %i contact that matches your search.", "We found %i contacts that match your search.", maxResults ), maxResults ); purple_notify_searchresults( session->con, NULL, text, NULL, results, NULL, NULL ); diff -r ad61eb7068ab -r 47c604efed32 libpurple/protocols/yahoo/libymsg.c --- a/libpurple/protocols/yahoo/libymsg.c Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Fri Jun 24 16:44:06 2011 +0000 @@ -3567,11 +3567,10 @@ status_id = purple_status_get_id(status); msg = purple_status_get_attr_string(status, "message"); - if (!strcmp(status_id, YAHOO_STATUS_TYPE_AVAILABLE)) { - if ((msg != NULL) && (*msg != '\0')) - return YAHOO_STATUS_CUSTOM; - else - return YAHOO_STATUS_AVAILABLE; + if ((msg != NULL) && (*msg != '\0')) { + return YAHOO_STATUS_CUSTOM; + } else if (!strcmp(status_id, YAHOO_STATUS_TYPE_AVAILABLE)) { + return YAHOO_STATUS_AVAILABLE; } else if (!strcmp(status_id, YAHOO_STATUS_TYPE_BRB)) { return YAHOO_STATUS_BRB; } else if (!strcmp(status_id, YAHOO_STATUS_TYPE_BUSY)) { @@ -4849,6 +4848,11 @@ if (idle) yahoo_packet_hash_str(pkt, 47, "2"); + else if (yd->current_status == YAHOO_STATUS_CUSTOM && + !purple_status_is_available(status)) + /* We are still unavailable in this case. + * Make sure Yahoo knows that */ + yahoo_packet_hash_str(pkt, 47, "1"); yahoo_packet_send_and_free(pkt, yd); @@ -4876,7 +4880,10 @@ type = purple_status_type_new(PURPLE_STATUS_AWAY, YAHOO_STATUS_TYPE_BRB, _("Be Right Back"), TRUE); types = g_list_append(types, type); - type = purple_status_type_new(PURPLE_STATUS_UNAVAILABLE, YAHOO_STATUS_TYPE_BUSY, _("Busy"), TRUE); + type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, YAHOO_STATUS_TYPE_BUSY, + _("Busy"), TRUE, TRUE, FALSE, + "message", _("Message"), + purple_value_new(PURPLE_TYPE_STRING), NULL); types = g_list_append(types, type); type = purple_status_type_new(PURPLE_STATUS_AWAY, YAHOO_STATUS_TYPE_NOTATHOME, _("Not at Home"), TRUE); diff -r ad61eb7068ab -r 47c604efed32 libpurple/tests/Makefile.am --- a/libpurple/tests/Makefile.am Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/tests/Makefile.am Fri Jun 24 16:44:06 2011 +0000 @@ -17,6 +17,7 @@ test_oscar_util.c \ test_yahoo_util.c \ test_util.c \ + test_xmlnode.c \ $(top_builddir)/libpurple/util.h check_libpurple_CFLAGS=\ diff -r ad61eb7068ab -r 47c604efed32 libpurple/tests/check_libpurple.c --- a/libpurple/tests/check_libpurple.c Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/tests/check_libpurple.c Fri Jun 24 16:44:06 2011 +0000 @@ -91,6 +91,7 @@ srunner_add_suite(sr, oscar_util_suite()); srunner_add_suite(sr, yahoo_util_suite()); srunner_add_suite(sr, util_suite()); + srunner_add_suite(sr, xmlnode_suite()); /* make this a libpurple "ui" */ purple_check_init(); diff -r ad61eb7068ab -r 47c604efed32 libpurple/tests/test_xmlnode.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/tests/test_xmlnode.c Fri Jun 24 16:44:06 2011 +0000 @@ -0,0 +1,34 @@ +#include + +#include "tests.h" +#include "../xmlnode.h" + +/* + * If we really wanted to test the billion laughs attack we would + * need to have more than just 4 ha's. But as long as this shorter + * document fails to parse, the longer one should also fail to parse. + */ +START_TEST(test_xmlnode_billion_laughs_attack) +{ + const char *malicious_xml_doc = " ]>&ha3;"; + + /* Uncomment this line if you want to see the error message given by + the parser for the above XML document */ + /* purple_debug_set_enabled(TRUE); */ + + fail_if(xmlnode_from_str(malicious_xml_doc, -1), + "xmlnode_from_str() returned an XML tree, but we didn't want it to"); +} +END_TEST + +Suite * +xmlnode_suite(void) +{ + Suite *s = suite_create("Utility Functions"); + + TCase *tc = tcase_create("xmlnode"); + tcase_add_test(tc, test_xmlnode_billion_laughs_attack); + suite_add_tcase(s, tc); + + return s; +} diff -r ad61eb7068ab -r 47c604efed32 libpurple/tests/tests.h --- a/libpurple/tests/tests.h Wed Jun 22 07:16:29 2011 +0000 +++ b/libpurple/tests/tests.h Fri Jun 24 16:44:06 2011 +0000 @@ -16,6 +16,7 @@ Suite * oscar_util_suite(void); Suite * yahoo_util_suite(void); Suite * util_suite(void); +Suite * xmlnode_suite(void); /* helper macros */ #define assert_int_equal(expected, actual) { \ diff -r ad61eb7068ab -r 47c604efed32 pidgin/gtkconv.c diff -r ad61eb7068ab -r 47c604efed32 po/ChangeLog --- a/po/ChangeLog Wed Jun 22 07:16:29 2011 +0000 +++ b/po/ChangeLog Fri Jun 24 16:44:06 2011 +0000 @@ -1,5 +1,8 @@ Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul +version 2.9.1 + * German translation updated (Björn Voigt, Jochen Kemnade) + version 2.9.0 * No changes diff -r ad61eb7068ab -r 47c604efed32 po/de.po --- a/po/de.po Wed Jun 22 07:16:29 2011 +0000 +++ b/po/de.po Fri Jun 24 16:44:06 2011 +0000 @@ -11,8 +11,8 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-12 09:37+0200\n" -"PO-Revision-Date: 2011-05-12 09:37+0200\n" +"POT-Creation-Date: 2011-06-21 09:12+0200\n" +"PO-Revision-Date: 2011-06-21 09:11+0200\n" "Last-Translator: Björn Voigt \n" "Language-Team: German \n" "Language: de\n" @@ -6361,13 +6361,16 @@ msgstr "Wo ich wohne" #, c-format -msgid "You have %i suggested friends." -msgstr "Sie haben %i vorgeschlagene(n) Freund(e)." - -#, c-format -msgid "We found %i contacts that match your search." -msgstr "" -"Wir fanden %i Kontakt(e), die Ihrer Suchanfrage entspricht/entsprechen." +msgid "You have %i suggested friend." +msgid_plural "You have %i suggested friends." +msgstr[0] "Sie haben %i vorgeschlagenen Freund." +msgstr[1] "Sie haben %i vorgeschlagene Freunde." + +#, c-format +msgid "We found %i contact that matches your search." +msgid_plural "We found %i contacts that match your search." +msgstr[0] "Wir fanden %i Kontakt, der Ihrer Suchanfrage entspricht." +msgstr[1] "Wir fanden %i Kontakte, die Ihrer Suchanfrage entsprechen." #. we must have lost the connection, so terminate it so that we can reconnect msgid "We have lost the connection to MXit. Please reconnect." @@ -13182,6 +13185,9 @@ msgid "_UDP Port:" msgstr "_UDP-Port:" +msgid "T_CP Port:" +msgstr "T_CP-Port:" + msgid "Use_rname:" msgstr "_Benutzername:"