[Pidgin] #2752: libpurple lets you add buddies to blist inside groups that aren't on blist; leads to duplicate groups
Pidgin
trac at pidgin.im
Fri Aug 24 01:49:22 EDT 2007
#2752: libpurple lets you add buddies to blist inside groups that aren't on blist;
leads to duplicate groups
------------------------+---------------------------------------------------
Reporter: jeff | Owner: jeff
Type: defect | Status: assigned
Priority: trivial | Milestone:
Component: libpurple | Version: 2.1.1
Resolution: | Keywords: msimprpl
Pending: 0 |
------------------------+---------------------------------------------------
Changes (by jeff):
* owner: sadrul => jeff
* status: new => assigned
Comment:
{{{
<sadrul> jeff2: do you think 'group->prev != NULL || purplebuddylist->root
== group' instead of 'purple_find_group(group->name);' would work?
<jeff2> sadrul: maybe. i'll try it
<jeff2> sadrul: with some casts it works, but its harder to read. any
reason to prefer it over purple_find_group(group->name) besides
performance?
<sadrul> nope
<sadrul> and I suppose it isn't a frequent enough operation to worry about
the performance here
<jeff2> sadrul, yeah, I think I'll go with purple_find_buddy. less risky
than all that complicated pointer casting and dereferencing - something's
bound to go wrong :) i'll commit the patch
}}}
This works:
{{{
g_return_if_fail(((PurpleBlistNode *)group)->prev
!= NULL ||
purplebuddylist->root ==
(PurpleBlistNode *)group);
}}}
and may be faster, but for now I used purple_find_buddy() instead, for
clarity. If performance when loading large buddy list becomes a problem,
the other assertion could be used instead.
--
Ticket URL: <http://developer.pidgin.im/ticket/2752#comment:7>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list