# HG changeset patch
# Node ID d54141d3c57a
# Parent  77c610604e39
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -366,14 +366,20 @@
 		* purple_account_destroy_log
 		* purple_account_get_check_mail
 		* purple_account_get_log
+		* purple_account_get_name_for_display. Use
+		  purple_contact_info_get_name_for_display instead.
 		* purple_account_get_password.  Use
 		  purple_credential_manager_read_password_async instead.
 		* purple_account_get_public_alias
 		* purple_account_get_privacy_type
+		* purple_account_get_private_alias. Use purple_contact_get_alias
+		  instead.
 		* purple_account_get_silence_suppression
 		* purple_account_get_ui_int
 		* purple_account_get_ui_string
 		* purple_account_get_ui_bool
+		* purple_account_get_username. Use purple_contact_info_get_username
+		  instead.
 		* purple_account_notify_added
 		* purple_account_privacy_allow
 		* purple_account_privacy_check
@@ -394,11 +400,15 @@
 		* purple_account_set_password.  Use
 		  purple_credential_manager_write_password_async instead.
 		* purple_account_set_privacy_type
+		* purple_account_set_private_alias. Use purple_contact_info_set_alias
+		  instead.
 		* purple_account_set_public_alias
 		* purple_account_set_silence_suppression
 		* purple_account_set_ui_int
 		* purple_account_set_ui_string
 		* purple_account_set_ui_bool
+		* purple_account_set_username. Use purple_contact_info_set_username
+		  instead.
 		* purple_accounts_add
 		* purple_accounts_find
 		* purple_accounts_get_all
diff --git a/libpurple/account.h b/libpurple/account.h
--- a/libpurple/account.h
+++ b/libpurple/account.h
@@ -97,19 +97,6 @@
 PurpleAccount *purple_account_new(const char *username, const char *protocol_id);
 
 /**
- * purple_account_get_id:
- * @account: The account instance.
- *
- * Gets the identifier of @account.
- *
- * Returns: The identifier of @account.
- *
- * Since: 3.0.0
- */
-G_DEPRECATED_FOR(purple_contact_info_get_id)
-const gchar *purple_account_get_id(PurpleAccount *account);
-
-/**
  * purple_account_connect:
  * @account: The account to connect to.
  *
@@ -184,26 +171,6 @@
 void purple_account_request_change_user_info(PurpleAccount *account);
 
 /**
- * purple_account_set_username:
- * @account:  The account.
- * @username: The username.
- *
- * Sets the account's username.
- */
-G_DEPRECATED_FOR(purple_contact_info_set_username)
-void purple_account_set_username(PurpleAccount *account, const char *username);
-
-/**
- * purple_account_set_private_alias:
- * @account: The account.
- * @alias:   The alias.
- *
- * Sets the account's private alias.
- */
-G_DEPRECATED_FOR(purple_contact_info_set_alias)
-void purple_account_set_private_alias(PurpleAccount *account, const char *alias);
-
-/**
  * purple_account_set_user_info:
  * @account:   The account.
  * @user_info: The user information.
@@ -398,28 +365,6 @@
 gboolean purple_account_is_disconnected(PurpleAccount *account);
 
 /**
- * purple_account_get_username:
- * @account: The account.
- *
- * Returns the account's username.
- *
- * Returns: The username.
- */
-G_DEPRECATED_FOR(purple_contact_info_get_username)
-const char *purple_account_get_username(PurpleAccount *account);
-
-/**
- * purple_account_get_private_alias:
- * @account: The account.
- *
- * Returns the account's private alias.
- *
- * Returns: The alias.
- */
-G_DEPRECATED_FOR(purple_contact_info_get_alias)
-const char *purple_account_get_private_alias(PurpleAccount *account);
-
-/**
  * purple_account_get_user_info:
  * @account: The account.
  *
@@ -483,20 +428,6 @@
 PurpleConnection *purple_account_get_connection(PurpleAccount *account);
 
 /**
- * purple_account_get_name_for_display:
- * @account: The account.
- *
- * Returns a name for this account appropriate for display to the user. In
- * order of preference: the account's alias; the contact or buddy alias (if
- * the account exists on its own buddy list); the connection's display name;
- * the account's username.
- *
- * Returns: The name to display.
- */
-G_DEPRECATED_FOR(purple_contact_info_get_name_for_display)
-const gchar *purple_account_get_name_for_display(PurpleAccount *account);
-
-/**
  * purple_account_get_remember_password:
  * @account: The account.
  *
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -436,6 +436,24 @@
 	purple_accounts_schedule_save();
 }
 
+static void
+purple_account_changed_cb(GObject *obj, GParamSpec *pspec,
+                          G_GNUC_UNUSED gpointer data)
+{
+	const char *name = NULL;
+
+	purple_accounts_schedule_save();
+
+	name = g_param_spec_get_name(pspec);
+	if(purple_strequal(name, "username")) {
+		/* if the username changes, we should re-write the buddy list to disk
+		 * with the new name.
+		  */
+		purple_blist_save_account(purple_blist_get_default(),
+		                          PURPLE_ACCOUNT(obj));
+	}
+}
+
 /******************************************************************************
  * XmlNode Helpers
  *****************************************************************************/
@@ -772,6 +790,10 @@
 
 	g_free(username);
 	g_free(protocol_id);
+
+	/* Connect to our own notify signal so we can update accounts.xml. */
+	g_signal_connect(object, "notify",
+	                 G_CALLBACK(purple_account_changed_cb), NULL);
 }
 
 static void
@@ -974,13 +996,6 @@
 	return account;
 }
 
-const gchar *
-purple_account_get_id(PurpleAccount *account) {
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
-
-	return purple_contact_info_get_id(PURPLE_CONTACT_INFO(account));
-}
-
 void
 purple_account_connect(PurpleAccount *account)
 {
@@ -1198,36 +1213,6 @@
 }
 
 void
-purple_account_set_username(PurpleAccount *account, const char *username)
-{
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-
-	purple_contact_info_set_username(PURPLE_CONTACT_INFO(account), username);
-
-	purple_accounts_schedule_save();
-
-	/* if the name changes, we should re-write the buddy list
-	 * to disk with the new name */
-	purple_blist_save_account(purple_blist_get_default(), account);
-}
-
-void
-purple_account_set_private_alias(PurpleAccount *account, const char *alias)
-{
-	const char *old_alias = NULL;
-
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-
-	old_alias = purple_contact_info_get_alias(PURPLE_CONTACT_INFO(account));
-	if(purple_strequal(old_alias, alias)) {
-		return;
-	}
-
-	purple_contact_info_set_alias(PURPLE_CONTACT_INFO(account), alias);
-	purple_accounts_schedule_save();
-}
-
-void
 purple_account_set_user_info(PurpleAccount *account, const char *user_info)
 {
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
@@ -1479,22 +1464,6 @@
 }
 
 const char *
-purple_account_get_username(PurpleAccount *account)
-{
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
-
-	return purple_contact_info_get_username(PURPLE_CONTACT_INFO(account));
-}
-
-const char *
-purple_account_get_private_alias(PurpleAccount *account)
-{
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
-
-	return purple_contact_info_get_alias(PURPLE_CONTACT_INFO(account));
-}
-
-const char *
 purple_account_get_user_info(PurpleAccount *account)
 {
 	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
@@ -1550,13 +1519,6 @@
 	return account->gc;
 }
 
-const gchar *
-purple_account_get_name_for_display(PurpleAccount *account) {
-	g_return_val_if_fail(PURPLE_IS_CONTACT_INFO(account), NULL);
-
-	return purple_contact_info_get_name_for_display(PURPLE_CONTACT_INFO(account));
-}
-
 gboolean
 purple_account_get_remember_password(PurpleAccount *account)
 {
diff --git a/libpurple/purplemenu.h b/libpurple/purplemenu.h
--- a/libpurple/purplemenu.h
+++ b/libpurple/purplemenu.h
@@ -78,7 +78,7 @@
  * For example, if you need to set the target to an account, you would set
  * the "dynamic-target" attribute of your menu item to "account" and then
  * call purple_menu_populate_dynamic_targets() with a property pair of
- * "account" and [method@Account.get_id].
+ * "account" and [method@Purple.ContactInfo.get_id].
  *
  * Since: 3.0.0
  */
@@ -99,7 +99,7 @@
  * For example, if you need to set the target to an account, you would set the
  * "dynamic-target" attribute of your menu item to "account" and then call
  * [func@Purple.menu_populate_dynamic_targetsv] with a hash table containing
- * the key `"account"` and value from [method@Account.get_id].
+ * the key `"account"` and value from [method@Purple.ContactInfo.get_id].
  *
  * Since: 3.0.0
  */
