aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp
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/openpgp
parent50c55c7f55aff6622d242bdcf2b58d5f7956f28e (diff)
downloaddino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.tar.gz
dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.zip
Use sqlite UPSERT
Diffstat (limited to 'plugins/openpgp')
-rw-r--r--plugins/openpgp/CMakeLists.txt2
-rw-r--r--plugins/openpgp/src/database.vala8
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/openpgp/CMakeLists.txt b/plugins/openpgp/CMakeLists.txt
index 3f7c1974..769d517d 100644
--- a/plugins/openpgp/CMakeLists.txt
+++ b/plugins/openpgp/CMakeLists.txt
@@ -6,7 +6,7 @@ gettext_compile(${GETTEXT_PACKAGE} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/po TAR
find_packages(OPENPGP_PACKAGES REQUIRED
Gee
- GLib>=2.38
+ GLib
GModule
GObject
GTK3
diff --git a/plugins/openpgp/src/database.vala b/plugins/openpgp/src/database.vala
index 52005651..2bda06af 100644
--- a/plugins/openpgp/src/database.vala
+++ b/plugins/openpgp/src/database.vala
@@ -39,8 +39,8 @@ public class Database : Qlite.Database {
}
public void set_contact_key(Jid jid, string key) {
- contact_key_table.insert().or("REPLACE")
- .value(contact_key_table.jid, jid.to_string())
+ contact_key_table.upsert()
+ .value(contact_key_table.jid, jid.to_string(), true)
.value(contact_key_table.key, key)
.perform();
}
@@ -51,8 +51,8 @@ public class Database : Qlite.Database {
}
public void set_account_key(Account account, string key) {
- account_setting_table.insert().or("REPLACE")
- .value(account_setting_table.account_id, account.id)
+ account_setting_table.upsert()
+ .value(account_setting_table.account_id, account.id, true)
.value(account_setting_table.key, key)
.perform();
}