diff options
author | fiaxh <git@lightrise.org> | 2020-06-10 23:40:00 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-06-10 23:40:00 +0200 |
commit | 0beb592c5a6a2767e11a892bdb5ac9bcc5283c38 (patch) | |
tree | bea2894d322472292590ec126dc1b52543a10a7e /plugins/omemo/src/logic/manager.vala | |
parent | 50c55c7f55aff6622d242bdcf2b58d5f7956f28e (diff) | |
download | dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.tar.gz dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.zip |
Use sqlite UPSERT
Diffstat (limited to 'plugins/omemo/src/logic/manager.vala')
-rw-r--r-- | plugins/omemo/src/logic/manager.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/omemo/src/logic/manager.vala b/plugins/omemo/src/logic/manager.vala index 4bb85d59..e561bd90 100644 --- a/plugins/omemo/src/logic/manager.vala +++ b/plugins/omemo/src/logic/manager.vala @@ -352,8 +352,8 @@ public class Manager : StreamInteractionModule, Object { store.identity_key_store.identity_key_private = new Bytes(key_pair.private.serialize()); store.identity_key_store.identity_key_public = new Bytes(key_pair.public.serialize()); - identity_id = (int) db.identity.insert().or("REPLACE") - .value(db.identity.account_id, account.id) + identity_id = (int) db.identity.upsert() + .value(db.identity.account_id, account.id, true) .value(db.identity.device_id, (int) store.local_registration_id) .value(db.identity.identity_key_private_base64, Base64.encode(store.identity_key_store.identity_key_private.get_data())) .value(db.identity.identity_key_public_base64, Base64.encode(store.identity_key_store.identity_key_public.get_data())) |