pidgin: 57bf8411: Replace guint membership_id[5] with guin...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Feb 3 17:20:26 EST 2010


-----------------------------------------------------------------
Revision: 57bf84117d335fd0bba1edff4c5b3b21e29f6bbc
Ancestor: 8b7637a4e51e07808d86aa9e531bc9e890d53812
Author: markdoliner at pidgin.im
Date: 2010-02-03T22:19:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/57bf84117d335fd0bba1edff4c5b3b21e29f6bbc

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

ChangeLog: 

Replace guint membership_id[5] with guint member_id_on_pending_list in
MsnUser.  We were only using this value for MSN_LIST_PL, so don't
bother storing it for other list types.

Saves the size of 4 pointers per MSN buddy.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c	0ed1e3d3b728dc3e5d9e38657b0d1fc654ac75cb
+++ libpurple/protocols/msn/contact.c	b1c3a8db417970be400ea7fe210907050810ef9f
@@ -406,8 +406,8 @@ msn_parse_each_member(MsnSession *sessio
 	msn_user_set_network(user, nid);
 	msn_user_set_invite_message(user, invite);
 
-	if (member_id) {
-		user->membership_id[list] = atoi(member_id);
+	if (list == MSN_LIST_PL && member_id) {
+		user->member_id_on_pending_list = atoi(member_id);
 	}
 
 	msn_got_lst_user(session, user, 1 << list, NULL);
@@ -1567,11 +1567,11 @@ msn_del_contact_from_list(MsnSession *se
 		if (user && user->networkid != MSN_NETWORK_PASSPORT)
 			member = g_strdup_printf(MSN_MEMBER_MEMBERSHIPID_XML,
 			                         "EmailMember", "Email",
-			                         user->membership_id[MSN_LIST_PL]);
+			                         user->member_id_on_pending_list);
 		else
 			member = g_strdup_printf(MSN_MEMBER_MEMBERSHIPID_XML,
 			                         "PassportMember", "Passport",
-			                         user->membership_id[MSN_LIST_PL]);
+			                         user->member_id_on_pending_list);
 	} else {
 		/* list == MSN_LIST_AL || list == MSN_LIST_BL */
 		partner_scenario = MSN_PS_BLOCK_UNBLOCK;
============================================================
--- libpurple/protocols/msn/user.h	9eeb35d1e130ada46705650bb6f4199d6f68ae17
+++ libpurple/protocols/msn/user.h	26f984ec5358471f7f6c557ef0e9fa1974789b05
@@ -103,8 +103,11 @@ struct _MsnUser
 
 	int list_op;            /**< Which lists the user is in     */
 
-	guint membership_id[5];	/**< The membershipId sent by the contacts server,
-				     indexed by the list it belongs to		*/
+	/**
+	 * The membershipId for this buddy on our pending list.  Sent by
+	 * the contact's server
+	 */
+	guint member_id_on_pending_list;
 
 	char *invite_message;   /**< Invite message of user request */
 };


More information about the Commits mailing list