comparison src/protocols/oscar/oscar.c @ 10439:911530134bf8

[gaim-migrate @ 11697] sf patch #1086253, from Alex Converse closes sf rfe #991372, from Adam Petaccia "New Buddy Search Results Dialog," used for oscar Also some memleak fixes from me. My bad. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 28 Dec 2004 06:24:32 +0000
parents 046be0a754b6
children 6bf9b17c03a5
comparison
equal deleted inserted replaced
10438:d90ece33e72f 10439:911530134bf8
5195 5195
5196 static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...) 5196 static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...)
5197 { 5197 {
5198 GaimConnection *gc = sess->aux_data; 5198 GaimConnection *gc = sess->aux_data;
5199 gchar *secondary; 5199 gchar *secondary;
5200 GString *text; 5200 gchar **screennames;
5201 int i, num; 5201 int i, num;
5202 va_list ap; 5202 va_list ap;
5203 char *email, *SNs; 5203 char *email, *SNs;
5204 5204
5205 va_start(ap, fr); 5205 va_start(ap, fr);
5206 email = va_arg(ap, char *); 5206 email = va_arg(ap, char *);
5207 num = va_arg(ap, int); 5207 num = va_arg(ap, int);
5208 SNs = va_arg(ap, char *); 5208 SNs = va_arg(ap, char *);
5209 va_end(ap); 5209 va_end(ap);
5210 5210
5211 /* TODO: Need to use ngettext() here */
5211 secondary = g_strdup_printf(_("The following screen names are associated with %s"), email); 5212 secondary = g_strdup_printf(_("The following screen names are associated with %s"), email);
5212 text = g_string_new(""); 5213
5214 screennames = g_malloc((num + 1) * sizeof(gchar *));
5213 for (i = 0; i < num; i++) 5215 for (i = 0; i < num; i++)
5214 g_string_append_printf(text, "%s<br>", &SNs[i * (MAXSNLEN + 1)]); 5216 screennames[i] = g_strdup(&SNs[i * (MAXSNLEN + 1)]);
5215 gaim_notify_formatted(gc, NULL, _("Search Results"), secondary, text->str, NULL, NULL); 5217 screennames[num] = NULL;
5218
5219 gaim_notify_searchresults(gc, NULL, NULL, secondary,
5220 (const char **)screennames, NULL, NULL);
5216 5221
5217 g_free(secondary); 5222 g_free(secondary);
5218 g_string_free(text, TRUE); 5223 g_strfreev(screennames);
5219 5224
5220 return 1; 5225 return 1;
5221 } 5226 }
5222 5227
5223 static int gaim_parse_searcherror(aim_session_t *sess, aim_frame_t *fr, ...) { 5228 static int gaim_parse_searcherror(aim_session_t *sess, aim_frame_t *fr, ...) {