# HG changeset patch # User Christian Hammond # Date 1070179679 0 # Node ID 109a917692c14de6f461e68a0063fd156f35c2f0 # Parent 90ed8fcca27ce818e4992423ebb8cfdc8424007a [gaim-migrate @ 8313] I noticed that gaim_find_contact() was never actually implemented, so I wrote this implementation. Nathan, this may not be want is wanted, but you're very much idle right now, so feel free to rewrite it :) I just needed something that worked for now. committer: Tailor Script diff -r 90ed8fcca27c -r 109a917692c1 src/blist.c --- a/src/blist.c Sun Nov 30 06:55:09 2003 +0000 +++ b/src/blist.c Sun Nov 30 08:07:59 2003 +0000 @@ -1305,6 +1305,38 @@ return NULL; } +GaimContact * +gaim_find_contact(GaimGroup *group, const char *name) +{ + GaimBlistNode *node; + + g_return_val_if_fail(gaim_get_blist() != NULL, NULL); + g_return_val_if_fail(name != NULL, NULL); + + for (node = ((GaimBlistNode *)group)->child; + node != NULL; + node = node->next) + { + GaimContact *contact; + GaimBuddy *buddy; + + if (!GAIM_BLIST_NODE_IS_CONTACT(node)) + continue; + + contact = (GaimContact *)node; + + if (contact->alias != NULL && !strcmp(contact->alias, name)) + return contact; + + buddy = gaim_contact_get_priority_buddy(contact); + + if (!strcmp(gaim_get_buddy_alias(buddy), name)) + return contact; + } + + return NULL; +} + GaimChat * gaim_blist_find_chat(GaimAccount *account, const char *name) {