# HG changeset patch
# Node ID d793dd455772
# Parent  f79d8f49abe8
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -562,138 +562,6 @@
  * XmlNode Helpers
  *****************************************************************************/
 static PurpleXmlNode *
-status_attribute_to_xmlnode(PurpleStatus *status, PurpleStatusType *type,
-		PurpleStatusAttribute *attr)
-{
-	PurpleXmlNode *node;
-	const char *id;
-	char *value = NULL;
-	PurpleStatusAttribute *default_attr;
-	GValue *default_value;
-	GType attr_type;
-	GValue *attr_value;
-
-	id = purple_status_attribute_get_id(attr);
-	g_return_val_if_fail(id, NULL);
-
-	attr_value = purple_status_get_attr_value(status, id);
-	g_return_val_if_fail(attr_value, NULL);
-	attr_type = G_VALUE_TYPE(attr_value);
-
-	/*
-	 * If attr_value is a different type than it should be
-	 * then don't write it to the file.
-	 */
-	default_attr = purple_status_type_get_attr(type, id);
-	default_value = purple_status_attribute_get_value(default_attr);
-	if (attr_type != G_VALUE_TYPE(default_value))
-		return NULL;
-
-	/*
-	 * If attr_value is the same as the default for this status
-	 * then there is no need to write it to the file.
-	 */
-	if (attr_type == G_TYPE_STRING)
-	{
-		const char *string_value = g_value_get_string(attr_value);
-		const char *default_string_value = g_value_get_string(default_value);
-		if (purple_strequal(string_value, default_string_value))
-			return NULL;
-		value = g_value_dup_string(attr_value);
-	}
-	else if (attr_type == G_TYPE_INT)
-	{
-		int int_value = g_value_get_int(attr_value);
-		if (int_value == g_value_get_int(default_value))
-			return NULL;
-		value = g_strdup_printf("%d", int_value);
-	}
-	else if (attr_type == G_TYPE_BOOLEAN)
-	{
-		gboolean boolean_value = g_value_get_boolean(attr_value);
-		if (boolean_value == g_value_get_boolean(default_value))
-			return NULL;
-		value = g_strdup(boolean_value ?
-								"true" : "false");
-	}
-	else
-	{
-		return NULL;
-	}
-
-	g_return_val_if_fail(value, NULL);
-
-	node = purple_xmlnode_new("attribute");
-
-	purple_xmlnode_set_attrib(node, "id", id);
-	purple_xmlnode_set_attrib(node, "value", value);
-
-	g_free(value);
-
-	return node;
-}
-
-static PurpleXmlNode *
-status_attrs_to_xmlnode(PurpleStatus *status)
-{
-	PurpleStatusType *type = purple_status_get_status_type(status);
-	PurpleXmlNode *node, *child;
-	GList *attrs, *attr;
-
-	node = purple_xmlnode_new("attributes");
-
-	attrs = purple_status_type_get_attrs(type);
-	for (attr = attrs; attr != NULL; attr = attr->next)
-	{
-		child = status_attribute_to_xmlnode(status, type, (PurpleStatusAttribute *)attr->data);
-		if (child)
-			purple_xmlnode_insert_child(node, child);
-	}
-
-	return node;
-}
-
-static PurpleXmlNode *
-status_to_xmlnode(PurpleStatus *status)
-{
-	PurpleXmlNode *node, *child;
-
-	node = purple_xmlnode_new("status");
-	purple_xmlnode_set_attrib(node, "type", purple_status_get_id(status));
-	if (purple_status_get_name(status) != NULL)
-		purple_xmlnode_set_attrib(node, "name", purple_status_get_name(status));
-	purple_xmlnode_set_attrib(node, "active", purple_status_is_active(status) ? "true" : "false");
-
-	child = status_attrs_to_xmlnode(status);
-	purple_xmlnode_insert_child(node, child);
-
-	return node;
-}
-
-static PurpleXmlNode *
-statuses_to_xmlnode(PurplePresence *presence)
-{
-	PurpleXmlNode *node, *child;
-	GList *statuses;
-	PurpleStatus *status;
-
-	node = purple_xmlnode_new("statuses");
-
-	statuses = purple_presence_get_statuses(presence);
-	for (; statuses != NULL; statuses = statuses->next)
-	{
-		status = statuses->data;
-		if (purple_status_type_is_saveable(purple_status_get_status_type(status)))
-		{
-			child = status_to_xmlnode(status);
-			purple_xmlnode_insert_child(node, child);
-		}
-	}
-
-	return node;
-}
-
-static PurpleXmlNode *
 proxy_settings_to_xmlnode(const PurpleProxyInfo *proxy_info)
 {
 	PurpleXmlNode *node, *child;
@@ -833,7 +701,6 @@
 {
 	PurpleXmlNode *node, *child;
 	const char *tmp;
-	PurplePresence *presence;
 	const PurpleProxyInfo *proxy_info;
 	PurpleAccountPrivate *priv = purple_account_get_instance_private(account);
 
@@ -856,12 +723,6 @@
 		purple_xmlnode_insert_data(child, tmp, -1);
 	}
 
-	if ((presence = purple_account_get_presence(account)) != NULL)
-	{
-		child = statuses_to_xmlnode(presence);
-		purple_xmlnode_insert_child(node, child);
-	}
-
 	if ((tmp = purple_account_get_user_info(account)) != NULL)
 	{
 		/* TODO: Do we need to call purple_str_strip_char(tmp, '\r') here? */
diff --git a/libpurple/accounts.c b/libpurple/accounts.c
--- a/libpurple/accounts.c
+++ b/libpurple/accounts.c
@@ -194,98 +194,6 @@
 	migrate_xmpp_encryption(account);
 }
 
-static GHashTable *
-parse_status_attrs(PurpleXmlNode *node, PurpleStatus *status)
-{
-	GHashTable *attrs = g_hash_table_new(g_str_hash, g_str_equal);
-	PurpleXmlNode *child;
-	GValue *attr_value;
-
-	for (child = purple_xmlnode_get_child(node, "attribute"); child != NULL;
-			child = purple_xmlnode_get_next_twin(child))
-	{
-		const char *id = purple_xmlnode_get_attrib(child, "id");
-		const char *value = purple_xmlnode_get_attrib(child, "value");
-
-		if (!id || !*id || !value || !*value)
-			continue;
-
-		attr_value = purple_status_get_attr_value(status, id);
-		if (!attr_value)
-			continue;
-
-		switch (G_VALUE_TYPE(attr_value))
-		{
-			case G_TYPE_STRING:
-				g_hash_table_insert(attrs, (char *)id, (char *)value);
-				break;
-			case G_TYPE_INT:
-			case G_TYPE_BOOLEAN:
-			{
-				int v;
-				if (sscanf(value, "%d", &v) == 1) {
-					g_hash_table_insert(attrs, (char *)id, GINT_TO_POINTER(v));
-				}
-				break;
-			}
-			default:
-				break;
-		}
-	}
-
-	return attrs;
-}
-
-static void
-parse_status(PurpleXmlNode *node, PurpleAccount *account)
-{
-	gboolean active = FALSE;
-	const char *data;
-	const char *type;
-	PurpleXmlNode *child;
-	GHashTable *attrs = NULL;
-
-	/* Get the active/inactive state */
-	data = purple_xmlnode_get_attrib(node, "active");
-	if (data == NULL)
-		return;
-	if (g_ascii_strcasecmp(data, "true") == 0)
-		active = TRUE;
-	else if (g_ascii_strcasecmp(data, "false") == 0)
-		active = FALSE;
-	else
-		return;
-
-	/* Get the type of the status */
-	type = purple_xmlnode_get_attrib(node, "type");
-	if (type == NULL)
-		return;
-
-	/* Read attributes into a GList */
-	child = purple_xmlnode_get_child(node, "attributes");
-	if (child != NULL)
-	{
-		attrs = parse_status_attrs(child,
-						purple_account_get_status(account, type));
-	}
-
-	purple_account_set_status_attrs(account, type, active, attrs);
-
-	g_hash_table_destroy(attrs);
-}
-
-static void
-parse_statuses(PurpleXmlNode *node, PurpleAccount *account)
-{
-	PurpleXmlNode *child;
-
-	for (child = purple_xmlnode_get_child(node, "status"); child != NULL;
-			child = purple_xmlnode_get_next_twin(child))
-	{
-		parse_status(child, account);
-	}
-}
-
 static void
 parse_proxy_info(PurpleXmlNode *node, PurpleAccount *account)
 {
@@ -467,13 +375,6 @@
 		g_free(data);
 	}
 
-	/* Read the statuses */
-	child = purple_xmlnode_get_child(node, "statuses");
-	if (child != NULL)
-	{
-		parse_statuses(child, ret);
-	}
-
 	/* Read the userinfo */
 	child = purple_xmlnode_get_child(node, "userinfo");
 	if ((child != NULL) && ((data = purple_xmlnode_get_data(child)) != NULL))
