diff libpurple/protocols/msn/contact.c @ 23478:31b5a1334e7e

Modifications to the MSN code for some stuff I'll be doing in later commits. * Rename MsnUserType to MsnNetwork, because it's a really a Network ID. Updated the list of networks based on msnpiki. * Updated list of Client capabilities based on ZoRoNaX' blog: http://zoronax.spaces.live.com/blog/cns!4A0B813054895814!156.entry * Save the clientid of contacts.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 15 Jun 2008 08:08:22 +0000
parents 70de4e2246ec
children 711773577380
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Sun Jun 15 06:55:21 2008 +0000
+++ b/libpurple/protocols/msn/contact.c	Sun Jun 15 08:08:22 2008 +0000
@@ -176,23 +176,26 @@
 	return 0;
 }
 
-/*get User Type*/
-static int
-msn_get_user_type(char *type)
+/* get Network */
+/* QuLogic: These names don't really refer to the MsnNetwork,
+ *          but I haven't yet written the code to properly use them.
+ */
+static MsnNetwork
+msn_get_network(char *type)
 {
 	g_return_val_if_fail(type != NULL, 0);
 
 	if (!strcmp(type,"Regular")) {
-		return MSN_USER_TYPE_PASSPORT;
+		return MSN_NETWORK_PASSPORT;
 	}
 	if (!strcmp(type,"Live")) {
-		return MSN_USER_TYPE_PASSPORT;
+		return MSN_NETWORK_PASSPORT;
 	}
 	if (!strcmp(type,"LivePending")) {
-		return MSN_USER_TYPE_PASSPORT;
+		return MSN_NETWORK_PASSPORT;
 	}
 
-	return MSN_USER_TYPE_UNKNOWN;
+	return MSN_NETWORK_UNKNOWN;
 }
 
 /* Create the AddressBook in the server, if we don't have one */
@@ -519,7 +522,7 @@
 		xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds, *messenger_user;
 		xmlnode *annotation;
 		MsnUser *user;
-		MsnUserType usertype;
+		MsnNetwork networkId;
 
 		if (!(contactId = xmlnode_get_child(contactNode,"contactId"))
 				|| !(contactInfo = xmlnode_get_child(contactNode, "contactInfo"))
@@ -560,7 +563,7 @@
 			g_free(is_messenger_user);
 		}
 
-		usertype = msn_get_user_type(type);
+		networkId = msn_get_network(type);
 		passportName = xmlnode_get_child(contactInfo, "passportName");
 		if (passportName == NULL) {
 			xmlnode *emailsNode, *contactEmailNode, *emailNode;
@@ -591,7 +594,7 @@
 				if(msnEnabled && !strcmp(msnEnabled, "true")) {
 					/*Messenger enabled, Get the Passport*/
 					purple_debug_info("MsnAB", "Yahoo User %s\n", passport ? passport : "(null)");
-					usertype = MSN_USER_TYPE_YAHOO;
+					networkId = MSN_NETWORK_YAHOO;
 					g_free(msnEnabled);
 					break;
 				} else {
@@ -630,7 +633,7 @@
 
 		user = msn_userlist_find_add_user(session->userlist, passport, Name);
 		msn_user_set_uid(user, uid);
-		msn_user_set_type(user, usertype);
+		msn_user_set_network(user, networkId);
 		msn_user_set_mobile_phone(user, mobile_number);
 
 		groupIds = xmlnode_get_child(contactInfo, "groupIds");