Mercurial > pidgin
diff libpurple/protocols/msn/user.c @ 30731:02dc01aa8c07
This are MsnUser functions, move them there.
author | masca@cpw.pidgin.im |
---|---|
date | Sat, 15 May 2010 02:46:38 +0000 |
parents | edb7c80bf930 |
children | 0c090a41522c |
line wrap: on
line diff
--- a/libpurple/protocols/msn/user.c Mon May 10 23:21:44 2010 +0000 +++ b/libpurple/protocols/msn/user.c Sat May 15 02:46:38 2010 +0000 @@ -632,3 +632,29 @@ return (user->clientid & capability) && (user->extcaps & extcap); } + +/************************************************************************** + * Utility functions + **************************************************************************/ + +gboolean +msn_user_is_in_group(MsnUser *user, const char * group_id) +{ + if (user == NULL) + return FALSE; + + if (group_id == NULL) + return FALSE; + + return (g_list_find_custom(user->group_ids, group_id, (GCompareFunc)strcmp)) != NULL; +} + +gboolean +msn_user_is_in_list(MsnUser *user, MsnListId list_id) +{ + if (user == NULL) + return FALSE; + + return (user->list_op & (1 << list_id)); +} +