Mercurial > pidgin
comparison src/list.c @ 4757:c4ebe1a8484b
[gaim-migrate @ 5074]
this fixes a bunch of little things, as well as a few big things, plugs a
few leaks, and makes the new buddy icon cache stuff much cooler. enjoy!
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 14 Mar 2003 01:14:24 +0000 |
parents | 7c1db830f57b |
children | c4c28874ecd3 |
comparison
equal
deleted
inserted
replaced
4756:85637881b342 | 4757:c4ebe1a8484b |
---|---|
162 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; | 162 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; |
163 buddy->evil = warning; | 163 buddy->evil = warning; |
164 if (ops) | 164 if (ops) |
165 ops->update(gaimbuddylist,(GaimBlistNode*)buddy); | 165 ops->update(gaimbuddylist,(GaimBlistNode*)buddy); |
166 } | 166 } |
167 void gaim_blist_update_buddy_icon(struct buddy *buddy) { | |
168 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; | |
169 if(ops) | |
170 ops->update(gaimbuddylist, (GaimBlistNode*)buddy); | |
171 } | |
167 void gaim_blist_rename_buddy (struct buddy *buddy, const char *name) | 172 void gaim_blist_rename_buddy (struct buddy *buddy, const char *name) |
168 { | 173 { |
169 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; | 174 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; |
170 g_free(buddy->name); | 175 g_free(buddy->name); |
171 buddy->name = g_strdup(name); | 176 buddy->name = g_strdup(name); |
351 | 356 |
352 } | 357 } |
353 | 358 |
354 struct buddy *gaim_find_buddy(struct gaim_account *account, const char *name) | 359 struct buddy *gaim_find_buddy(struct gaim_account *account, const char *name) |
355 { | 360 { |
356 GaimBlistNode *group = gaimbuddylist->root; | 361 GaimBlistNode *group; |
357 GaimBlistNode *buddy; | 362 GaimBlistNode *buddy; |
363 char *norm_name = g_strdup(normalize(name)); | |
364 | |
358 if (!gaimbuddylist) | 365 if (!gaimbuddylist) |
359 return NULL; | 366 return NULL; |
367 | |
368 group = gaimbuddylist->root; | |
360 while (group) { | 369 while (group) { |
361 buddy = group->child; | 370 buddy = group->child; |
362 while (buddy) { | 371 while (buddy) { |
363 if (!g_strcasecmp(((struct buddy*)buddy)->name, name) && account == ((struct buddy*)buddy)->account) | 372 if (!g_strcasecmp(normalize(((struct buddy*)buddy)->name), norm_name) && account == ((struct buddy*)buddy)->account) { |
373 g_free(norm_name); | |
364 return (struct buddy*)buddy; | 374 return (struct buddy*)buddy; |
375 } | |
365 buddy = buddy->next; | 376 buddy = buddy->next; |
366 } | 377 } |
367 group = group->next; | 378 group = group->next; |
368 } | 379 } |
380 g_free(norm_name); | |
369 return NULL; | 381 return NULL; |
370 } | 382 } |
371 | 383 |
372 struct group *gaim_find_group(const char *name) | 384 struct group *gaim_find_group(const char *name) |
373 { | 385 { |