--- a/ChangeLog Sat Jun 18 06:59:36 2011 +0000
+++ b/ChangeLog Sat Jun 18 11:29:11 2011 +0000
@@ -11,6 +11,10 @@
* The Evolution Integration plugin compiles again.
+ * Fixed searching for buddies in public directory. (Tomasz Wasilczyk) version 2.8.0 (06/07/2011):
* Implement simple silence suppression for voice calls, preventing
--- a/libpurple/protocols/gg/gg.c Sat Jun 18 06:59:36 2011 +0000
+++ b/libpurple/protocols/gg/gg.c Sat Jun 18 11:29:11 2011 +0000
@@ -487,15 +487,16 @@
GGPSearchForm *form = user_data;
- form->offset = g_strdup(form->last_uin);
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", 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", 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->lastname = charset_convert(
- purple_request_fields_get_string(fields, "lastname"),
- form->firstname = charset_convert(
- purple_request_fields_get_string(fields, "firstname"),
- form->nickname = charset_convert(
- purple_request_fields_get_string(fields, "nickname"),
- form->city = charset_convert(
- purple_request_fields_get_string(fields, "city"),
- form->birthyear = charset_convert(
- purple_request_fields_get_string(fields, "year"),
+ 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")); + 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")) {
@@ -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", static void ggp_find_buddies(PurplePluginAction *action)
@@ -1131,7 +1126,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", ggp_search_form_destroy(form);
@@ -1246,6 +1242,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 +1253,8 @@
purple_notify_error(gc, NULL,
_("Unable to display the search results."),
+ if (form->window == NULL) @@ -1297,11 +1296,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 +1336,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 +1350,8 @@
purple_notify_error(gc, NULL,
_("No matching users found"),
_("There are no users matching your search criteria."));
+ if (form->window == NULL) @@ -2382,8 +2378,6 @@
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);
--- a/libpurple/protocols/gg/search.c Sat Jun 18 06:59:36 2011 +0000
+++ b/libpurple/protocols/gg/search.c Sat Jun 18 11:29:11 2011 +0000
@@ -38,6 +38,8 @@
@@ -47,8 +49,6 @@
@@ -62,6 +62,8 @@
@@ -71,8 +73,6 @@
- g_free(form->last_uin);
@@ -137,7 +137,7 @@
GGPInfo *info = gc->proto_data;
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");