aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/database.vala
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/omemo/src/database.vala')
-rw-r--r--plugins/omemo/src/database.vala9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/omemo/src/database.vala b/plugins/omemo/src/database.vala
index 8f8cb44a..0b15d198 100644
--- a/plugins/omemo/src/database.vala
+++ b/plugins/omemo/src/database.vala
@@ -43,7 +43,7 @@ public class Database : Qlite.Database {
}
public void insert_device_list(int32 identity_id, string address_name, ArrayList<int32> devices) {
- update().with(this.address_name, "=", address_name).set(now_active, false).perform();
+ update().with(this.identity_id, "=", identity_id).with(this.address_name, "=", address_name).set(now_active, false).perform();
foreach (int32 device_id in devices) {
upsert()
.value(this.identity_id, identity_id, true)
@@ -124,6 +124,13 @@ public class Database : Qlite.Database {
base(db, "identity");
init({id, account_id, device_id, identity_key_private_base64, identity_key_public_base64});
}
+
+ public int get_id(int account_id) {
+ int id = -1;
+ Row? row = this.row_with(this.account_id, account_id).inner;
+ if (row != null) id = ((!)row)[this.id];
+ return id;
+ }
}
public class SignedPreKeyTable : Table {