# HG changeset patch
# Node ID 9b98dc824644
# Parent  e859c41d8996
diff --git a/finch/gntaccount.c b/finch/gntaccount.c
--- a/finch/gntaccount.c
+++ b/finch/gntaccount.c
@@ -136,13 +136,12 @@
 		                 (GDestroyNotify)purple_account_user_split_destroy);
 	}
 
-	if (dialog->account == NULL)
-	{
+	if(dialog->account == NULL) {
+		PurpleAccountManager *manager = purple_account_manager_get_default();
+
 		account = purple_account_new(username->str, purple_protocol_get_id(protocol));
-		purple_accounts_add(account);
-	}
-	else
-	{
+		purple_account_manager_add(manager, account);
+	} else {
 		account = dialog->account;
 
 		/* Protocol */
@@ -745,6 +744,7 @@
 account_list_key_pressed_cb(GntWidget *widget, const char *text, gpointer null)
 {
 	GntTree *tree = GNT_TREE(widget);
+	PurpleAccountManager *manager = NULL;
 	PurpleAccount *account = gnt_tree_get_selection_data(tree);
 	int move, pos, count;
 	GList *accounts;
@@ -763,17 +763,19 @@
 			return FALSE;
 	}
 
-	accounts = purple_accounts_get_all();
+	manager = purple_account_manager_get_default();
+	accounts = purple_account_manager_get_all(manager);
 	count = g_list_length(accounts);
 	pos = g_list_index(accounts, account);
 	pos = (move + pos + count + 1) % (count + 1);
-	if (pos >= 0)
-		purple_accounts_reorder(account, pos);
+	if(pos >= 0) {
+		purple_account_manager_reorder(manager, account, pos);
+	}
 
 	/* I don't like this, but recreating the entire list seems to be
 	 * the easiest way of doing it */
 	gnt_tree_remove_all(tree);
-	accounts = purple_accounts_get_all();
+	accounts = purple_account_manager_get_all(manager);
 	for (; accounts; accounts = accounts->next)
 		account_add(accounts->data);
 	gnt_tree_set_selected(tree, account);
@@ -790,6 +792,7 @@
 
 void finch_accounts_show_all()
 {
+	PurpleAccountManager *manager = NULL;
 	GList *iter;
 	GntWidget *box, *button;
 
@@ -813,8 +816,10 @@
 	accounts.tree = gnt_tree_new_with_columns(2);
 	gnt_widget_set_has_border(accounts.tree, FALSE);
 
-	for (iter = purple_accounts_get_all(); iter; iter = iter->next)
-	{
+	manager = purple_account_manager_get_default();
+	iter = purple_account_manager_get_all(manager);
+
+	for(; iter; iter = iter->next) {
 		PurpleAccount *account = iter->data;
 		account_add(account);
 	}
@@ -893,6 +898,7 @@
 
 void finch_accounts_init()
 {
+	PurpleAccountManager *manager = NULL;
 	GList *iter;
 
 	purple_signal_connect(purple_accounts_get_handle(), "account-added",
@@ -908,7 +914,8 @@
 			finch_accounts_get_handle(),
 			PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE));
 
-	iter = purple_accounts_get_all();
+	manager = purple_account_manager_get_default();
+	iter = purple_account_manager_get_all(manager);
 	if (iter) {
 		for (; iter; iter = iter->next) {
 			if (purple_account_get_enabled(iter->data, FINCH_UI))
diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -2379,8 +2379,8 @@
 }
 
 static void
-reconstruct_accounts_menu(void)
-{
+reconstruct_accounts_menu(void) {
+	PurpleAccountManager *manager = NULL;
 	GntWidget *sub;
 	GntMenuItem *acc, *item;
 	GList *iter;
@@ -2395,8 +2395,10 @@
 	sub = gnt_menu_new(GNT_MENU_POPUP);
 	gnt_menuitem_set_submenu(acc, GNT_MENU(sub));
 
-	for (iter = purple_accounts_get_all_active(); iter;
-			iter = g_list_delete_link(iter, iter)) {
+	manager = purple_account_manager_get_default();
+	iter = purple_account_manager_get_active(manager);
+
+	for (; iter; iter = g_list_delete_link(iter, iter)) {
 		PurpleAccount *account = iter->data;
 		PurpleConnection *gc = purple_account_get_connection(account);
 		PurpleProtocol *protocol;
diff --git a/finch/gntrequest.c b/finch/gntrequest.c
--- a/finch/gntrequest.c
+++ b/finch/gntrequest.c
@@ -524,16 +524,18 @@
 
 	all = purple_request_field_account_get_show_all(field);
 	def = purple_request_field_account_get_value(field);
-	if (!def)
+	if (!def) {
 		def = purple_request_field_account_get_default_value(field);
+	}
 
-	if (all)
-		list = purple_accounts_get_all();
-	else
+	if(all) {
+		PurpleAccountManager *manager = purple_account_manager_get_default();
+		list = purple_account_manager_get_all(manager);
+	} else {
 		list = purple_connections_get_all();
+	}
 
-	for (; list; list = list->next)
-	{
+	for(; list; list = list->next) {
 		PurpleAccount *account;
 		char *text;
 
diff --git a/finch/gntstatus.c b/finch/gntstatus.c
--- a/finch/gntstatus.c
+++ b/finch/gntstatus.c
@@ -490,6 +490,7 @@
 
 void finch_savedstatus_edit(PurpleSavedStatus *saved)
 {
+	PurpleAccountManager *manager = NULL;
 	EditStatus *edit;
 	GntWidget *window, *box, *button, *entry, *combo, *label, *tree;
 	PurpleStatusPrimitive prims[] = {PURPLE_STATUS_AVAILABLE, PURPLE_STATUS_AWAY,
@@ -565,8 +566,9 @@
 	gnt_tree_set_col_width(GNT_TREE(tree), 1, 10);
 	gnt_tree_set_col_width(GNT_TREE(tree), 2, 30);
 
-	for (iter = purple_accounts_get_all(); iter; iter = iter->next)
-	{
+	manager = purple_account_manager_get_default();
+	iter = purple_account_manager_get_all(manager);
+	for(; iter; iter = iter->next) {
 		add_substatus(edit, iter->data);
 	}
 
