aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/manage_accounts/add_account_dialog.vala9
-rw-r--r--main/src/ui/manage_accounts/dialog.vala4
2 files changed, 6 insertions, 7 deletions
diff --git a/main/src/ui/manage_accounts/add_account_dialog.vala b/main/src/ui/manage_accounts/add_account_dialog.vala
index f6ad40a2..8501f476 100644
--- a/main/src/ui/manage_accounts/add_account_dialog.vala
+++ b/main/src/ui/manage_accounts/add_account_dialog.vala
@@ -49,11 +49,10 @@ public class AddAccountDialog : Gtk.Dialog {
}
private void on_ok_button_clicked() {
- Account account = new Account.from_bare_jid(jid_entry.get_text());
- account.resourcepart = "dino";
- account.alias = alias_entry.get_text();
- account.enabled = false;
- account.password = password_entry.get_text();
+ Jid jid = new Jid(jid_entry.get_text());
+ string password = password_entry.get_text();
+ string alias = alias_entry.get_text();
+ Account account = new Account(jid, null, password, alias);
added(account);
close();
}
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala
index db40761d..c0689474 100644
--- a/main/src/ui/manage_accounts/dialog.vala
+++ b/main/src/ui/manage_accounts/dialog.vala
@@ -98,7 +98,7 @@ public class Dialog : Gtk.Window {
AddAccountDialog add_account_dialog = new AddAccountDialog(stream_interactor);
add_account_dialog.set_transient_for(this);
add_account_dialog.added.connect((account) => {
- db.add_account(account);
+ account.persist(db);
AccountRow account_item = add_account(account);
account_list.select_row(account_item);
account_list.queue_draw();
@@ -112,7 +112,7 @@ public class Dialog : Gtk.Window {
account_list.remove(account_item);
account_list.queue_draw();
if (account_item.account.enabled) account_disabled(account_item.account);
- db.remove_account(account_item.account);
+ account_item.account.remove();
if (account_list.get_row_at_index(0) != null) {
account_list.select_row(account_list.get_row_at_index(0));
} else {