diff options
author | fiaxh <git@mx.ax.lt> | 2017-10-28 23:48:07 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-10-31 15:41:45 +0100 |
commit | b9df78e4494879752e9e68dcc5d54e03fffe9467 (patch) | |
tree | d1c74fde4aedea42773bc411c557f2184003defa /plugins/omemo/src/manager.vala | |
parent | d9b91206c0291fa8aa58df572292784a4f8ff878 (diff) | |
download | dino-b9df78e4494879752e9e68dcc5d54e03fffe9467.tar.gz dino-b9df78e4494879752e9e68dcc5d54e03fffe9467.zip |
Move DatabaseError handling into Qlite
Diffstat (limited to 'plugins/omemo/src/manager.vala')
-rw-r--r-- | plugins/omemo/src/manager.vala | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/plugins/omemo/src/manager.vala b/plugins/omemo/src/manager.vala index 9b6f3681..5a7cb9ef 100644 --- a/plugins/omemo/src/manager.vala +++ b/plugins/omemo/src/manager.vala @@ -196,39 +196,24 @@ public class Manager : StreamInteractionModule, Object { if (module == null) { return; } - try { - ArrayList<int32> device_list = module.get_device_list(jid); - db.identity_meta.insert_device_list(jid, device_list); - int inc = 0; - foreach (Row row in db.identity_meta.with_address(jid).with_null(db.identity_meta.identity_key_public_base64)) { - module.fetch_bundle(stream, row[db.identity_meta.address_name], row[db.identity_meta.device_id]); - inc++; - } - if (inc > 0) { - if (Plugin.DEBUG) print(@"OMEMO: new bundles $inc/$(device_list.size) for $jid\n"); - } - } catch (DatabaseError e) { - // Ignore - print(@"OMEMO: failed to use database: $(e.message)\n"); + ArrayList<int32> device_list = module.get_device_list(jid); + db.identity_meta.insert_device_list(jid, device_list); + int inc = 0; + foreach (Row row in db.identity_meta.with_address(jid).with_null(db.identity_meta.identity_key_public_base64)) { + module.fetch_bundle(stream, row[db.identity_meta.address_name], row[db.identity_meta.device_id]); + inc++; + } + if (inc > 0) { + if (Plugin.DEBUG) print(@"OMEMO: new bundles $inc/$(device_list.size) for $jid\n"); } } public void on_bundle_fetched(Account account, string jid, int32 device_id, Bundle bundle) { - try { - db.identity_meta.insert_device_bundle(jid, device_id, bundle); - } catch (DatabaseError e) { - // Ignore - print(@"OMEMO: failed to use database: $(e.message)\n"); - } + db.identity_meta.insert_device_bundle(jid, device_id, bundle); } private void on_store_created(Account account, Store store) { - Qlite.Row? row = null; - try { - row = db.identity.row_with(db.identity.account_id, account.id).inner; - } catch (Error e) { - // Ignore error - } + Qlite.Row? row = db.identity.row_with(db.identity.account_id, account.id).inner; int identity_id = -1; if (row == null) { @@ -280,4 +265,4 @@ public class Manager : StreamInteractionModule, Object { } } -}
\ No newline at end of file +} |