diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-20 22:12:20 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-20 22:28:32 +0100 |
commit | 6f3225979cb497db99381556adb7e42119b44ec3 (patch) | |
tree | 1f7352d12eaf1aec7a38d388d3b1917bcd06e479 /libdino/src/application.vala | |
parent | db57a973534f099af2b150f1a1307d1948553d9f (diff) | |
download | dino-6f3225979cb497db99381556adb7e42119b44ec3.tar.gz dino-6f3225979cb497db99381556adb7e42119b44ec3.zip |
Select conversation on startup, placeholder for "No conversation selected", start services before UI
Diffstat (limited to 'libdino/src/application.vala')
-rw-r--r-- | libdino/src/application.vala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libdino/src/application.vala b/libdino/src/application.vala index 4b5fd274..9cabf0f4 100644 --- a/libdino/src/application.vala +++ b/libdino/src/application.vala @@ -29,10 +29,28 @@ public class Dino.Application : Gtk.Application { RosterManager.start(stream_interaction); ConversationManager.start(stream_interaction, db); ChatInteraction.start(stream_interaction); + + activate.connect(() => { + restore(); + }); } public static string get_storage_dir() { return Path.build_filename(Environment.get_user_data_dir(), "dino"); } + + protected void add_connection(Account account) { + stream_interaction.connect(account); + } + + protected void remove_connection(Account account) { + stream_interaction.disconnect(account); + } + + private void restore() { + foreach (Account account in db.get_accounts()) { + if (account.enabled) add_connection(account); + } + } } |