cpw.qulogic.msn: 831e8102: Remove MSN's use of a "store name" in fa...

qulogic at pidgin.im qulogic at pidgin.im
Sat Jun 7 04:11:11 EDT 2008


-----------------------------------------------------------------
Revision: 831e8102ea63c0c128495c0ba6c1c7d6dced0454
Ancestor: 5ce013e2cac8a640e99635fd64b7865300cde01e
Author: qulogic at pidgin.im
Date: 2008-06-07T06:39:13
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/831e8102ea63c0c128495c0ba6c1c7d6dced0454

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

ChangeLog: 

Remove MSN's use of a "store name" in favour of the "friendly name" 
since it's really just a duplicate of that data.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/user.c	1a9f6b118c82050ca03100671a9b0f7d72ac2bcc
+++ libpurple/protocols/msn/user.c	1935d7378235c0ef981cc9dcd70f54237df38352
@@ -28,7 +28,7 @@ msn_user_new(MsnUserList *userlist, cons
 /*new a user object*/
 MsnUser *
 msn_user_new(MsnUserList *userlist, const char *passport,
-			 const char *store_name)
+			 const char *friendly_name)
 {
 	MsnUser *user;
 
@@ -37,17 +37,8 @@ msn_user_new(MsnUserList *userlist, cons
 	user->userlist = userlist;
 
 	msn_user_set_passport(user, passport);
-	msn_user_set_store_name(user, store_name);
+	msn_user_set_friendly_name(user, friendly_name);
 
-	/*
-	 * XXX This seems to reset the friendly name from what it should be
-	 *     to the passport when moving users. So, screw it :)
-	 */
-#if 0
-	if (name != NULL)
-		msn_user_set_name(user, name);
-#endif
-
 	return user;
 }
 
@@ -75,7 +66,6 @@ msn_user_destroy(MsnUser *user)
 
 	g_free(user->passport);
 	g_free(user->friendly_name);
-	g_free(user->store_name);
 	g_free(user->uid);
 	g_free(user->phone.home);
 	g_free(user->phone.work);
@@ -199,18 +189,6 @@ void
 }
 
 void
-msn_user_set_store_name(MsnUser *user, const char *name)
-{
-	g_return_if_fail(user != NULL);
-
-	if (name != NULL)
-	{
-		g_free(user->store_name);
-		user->store_name = g_strdup(name);
-	}
-}
-
-void
 msn_user_set_uid(MsnUser *user, const char *uid)
 {
 	g_return_if_fail(user != NULL);
@@ -422,14 +400,6 @@ const char *
 }
 
 const char *
-msn_user_get_store_name(const MsnUser *user)
-{
-	g_return_val_if_fail(user != NULL, NULL);
-
-	return user->store_name;
-}
-
-const char *
 msn_user_get_home_phone(const MsnUser *user)
 {
 	g_return_val_if_fail(user != NULL, NULL);
============================================================
--- libpurple/protocols/msn/user.h	665fdf25d038c37d1685443b7096c6f28897dd67
+++ libpurple/protocols/msn/user.h	b8c757b0e86fcd7f0e3040adcc0e2f8b92789a0c
@@ -60,7 +60,6 @@ struct _MsnUser
 	MsnUserList *userlist;
 
 	char *passport;         /**< The passport account.          */
-	char *store_name;       /**< The name stored in the server. */
 	char *friendly_name;    /**< The friendly name.             */
 
 	char * uid;				/*< User Id							*/
@@ -111,7 +110,7 @@ MsnUser *msn_user_new(MsnUserList *userl
  * @return A new user structure.
  */
 MsnUser *msn_user_new(MsnUserList *userlist, const char *passport,
-					  const char *store_name);
+					  const char *friendly_name);
 
 /**
  * Destroys a user structure.
@@ -171,14 +170,6 @@ void msn_user_set_friendly_name(MsnUser 
 void msn_user_set_friendly_name(MsnUser *user, const char *name);
 
 /**
- * Sets the store name for a user.
- *
- * @param user The user.
- * @param name The store name.
- */
-void msn_user_set_store_name(MsnUser *user, const char *name);
-
-/**
  * Sets the buddy icon for a local user.
  *
  * @param user     The user.
@@ -273,15 +264,6 @@ const char *msn_user_get_friendly_name(c
 const char *msn_user_get_friendly_name(const MsnUser *user);
 
 /**
- * Returns the store name for a user.
- *
- * @param user The user.
- *
- * @return The store name.
- */
-const char *msn_user_get_store_name(const MsnUser *user);
-
-/**
  * Returns the home phone number for a user.
  *
  * @param user The user.
============================================================
--- libpurple/protocols/msn/userlist.c	b4b72fe770e5860534b85482ca68162f266fba51
+++ libpurple/protocols/msn/userlist.c	2539347a1f56e9b68eaa1f908134e66ddfd971b7
@@ -140,18 +140,18 @@ static const char*
 
 #if 0
 static const char*
-get_store_name(MsnUser *user)
+get_friendly_name(MsnUser *user)
 {
-	const char *store_name;
+	const char *friendly_name;
 
 	g_return_val_if_fail(user != NULL, NULL);
 
-	store_name = msn_user_get_store_name(user);
+	friendly_name = msn_user_get_friendly_name(user);
 
-	if (store_name != NULL)
-		store_name = purple_url_encode(store_name);
+	if (friendly_name != NULL)
+		friendly_name = purple_url_encode(friendly_name);
 	else
-		store_name = msn_user_get_passport(user);
+		friendly_name = msn_user_get_passport(user);
 
 	/* this might be a bit of a hack, but it should prevent notification server
 	 * disconnections for people who have buddies with insane friendly names
@@ -161,10 +161,10 @@ get_store_name(MsnUser *user)
 	/* Stu: yeah, that's why it's a bit of a hack, as you pointed out, we're
 	 * probably decoding the incoming store_name wrong, or something. bleh. */
 
-	if (strlen(store_name) > BUDDY_ALIAS_MAXLEN)
-		store_name = msn_user_get_passport(user);
+	if (strlen(friendly_name) > BUDDY_ALIAS_MAXLEN)
+		friendly_name = msn_user_get_passport(user);
 
-	return store_name;
+	return friendly_name;
 }
 #endif
 
@@ -342,7 +342,7 @@ msn_got_lst_user(MsnSession *session, Ms
 	gc = purple_account_get_connection(account);
 
 	passport = msn_user_get_passport(user);
-	store = msn_user_get_store_name(user);
+	store = msn_user_get_friendly_name(user);
 
 	msn_user_set_op(user, list_op);
 
@@ -456,7 +456,7 @@ msn_userlist_find_add_user(MsnUserList *
 		user = msn_user_new(userlist, passport, userName);
 		msn_userlist_add_user(userlist, user);
 	} else {
-		msn_user_set_store_name(user, userName);
+		msn_user_set_friendly_name(user, userName);
 	}
 	return user;
 }
@@ -781,7 +781,7 @@ msn_userlist_add_buddy_to_list(MsnUserLi
 		return;
 	}
 
-	//store_name = (user != NULL) ? get_store_name(user) : who;
+	//friendly_name = (user != NULL) ? get_friendly_name(user) : who;
 
 	//purple_debug_info("MSN Userlist", "store_name = %s\n", store_name);
 


More information about the Commits mailing list