Hello :)
I am trying to update the Gadu-Gadu protocol in Gaim and I have
encountered on strange behaviour of gaim_blist_add_buddy. After
importing list of buddies from server buddies shows twice in the list,
there is a ordinary buddy entry and also an empty group with name of the
buddy.
Take a look at this screenshot: http://python.org.pl/~kbryd/gaim.png
(__ignored_32 is a real group)
I am pretty sure that the code is correct, however, have a look at
this:
if (!gaim_find_buddy(gc->account, uin)) {
GaimBuddy *b;
GaimGroup *g;
/* Default group if none specified on server */
gchar *group = g_strdup("Gadu-Gadu");
if (strlen(data_tbl[5])) {
gchar **group_tbl = g_strsplit(data_tbl[5], ",", 2);
if (strlen(group_tbl[0])) {
g_free(group);
group = g_strdup(group_tbl[0]);
}
g_strfreev(group_tbl);
}
/* Add Buddy to our userlist */
if (!(g = gaim_find_group(group))) {
gaim_debug(GAIM_DEBUG_MISC, "gg", "group=%s\n", group);
g = gaim_group_new(group);
gaim_blist_add_group(g, NULL);
}
b = gaim_buddy_new(gc->account, uin, show);
gaim_blist_add_buddy(b, NULL, g, NULL);
userlist_size++;
userlist = g_renew(uin_t, userlist, userlist_size);
userlist[userlist_size - 1] =
(uin_t) strtol((char *)uin, (char **)NULL, 10);
g_free(group);
}
This is almost unchanged from what is in the CVS. I have added debug
line to make sure that only 3 unique groups are actually in the buddy
list, and in fact gaim_group_new() is called only three times.
What can be wrong?
Thanks for any clues.
--
karol (at) karolbryd.art.pl ----------------------------------
"Zbyt malo wiem by byc niekompetentnym" http://www.karolbryd.art.pl
---------------------------------------- fotografia przyrodnicza
|