soc.2010.msn-tlc: 7aa5f3db: This are MsnUser functions, move them th...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Wed May 26 16:01:13 EDT 2010


-----------------------------------------------------------------
Revision: 7aa5f3dbbf4aad96cbdba9f432a5d97ad0d9b3a8
Ancestor: 6d2fd5bca8c2fda994d1dfbb04197ab9882d652d
Author: masca at cpw.pidgin.im
Date: 2010-05-15T02:46:38
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/7aa5f3dbbf4aad96cbdba9f432a5d97ad0d9b3a8

Modified files:
        libpurple/protocols/msn/user.c
        libpurple/protocols/msn/user.h
        libpurple/protocols/msn/userlist.c
        libpurple/protocols/msn/userlist.h

ChangeLog: 

This are MsnUser functions, move them there.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/user.c	372584b70c338f697f69a9befb8840dbfa38d9a2
+++ libpurple/protocols/msn/user.c	0d4395b0e92ca16fa015b55d2f758ed63b2bb658
@@ -632,3 +632,29 @@ msn_user_is_capable(MsnUser *user, char 
 
 	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));
+}
+
============================================================
--- libpurple/protocols/msn/user.h	c75bea13e94df4e858b4fe5b3806476a8f195c56
+++ libpurple/protocols/msn/user.h	4721cde95d26a9b19930d675f2930fdda31a222e
@@ -406,7 +406,31 @@ guint msn_user_get_extcaps(const MsnUser
  */
 guint msn_user_get_extcaps(const MsnUser *user);
 
+/**************************************************************************
+ * Utility functions
+ **************************************************************************/
+
+
 /**
+ * Check if the user is part of the group.
+ *
+ * @param user 		The user we are asking group membership.
+ * @param group_id 	The group where the user may be in.
+ * 
+ * @return TRUE if user is part of the group. Otherwise, FALSE.
+ */
+gboolean msn_user_is_in_group(MsnUser *user, const char * group_id);
+
+/**
+ * Check if user is on list.
+ *
+ * @param user 		The user we are asking list membership.
+ * @param list_id 	The list where the user may be in.
+ *
+ * @return TRUE if the user is on the list, else FALSE.
+ */
+gboolean msn_user_is_in_list(MsnUser *user, MsnListId list_id);
+/**
  * Returns the network id for a user.
  *
  * @param user    The user.
============================================================
--- libpurple/protocols/msn/userlist.c	cb78e95f59e8d02141a6b5a3f63af32630c3a548
+++ libpurple/protocols/msn/userlist.c	2618c36e6fd09ac0b2ad29ea6b69c7a94f7863c6
@@ -107,31 +107,6 @@ got_new_entry(PurpleConnection *gc, cons
 }
 
 /**************************************************************************
- * Utility functions
- **************************************************************************/
-
-gboolean
-msn_userlist_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_userlist_user_is_in_list(MsnUser *user, MsnListId list_id)
-{
-	if (user == NULL)
-		return FALSE;
-
-	return (user->list_op & (1 << list_id));
-}
-
-/**************************************************************************
  * Server functions
  **************************************************************************/
 
@@ -503,7 +478,7 @@ msn_userlist_rem_buddy_from_list(MsnUser
 
 	g_return_if_fail(user != NULL);
 
-	if ( !msn_userlist_user_is_in_list(user, list_id)) {
+	if ( !msn_user_is_in_list(user, list_id)) {
 		list = lists[list_id];
 		purple_debug_info("msn", "User %s is not in list %s, not removing.\n", who, list);
 		return;
@@ -569,13 +544,13 @@ msn_userlist_add_buddy(MsnUserList *user
 
 	user = msn_userlist_find_add_user(userlist, who, who);
 
-	if ( msn_userlist_user_is_in_list(user, MSN_LIST_FL) ) {
+	if ( msn_user_is_in_list(user, MSN_LIST_FL) ) {
 
 		purple_debug_info("msn", "User %s already exists\n", who);
 
 		msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL);
 
-		if (msn_userlist_user_is_in_group(user, group_id)) {
+		if (msn_user_is_in_group(user, group_id)) {
 			purple_debug_info("msn", "User %s is already in group %s, returning\n", who, new_group_name);
 			msn_callback_state_free(state);
 			return;
@@ -604,7 +579,7 @@ msn_userlist_add_buddy_to_list(MsnUserLi
 	user = msn_userlist_find_add_user(userlist, who, who);
 
 	/* First we're going to check if it's already there. */
-	if (msn_userlist_user_is_in_list(user, list_id))
+	if (msn_user_is_in_list(user, list_id))
 	{
 		list = lists[list_id];
 		purple_debug_info("msn", "User '%s' is already in list: %s\n", who, list);
============================================================
--- libpurple/protocols/msn/userlist.h	ded1c1fec51cc1e812ad891694efe7f8fcbf5a23
+++ libpurple/protocols/msn/userlist.h	b0c9c1e352331639e2f5c464334524e8b68cfae7
@@ -52,9 +52,6 @@ struct _MsnUserList
 
 };
 
-gboolean msn_userlist_user_is_in_group(MsnUser *user, const char * group_id);
-gboolean msn_userlist_user_is_in_list(MsnUser *user, MsnListId list_id);
-
 void msn_got_lst_user(MsnSession *session, MsnUser *user,
 					  MsnListOp list_op, GSList *group_ids);
 


More information about the Commits mailing list