Skip to content

Commit

Permalink
Make aimsearch code use GPtrArray instead of owl_list
Browse files Browse the repository at this point in the history
  • Loading branch information
davidben committed Jun 25, 2011
1 parent ecffae6 commit e4524da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 6 additions & 6 deletions aim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,24 +1438,24 @@ static int faimtest_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...)
va_list ap;
const char *address, *SNs;
int num, i;
owl_list list;
GPtrArray *list;

va_start(ap, fr);
address = va_arg(ap, const char *);
num = va_arg(ap, int);
SNs = va_arg(ap, const char *);
va_end(ap);

owl_list_create(&list);
list = g_ptr_array_new();

owl_function_debugmsg("faimtest_parse_searchreply: E-Mail Search Results for %s: ", address);
for (i=0; i<num; i++) {
owl_function_debugmsg(" %s", &SNs[i*(MAXSNLEN+1)]);
owl_list_append_element(&list, (void *)&SNs[i*(MAXSNLEN+1)]);
g_ptr_array_add(list, (void *)&SNs[i*(MAXSNLEN+1)]);
}
owl_function_aimsearch_results(address, &list);
owl_list_cleanup(&list, NULL);
return(1);
owl_function_aimsearch_results(address, list);
g_ptr_array_free(list, true);
return 1;
}

static int faimtest_parse_searcherror(aim_session_t *sess, aim_frame_t *fr, ...)
Expand Down
9 changes: 4 additions & 5 deletions functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -3422,20 +3422,19 @@ void owl_function_zephyr_buddy_check(int notify)
#endif
}

void owl_function_aimsearch_results(const char *email, owl_list *namelist)
void owl_function_aimsearch_results(const char *email, GPtrArray *namelist)
{
owl_fmtext fm;
int i, j;
int i;

owl_fmtext_init_null(&fm);
owl_fmtext_append_normal(&fm, "AIM screennames associated with ");
owl_fmtext_append_normal(&fm, email);
owl_fmtext_append_normal(&fm, ":\n");

j=owl_list_get_size(namelist);
for (i=0; i<j; i++) {
for (i = 0; i < namelist->len; i++) {
owl_fmtext_append_normal(&fm, " ");
owl_fmtext_append_normal(&fm, owl_list_get_element(namelist, i));
owl_fmtext_append_normal(&fm, namelist->pdata[i]);
owl_fmtext_append_normal(&fm, "\n");
}

Expand Down

0 comments on commit e4524da

Please sign in to comment.