diff src/protocols/msn/user.c @ 5363:ebebc833cf77

[gaim-migrate @ 5739] You can now set your home, work, and mobile phone numbers. Trust me, I'm going somewhere with all this. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 13 May 2003 08:03:27 +0000
parents d5690ed70085
children ad9887c91a59
line wrap: on
line diff
--- a/src/protocols/msn/user.c	Tue May 13 04:37:37 2003 +0000
+++ b/src/protocols/msn/user.c	Tue May 13 08:03:27 2003 +0000
@@ -72,11 +72,12 @@
 	if (user->clientinfo != NULL)
 		g_hash_table_destroy(user->clientinfo);
 
-	if (user->passport != NULL)
-		g_free(user->passport);
+	if (user->passport != NULL) g_free(user->passport);
+	if (user->name     != NULL) g_free(user->name);
 
-	if (user->name != NULL)
-		g_free(user->name);
+	if (user->phone.home   != NULL) g_free(user->phone.home);
+	if (user->phone.work   != NULL) g_free(user->phone.work);
+	if (user->phone.mobile != NULL) g_free(user->phone.mobile);
 
 	g_free(user);
 }
@@ -140,6 +141,40 @@
 	user->group_id = id;
 }
 
+void
+msn_user_set_home_phone(MsnUser *user, const char *number)
+{
+	g_return_if_fail(user != NULL);
+
+	if (user->phone.home != NULL)
+		g_free(user->phone.home);
+
+	user->phone.home = (number == NULL ? NULL : g_strdup(number));
+}
+
+void
+msn_user_set_work_phone(MsnUser *user, const char *number)
+{
+	g_return_if_fail(user != NULL);
+
+	if (user->phone.work != NULL)
+		g_free(user->phone.work);
+
+	user->phone.work = (number == NULL ? NULL : g_strdup(number));
+}
+
+void
+msn_user_set_mobile_phone(MsnUser *user, const char *number)
+{
+	g_return_if_fail(user != NULL);
+
+	if (user->phone.mobile != NULL)
+		g_free(user->phone.mobile);
+
+	user->phone.mobile = (number == NULL ? NULL : g_strdup(number));
+}
+
+
 const char *
 msn_user_get_passport(const MsnUser *user)
 {
@@ -164,6 +199,30 @@
 	return user->group_id;
 }
 
+const char *
+msn_user_get_home_phone(const MsnUser *user)
+{
+	g_return_val_if_fail(user != NULL, NULL);
+
+	return user->phone.home;
+}
+
+const char *
+msn_user_get_work_phone(const MsnUser *user)
+{
+	g_return_val_if_fail(user != NULL, NULL);
+
+	return user->phone.work;
+}
+
+const char *
+msn_user_get_mobile_phone(const MsnUser *user)
+{
+	g_return_val_if_fail(user != NULL, NULL);
+
+	return user->phone.mobile;
+}
+
 void
 msn_user_set_client_info(MsnUser *user, GHashTable *info)
 {