Mercurial > pidgin.yaz
diff libpurple/protocols/gg/search.c @ 32126:34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
author | tomkiewicz@cpw.pidgin.im |
---|---|
date | Sat, 18 Jun 2011 11:29:11 +0000 |
parents | 95ab863d580f |
children | aee8dcd35262 |
line wrap: on
line diff
--- 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 @@ 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");