changeset 23471:5a6cf27ead31

Remove MSN's use of a "store name" in favour of the "friendly name" since it's really just a duplicate of that data.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 07 Jun 2008 06:39:13 +0000
parents eb8bd060b987
children 70de4e2246ec
files libpurple/protocols/msn/user.c libpurple/protocols/msn/user.h libpurple/protocols/msn/userlist.c
diffstat 3 files changed, 15 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/user.c	Sat Jun 07 06:21:09 2008 +0000
+++ b/libpurple/protocols/msn/user.c	Sat Jun 07 06:39:13 2008 +0000
@@ -28,7 +28,7 @@
 /*new a user object*/
 MsnUser *
 msn_user_new(MsnUserList *userlist, const char *passport,
-			 const char *store_name)
+			 const char *friendly_name)
 {
 	MsnUser *user;
 
@@ -37,16 +37,7 @@
 	user->userlist = userlist;
 
 	msn_user_set_passport(user, passport);
-	msn_user_set_store_name(user, store_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
+	msn_user_set_friendly_name(user, friendly_name);
 
 	return user;
 }
@@ -75,7 +66,6 @@
 
 	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
-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 *
-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);
--- a/libpurple/protocols/msn/user.h	Sat Jun 07 06:21:09 2008 +0000
+++ b/libpurple/protocols/msn/user.h	Sat Jun 07 06:39:13 2008 +0000
@@ -60,7 +60,6 @@
 	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 @@
  * @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 *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(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.
--- a/libpurple/protocols/msn/userlist.c	Sat Jun 07 06:21:09 2008 +0000
+++ b/libpurple/protocols/msn/userlist.c	Sat Jun 07 06:39:13 2008 +0000
@@ -140,18 +140,18 @@
 
 #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 @@
 	/* 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 @@
 	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 @@
 		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 @@
 		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);