Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/roster.c @ 29443:d4b9df8e17f6
jabber: Fix another corner case that introduced duplicates to the list.
This occurs when the roster contains either two groups with the exact
same name or a name that differs only by case. The solution: uniquify
the list of groups. Fixes #10950.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Tue, 16 Feb 2010 00:36:25 +0000 |
parents | f7f14706618b |
children | 351d07aefb09 ae615b3d3e47 |
comparison
equal
deleted
inserted
replaced
29442:0b6cfe040cd0 | 29443:d4b9df8e17f6 |
---|---|
257 if (!group_name && !seen_empty) { | 257 if (!group_name && !seen_empty) { |
258 group_name = g_strdup(""); | 258 group_name = g_strdup(""); |
259 seen_empty = TRUE; | 259 seen_empty = TRUE; |
260 } | 260 } |
261 | 261 |
262 groups = g_slist_prepend(groups, group_name); | 262 /* |
263 * See the note in add_purple_buddy_to_groups; the core handles | |
264 * names case-insensitively and this is required to not | |
265 * end up with duplicates if a buddy is in, e.g., | |
266 * 'XMPP' and 'xmpp' | |
267 */ | |
268 if (g_slist_find_custom(groups, group_name, (GCompareFunc)purple_utf8_strcasecmp)) | |
269 g_free(group_name); | |
270 else | |
271 groups = g_slist_prepend(groups, group_name); | |
263 } | 272 } |
264 | 273 |
265 add_purple_buddy_to_groups(js, jid, name, groups); | 274 add_purple_buddy_to_groups(js, jid, name, groups); |
266 if (jb == js->user_jb) | 275 if (jb == js->user_jb) |
267 jabber_presence_fake_to_self(js, NULL); | 276 jabber_presence_fake_to_self(js, NULL); |