# HG changeset patch
# Node ID d3b4457d7e99
# Parent  83144d32517f
diff --git a/libpurple/protocols/bonjour/mdns_common.c b/libpurple/protocols/bonjour/mdns_common.c
--- a/libpurple/protocols/bonjour/mdns_common.c
+++ b/libpurple/protocols/bonjour/mdns_common.c
@@ -251,8 +251,9 @@
 bonjour_dns_sd_set_jid(PurpleAccount *account, const char *hostname)
 {
 	PurpleConnection *conn = purple_account_get_connection(account);
+	PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 	BonjourData *bd = purple_connection_get_protocol_data(conn);
-	const char *tmp, *account_name = purple_account_get_username(account);
+	const char *tmp, *account_name = purple_contact_info_get_username(info);
 
 	/* Previously we allowed the hostname part of the jid to be set
 	 * explicitly when it should always be the current hostname.
diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -238,7 +238,7 @@
 	acct = purple_connection_get_account(gc);
 	grp = fb_get_group(TRUE);
 	grpn = fb_get_group(FALSE);
-	alias = purple_account_get_private_alias(acct);
+	alias = purple_contact_info_get_alias(PURPLE_CONTACT_INFO(acct));
 	state = purple_connection_get_state(gc);
 
 	g_value_init(&val, FB_TYPE_ID);
@@ -251,11 +251,15 @@
 		FB_ID_TO_STR(user->uid, uid);
 
 		if (G_UNLIKELY(user->uid == muid)) {
+			PurpleContactInfo *info = NULL;
+
 			if (G_UNLIKELY(alias != NULL)) {
 				continue;
 			}
 
-			purple_account_set_private_alias(acct, user->name);
+			info = PURPLE_CONTACT_INFO(acct);
+			purple_contact_info_set_alias(info, user->name);
+
 			continue;
 		}
 
@@ -663,7 +667,7 @@
 	}
 
 	if (!active) {
-		name = purple_account_get_username(acct);
+		name = purple_contact_info_get_username(PURPLE_CONTACT_INFO(acct));
 		purple_chat_conversation_add_user(chat, name, NULL, 0, FALSE);
 	}
 
@@ -1104,7 +1108,7 @@
 	                      fata);
 
 	if (!fb_data_load(fata) || !purple_account_get_remember_password(acct)) {
-		user = purple_account_get_username(acct);
+		user = purple_contact_info_get_username(PURPLE_CONTACT_INFO(acct));
 		pass = purple_connection_get_password(gc);
 		fb_api_auth(api, user, pass);
 		return;
@@ -1430,7 +1434,7 @@
 	fb_api_message(api, tid, TRUE, sext);
 	g_free(sext);
 
-	name = purple_account_get_username(acct);
+	name = purple_contact_info_get_username(PURPLE_CONTACT_INFO(acct));
 	purple_serv_got_chat_in(gc, id, name,
 				purple_message_get_flags(msg),
 	                        purple_message_get_contents(msg),
diff --git a/libpurple/protocols/facebook/util.c b/libpurple/protocols/facebook/util.c
--- a/libpurple/protocols/facebook/util.c
+++ b/libpurple/protocols/facebook/util.c
@@ -437,6 +437,7 @@
 	GDateTime *dt = NULL;
 	const gchar *name, *me;
 	PurpleAccount *acct;
+	PurpleContactInfo *info = NULL;
 	PurpleConversation *conv;
 	PurpleConversationManager *manager;
 	PurpleMessage *msg;
@@ -447,6 +448,7 @@
 	}
 
 	acct = purple_connection_get_account(gc);
+	info = PURPLE_CONTACT_INFO(acct);
 	manager = purple_conversation_manager_get_default();
 
 	conv = purple_conversation_manager_find_im(manager, acct, who);
@@ -455,8 +457,8 @@
 		conv = purple_im_conversation_new(acct, who);
 	}
 
-	me = purple_account_get_name_for_display(acct);
-	name = purple_account_get_username(acct);
+	me = purple_contact_info_get_name_for_display(info);
+	name = purple_contact_info_get_username(info);
 	msg = purple_message_new_outgoing(me, name, text, flags);
 
 	dt = g_date_time_new_from_unix_local((gint64)timestamp);
@@ -476,6 +478,7 @@
 	GDateTime *dt = NULL;
 	const gchar *name;
 	PurpleAccount *acct;
+	PurpleContactInfo *info = NULL;
 	PurpleConversation *conv;
 	PurpleConversationManager *manager;
 	PurpleMessage *msg;
@@ -487,12 +490,13 @@
 	}
 
 	acct = purple_connection_get_account(gc);
+	info = PURPLE_CONTACT_INFO(acct);
 	manager = purple_conversation_manager_get_default();
 
 	conv = purple_conversation_manager_find_chat_by_id(manager, acct, id);
 
-	me = purple_account_get_name_for_display(acct);
-	name = purple_account_get_username(acct);
+	me = purple_contact_info_get_name_for_display(info);
+	name = purple_contact_info_get_username(info);
 
 	msg = purple_message_new_outgoing(me, name, text, flags);
 
diff --git a/libpurple/protocols/irc/cmds.c b/libpurple/protocols/irc/cmds.c
--- a/libpurple/protocols/irc/cmds.c
+++ b/libpurple/protocols/irc/cmds.c
@@ -96,6 +96,7 @@
 	gchar *action, *escaped, *dst, **newargs;
 	const gchar *src, *me;
 	gchar *msg;
+	PurpleContactInfo *info = NULL;
 	PurpleConversation *convo;
 	PurpleConversationManager *manager;
 	PurpleMessage *pmsg;
@@ -104,9 +105,11 @@
 		return 0;
 	}
 
+	info = PURPLE_CONTACT_INFO(irc->account);
+	me = purple_contact_info_get_name_for_display(info);
+
 	manager = purple_conversation_manager_get_default();
 	convo = purple_conversation_manager_find(manager, irc->account, target);
-	me = purple_account_get_name_for_display(irc->account);
 
 	msg = g_strdup_printf("/me %s", args[0]);
 
@@ -544,13 +547,14 @@
 
 	if (args[1]) {
 		PurpleMessage *message = NULL;
+		PurpleContactInfo *info = PURPLE_CONTACT_INFO(irc->account);
 		const gchar *me = NULL;
 		const gchar *recipient = NULL;
 
 		gc = purple_account_get_connection(irc->account);
 		irc_cmd_privmsg(irc, cmd, target, args);
 
-		me = purple_account_get_name_for_display(irc->account);
+		me = purple_contact_info_get_name_for_display(info);
 		recipient = purple_connection_get_display_name(gc);
 		message = purple_message_new_outgoing(me, recipient, args[1], 0);
 
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -75,7 +75,7 @@
 		return 0;
 	}
 
-	username = purple_account_get_username(account);
+	username = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
 	server = strchr(username, '@');
 
 	/* +1 to skip '@' */
@@ -529,10 +529,12 @@
 	PurpleConnection *gc;
 	struct irc_conn *irc;
 	char **userparts;
-	const char *username = purple_account_get_username(account);
+	const char *username = NULL;
 	GSocketClient *client;
 	GError *error = NULL;
 
+	username = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
+
 	gc = purple_account_get_connection(account);
 	purple_connection_set_flags(gc, PURPLE_CONNECTION_FLAG_NO_NEWLINES |
 		PURPLE_CONNECTION_FLAG_NO_IMAGES);
diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c
--- a/libpurple/protocols/irc/msgs.c
+++ b/libpurple/protocols/irc/msgs.c
@@ -1533,8 +1533,10 @@
 	sasl_security_properties_t secprops;
 	PurpleAccount *account = irc->account;
 	PurpleConnection *gc = purple_account_get_connection(account);
+	const char *username = NULL;
+	gboolean again = FALSE;
 
-	gboolean again = FALSE;
+	username = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
 
 	/* Set up security properties and options */
 	secprops.min_ssf = 0;
@@ -1571,7 +1573,7 @@
 			return;
 		}
 
-		sasl_setprop(irc->sasl_conn, SASL_AUTH_EXTERNAL, purple_account_get_username(irc->account));
+		sasl_setprop(irc->sasl_conn, SASL_AUTH_EXTERNAL, username);
 		sasl_setprop(irc->sasl_conn, SASL_SEC_PROPS, &secprops);
 
 		ret = sasl_client_start(irc->sasl_conn, irc->sasl_mechs->str, NULL, NULL, NULL, &irc->current_mech);
diff --git a/libpurple/protocols/ircv3/purpleircv3connection.c b/libpurple/protocols/ircv3/purpleircv3connection.c
--- a/libpurple/protocols/ircv3/purpleircv3connection.c
+++ b/libpurple/protocols/ircv3/purpleircv3connection.c
@@ -402,7 +402,7 @@
 	account = purple_connection_get_account(PURPLE_CONNECTION(connection));
 
 	/* Split the username into nick and server and store the values. */
-	username = purple_account_get_username(account);
+	username = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
 	userparts = g_strsplit(username, "@", 2);
 	purple_connection_set_display_name(PURPLE_CONNECTION(connection),
 	                                   userparts[0]);
diff --git a/libpurple/protocols/ircv3/purpleircv3protocol.c b/libpurple/protocols/ircv3/purpleircv3protocol.c
--- a/libpurple/protocols/ircv3/purpleircv3protocol.c
+++ b/libpurple/protocols/ircv3/purpleircv3protocol.c
@@ -99,7 +99,7 @@
 	/* Make sure the username (which includes the servername via usersplits),
 	 * does not contain any whitespace.
 	 */
-	username = purple_account_get_username(account);
+	username = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
 	if(strpbrk(username, " \t\v\r\n") != NULL) {
 		g_set_error(error,
 		            PURPLE_CONNECTION_ERROR,
