diff libpurple/protocols/msn/userlist.c @ 28978:746bf7d8b34e

Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes MsnUser smaller by the size of one pointer. Since both of these structs are used only rarely, this ends up saving memory for most people.
author Mark Doliner <mark@kingant.net>
date Fri, 05 Feb 2010 02:19:22 +0000
parents 08296b862f98
children 7f97370e674b
line wrap: on
line diff
--- a/libpurple/protocols/msn/userlist.c	Fri Feb 05 01:18:18 2010 +0000
+++ b/libpurple/protocols/msn/userlist.c	Fri Feb 05 02:19:22 2010 +0000
@@ -334,14 +334,10 @@
 
 	for (l = userlist->users; l != NULL; l = l->next) {
 		MsnUser *user = (MsnUser *)l->data;
+		const char *user_number = msn_user_get_mobile_phone(user);
 
-		if (!user->phone || !user->phone->mobile) {
-			continue;
-		}
-
-		if (!g_ascii_strcasecmp(number, user->phone->mobile)) {
+		if (user_number && !g_ascii_strcasecmp(number, user_number))
 			return user;
-		}
 	}
 
 	return NULL;