# HG changeset patch
# Node ID 5028c50ffbc1ef1aeab999b974f2080cfbeae2d9
# Parent  5c55680a1a6b5689f7dee66d0aebbb470ac7ffc6
diff --git a/pidgin/gtknotify.c b/pidgin/gtknotify.c
--- a/pidgin/gtknotify.c
+++ b/pidgin/gtknotify.c
@@ -113,7 +113,6 @@
 static void
 pidgin_widget_decorate_account(GtkWidget *cont, PurpleAccount *account)
 {
-	PurpleContactInfo *info = NULL;
 	PurpleProtocol *protocol = NULL;
 	GtkWidget *image;
 	const gchar *icon_name = NULL;
@@ -121,13 +120,12 @@
 	if (!account)
 		return;
 
-	info = PURPLE_CONTACT_INFO(account);
 	protocol = purple_account_get_protocol(account);
 	icon_name = purple_protocol_get_icon_name(protocol);
 
 	image = gtk_image_new_from_icon_name(icon_name);
 
-	gtk_widget_set_tooltip_text(image, purple_contact_info_get_username(info));
+	gtk_widget_set_tooltip_text(image, purple_account_get_username(account));
 
 	if (GTK_IS_BOX(cont)) {
 		gtk_widget_set_halign(image, GTK_ALIGN_START);
@@ -530,7 +528,7 @@
 {
 	char key[256];
 	g_snprintf(key, sizeof(key), "%s - %s",
-	           purple_contact_info_get_username(PURPLE_CONTACT_INFO(account)),
+	           purple_account_get_username(account),
 	           purple_normalize(account, who));
 	return g_utf8_strup(key, -1);
 }
diff --git a/pidgin/pidginaccountdisplay.c b/pidgin/pidginaccountdisplay.c
--- a/pidgin/pidginaccountdisplay.c
+++ b/pidgin/pidginaccountdisplay.c
@@ -61,7 +61,7 @@
 		protocol = purple_account_get_protocol(account);
 		icon_name = purple_protocol_get_icon_name(protocol);
 
-		info = PURPLE_CONTACT_INFO(account);
+		info = purple_account_get_contact_info(account);
 		alias = purple_contact_info_get_alias(info);
 		protocol_name = purple_account_get_protocol_name(account);
 		username = purple_contact_info_get_username(info);
diff --git a/pidgin/pidginaccounteditor.c b/pidgin/pidginaccounteditor.c
--- a/pidgin/pidginaccounteditor.c
+++ b/pidgin/pidginaccounteditor.c
@@ -147,12 +147,10 @@
 
 	/* If we have an account, populate its values. */
 	if(PURPLE_IS_ACCOUNT(editor->account)) {
-		/* The username will be split apart below and eventually set as the text
-		 * in the username entry.
+		/* The username will be split apart below and eventually set as the
+		 * text in the username entry.
 		 */
-		PurpleContactInfo *info = PURPLE_CONTACT_INFO(editor->account);
-
-		username = g_strdup(purple_contact_info_get_username(info));
+		username = g_strdup(purple_account_get_username(editor->account));
 		require_password = purple_account_get_require_password(editor->account);
 
 		if(purple_account_is_connected(editor->account)) {
@@ -257,8 +255,9 @@
 
 	/* Determine our values. */
 	if(editor->account != NULL) {
-		PurpleContactInfo *info = PURPLE_CONTACT_INFO(editor->account);
+		PurpleContactInfo *info = NULL;
 
+		info = purple_account_get_contact_info(editor->account);
 		svalue = purple_contact_info_get_alias(info);
 		use_global = purple_account_get_bool(editor->account,
 		                                     "use-global-buddyicon", TRUE);
@@ -783,9 +782,7 @@
 		editor->account = purple_account_new(username->str, protocol_id);
 		new_account = TRUE;
 	} else {
-		PurpleContactInfo *info = PURPLE_CONTACT_INFO(editor->account);
-
-		purple_contact_info_set_username(info, username->str);
+		purple_account_set_username(editor->account, username->str);
 		purple_account_set_protocol_id(editor->account, protocol_id);
 	}
 
@@ -799,12 +796,14 @@
 
 static void
 pidgin_account_editor_save_user_options(PidginAccountEditor *editor) {
-	PurpleContactInfo *info = PURPLE_CONTACT_INFO(editor->account);
+	PurpleContactInfo *info = NULL;
 	const gchar *svalue = NULL;
 	gboolean bvalue = FALSE;
 
 	purple_account_freeze_notify_settings(editor->account);
 
+	info = purple_account_get_contact_info(editor->account);
+
 	/* Set the alias. */
 	svalue = gtk_editable_get_text(GTK_EDITABLE(editor->alias));
 	if(*svalue == '\0') {
diff --git a/pidgin/pidginaccountmanagerrow.c b/pidgin/pidginaccountmanagerrow.c
--- a/pidgin/pidginaccountmanagerrow.c
+++ b/pidgin/pidginaccountmanagerrow.c
@@ -228,7 +228,7 @@
 	const char *name = NULL;
 	char *protocol_name = NULL;
 
-	info = PURPLE_CONTACT_INFO(row->account);
+	info = purple_account_get_contact_info(row->account);
 	name = purple_contact_info_get_name_for_display(info);
 	protocol_name = pidgin_account_manager_row_protocol_name_cb(NULL,
 	                                                            row->account,
diff --git a/pidgin/pidginaccountsdisabledmenu.c b/pidgin/pidginaccountsdisabledmenu.c
--- a/pidgin/pidginaccountsdisabledmenu.c
+++ b/pidgin/pidginaccountsdisabledmenu.c
@@ -100,7 +100,6 @@
 {
 	PidginAccountsDisabledMenu *menu = NULL;
 	PurpleAccount *account = NULL;
-	PurpleContactInfo *info = NULL;
 	PurpleProtocol *protocol = NULL;
 	GVariant *value = NULL;
 	const gchar *account_name = NULL, *protocol_name = NULL;
@@ -131,8 +130,7 @@
 		return;
 	}
 
-	info = PURPLE_CONTACT_INFO(account);
-	account_name = purple_contact_info_get_username(info);
+	account_name = purple_account_get_username(account);
 	protocol_name = purple_account_get_protocol_name(account);
 
 	/* translators: This format string is intended to contain the account
@@ -147,7 +145,7 @@
 	g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_ACTION,
 	                    g_variant_ref_sink(value));
 
-	value = g_variant_new_printf("%s", purple_contact_info_get_id(info));
+	value = g_variant_new_printf("%s", purple_account_get_id(account));
 	g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_TARGET,
 	                    g_variant_ref_sink(value));
 
diff --git a/pidgin/pidginaccountsenabledmenu.c b/pidgin/pidginaccountsenabledmenu.c
--- a/pidgin/pidginaccountsenabledmenu.c
+++ b/pidgin/pidginaccountsenabledmenu.c
@@ -211,7 +211,7 @@
 		return;
 	}
 
-	account_name = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
+	account_name = purple_account_get_username(account);
 
 	/* Get the protocol from the account. */
 	protocol = purple_account_get_protocol(account);
@@ -261,7 +261,7 @@
 		return;
 	}
 
-	account_id = purple_contact_info_get_id(PURPLE_CONTACT_INFO(account));
+	account_id = purple_account_get_id(account);
 
 	connection = purple_account_get_connection(account);
 	if(PURPLE_IS_CONNECTION(connection)) {
diff --git a/pidgin/pidgincontactinfomenu.c b/pidgin/pidgincontactinfomenu.c
--- a/pidgin/pidgincontactinfomenu.c
+++ b/pidgin/pidgincontactinfomenu.c
@@ -87,7 +87,7 @@
 	const char *account_id = NULL;
 	const char *contact_id = NULL;
 
-	account_id = purple_contact_info_get_id(PURPLE_CONTACT_INFO(account));
+	account_id = purple_account_get_id(account);
 	contact_id = purple_contact_info_get_id(info);
 
 	menu = g_menu_new();
diff --git a/pidgin/pidgindisplaywindow.c b/pidgin/pidgindisplaywindow.c
--- a/pidgin/pidgindisplaywindow.c
+++ b/pidgin/pidgindisplaywindow.c
@@ -522,7 +522,6 @@
 	if(PIDGIN_IS_CONVERSATION(pidgin_conversation)) {
 		PidginDisplayItem *item = NULL;
 		PurpleAccount *account = purple_conversation_get_account(purple_conversation);
-		PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 		const char *account_id = NULL;
 		char *id = NULL;
 		gboolean item_exists = FALSE;
@@ -534,7 +533,7 @@
 			gtk_widget_unparent(pidgin_conversation);
 		}
 
-		account_id = purple_contact_info_get_id(info);
+		account_id = purple_account_get_id(account);
 		id = g_strdup_printf("%s-%s", account_id, conversation_id);
 		item_exists =
 			g_list_store_find_with_equal_func_full(window->conversation_model,
diff --git a/pidgin/pidginnotificationaddcontact.c b/pidgin/pidginnotificationaddcontact.c
--- a/pidgin/pidginnotificationaddcontact.c
+++ b/pidgin/pidginnotificationaddcontact.c
@@ -176,7 +176,7 @@
 	if(!PURPLE_IS_CONTACT(contact)) {
 		g_warning("failed to find a user named '%s' on account %s",
 		          username,
-		          purple_contact_info_get_username(PURPLE_CONTACT_INFO(account)));
+		          purple_account_get_username(account));
 
 		return;
 	}
diff --git a/pidgin/pidginnotificationauthorizationrequest.c b/pidgin/pidginnotificationauthorizationrequest.c
--- a/pidgin/pidginnotificationauthorizationrequest.c
+++ b/pidgin/pidginnotificationauthorizationrequest.c
@@ -204,7 +204,7 @@
 	if(!PURPLE_IS_CONTACT(contact)) {
 		g_warning("failed to find a user named '%s' on account %s",
 		          username,
-		          purple_contact_info_get_username(PURPLE_CONTACT_INFO(account)));
+		          purple_account_get_username(account));
 
 		return;
 	}
diff --git a/pidgin/pidginnotificationconnectionerror.c b/pidgin/pidginnotificationconnectionerror.c
--- a/pidgin/pidginnotificationconnectionerror.c
+++ b/pidgin/pidginnotificationconnectionerror.c
@@ -89,7 +89,7 @@
 	}
 
 	/* Set the target for our actions. */
-	account_id = purple_contact_info_get_id(PURPLE_CONTACT_INFO(account));
+	account_id = purple_account_get_id(account);
 	gtk_actionable_set_action_target(GTK_ACTIONABLE(error->reconnect), "s",
 	                                 account_id);
 	gtk_actionable_set_action_target(GTK_ACTIONABLE(error->reenable), "s",
diff --git a/pidgin/plugins/disco/gtkdisco.c b/pidgin/plugins/disco/gtkdisco.c
--- a/pidgin/plugins/disco/gtkdisco.c
+++ b/pidgin/plugins/disco/gtkdisco.c
@@ -162,7 +162,6 @@
 {
 	PidginDiscoDialog *dialog = data;
 	PurpleConnection *pc;
-	PurpleContactInfo *info = NULL;
 	PidginDiscoList *pdl;
 	const char *username;
 	const char *at, *slash;
@@ -189,8 +188,7 @@
 
 	gtk_widget_set_sensitive(dialog->account_chooser, FALSE);
 
-	info = PURPLE_CONTACT_INFO(dialog->account);
-	username = purple_contact_info_get_username(info);
+	username = purple_account_get_username(dialog->account);
 	at = strchr(username, '@');
 	slash = strchr(username, '/');
 	if (at && !slash) {
diff --git a/pidgin/plugins/unity/unity.c b/pidgin/plugins/unity/unity.c
--- a/pidgin/plugins/unity/unity.c
+++ b/pidgin/plugins/unity/unity.c
@@ -88,7 +88,6 @@
 conversation_id(PurpleConversation *conv)
 {
 	PurpleAccount *account = purple_conversation_get_account(conv);
-	PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
 	const char *type = "misc";
 
 	if(PURPLE_IS_IM_CONVERSATION(conv)) {
@@ -100,7 +99,7 @@
 	return g_strdup_printf("%s:%s:%s:%s",
 	                       type,
 	                       purple_conversation_get_name(conv),
-	                       purple_contact_info_get_username(info),
+	                       purple_account_get_username(account),
 	                       purple_account_get_protocol_id(account));
 }
 
