soc.2010.msn-tlc: 101ed1ac: Move an user utility function to User.
masca at cpw.pidgin.im
masca at cpw.pidgin.im
Mon Jun 21 03:16:32 EDT 2010
-----------------------------------------------------------------
Revision: 101ed1ac46085f1d8d934856a4b9ec067bfc4d1f
Ancestor: fdfc53d0d7a8b438aaaebf37dfeca7c4a707c7b6
Author: masca at cpw.pidgin.im
Date: 2010-06-19T23:23:23
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/101ed1ac46085f1d8d934856a4b9ec067bfc4d1f
Modified files:
libpurple/protocols/msn/switchboard.c
libpurple/protocols/msn/user.c
libpurple/protocols/msn/user.h
ChangeLog:
Move an user utility function to User.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/switchboard.c 8ad481edc0764d93482bf8476e7a532e2801f04a
+++ libpurple/protocols/msn/switchboard.c f8d24ebdb05de1f8c625d58008ba42066789b68f
@@ -228,16 +228,6 @@ send_clientcaps(MsnSwitchBoard *swboard)
msn_message_destroy(msg);
}
-static int
-user_passport_cmp(MsnUser *user, const char *passport)
-{
- const char *pass;
-
- pass = msn_user_get_passport(user);
-
- return strcmp(pass, passport);
-}
-
static void
msn_switchboard_add_user(MsnSwitchBoard *swboard, const char *user)
{
@@ -264,7 +254,7 @@ msn_switchboard_add_user(MsnSwitchBoard
msnuser = msn_userlist_find_user(userlist, passport);
/* Don't add multiple endpoints to the conversation. */
- if (g_list_find_custom(swboard->users, passport, (GCompareFunc)user_passport_cmp)) {
+ if (g_list_find_custom(swboard->users, passport, (GCompareFunc)msn_user_passport_cmp)) {
g_free(passport);
return;
}
============================================================
--- libpurple/protocols/msn/user.c f515b669298979dd6e4b7144e16cf8d8e0dd9c7d
+++ libpurple/protocols/msn/user.c c31a75fe7315debe3decb250c50f97ff6ee73d45
@@ -666,6 +666,16 @@ msn_user_is_capable(MsnUser *user, char
* Utility functions
**************************************************************************/
+int
+msn_user_passport_cmp(MsnUser *user, const char *passport)
+{
+ const char *pass;
+
+ pass = msn_user_get_passport(user);
+
+ return strcmp(pass, passport);
+}
+
gboolean
msn_user_is_in_group(MsnUser *user, const char * group_id)
{
============================================================
--- libpurple/protocols/msn/user.h 17a1865ace22c7016f29403d76c37cdf62805a13
+++ libpurple/protocols/msn/user.h d4606d7f51ee3335283d70bb7e23a771ac86f35a
@@ -490,6 +490,18 @@ void msn_user_unset_op(MsnUser *user, Ms
void msn_user_unset_op(MsnUser *user, MsnListOp list_op);
/**
+ * Compare the given passport with the one of the user
+ *
+ * @param user User to compare.
+ * @oaran passport Passport to compare.
+ *
+ * @return Zero if the passport match with the one of the user, otherwise
+ * a positive integer if the user passport is greather than the one given
+ * and a negative integer if it is less.
+ */
+int msn_user_passport_cmp(MsnUser *user, const char *passport);
+
+/**
* Checks whether a user is capable of some task.
*
* @param user The user.
More information about the Commits
mailing list