aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/logic/session_store.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-06-10 23:40:00 +0200
committerfiaxh <git@lightrise.org>2020-06-10 23:40:00 +0200
commit0beb592c5a6a2767e11a892bdb5ac9bcc5283c38 (patch)
treebea2894d322472292590ec126dc1b52543a10a7e /plugins/omemo/src/logic/session_store.vala
parent50c55c7f55aff6622d242bdcf2b58d5f7956f28e (diff)
downloaddino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.tar.gz
dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.zip
Use sqlite UPSERT
Diffstat (limited to 'plugins/omemo/src/logic/session_store.vala')
-rw-r--r--plugins/omemo/src/logic/session_store.vala8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/omemo/src/logic/session_store.vala b/plugins/omemo/src/logic/session_store.vala
index 654591d1..2c7ef642 100644
--- a/plugins/omemo/src/logic/session_store.vala
+++ b/plugins/omemo/src/logic/session_store.vala
@@ -29,10 +29,10 @@ private class BackedSessionStore : SimpleSessionStore {
}
public void on_session_stored(SessionStore.Session session) {
- db.session.insert().or("REPLACE")
- .value(db.session.identity_id, identity_id)
- .value(db.session.address_name, session.name)
- .value(db.session.device_id, session.device_id)
+ db.session.upsert()
+ .value(db.session.identity_id, identity_id, true)
+ .value(db.session.address_name, session.name, true)
+ .value(db.session.device_id, session.device_id, true)
.value(db.session.record_base64, Base64.encode(session.record))
.perform();
}