aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
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 /libdino/src/service
parent50c55c7f55aff6622d242bdcf2b58d5f7956f28e (diff)
downloaddino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.tar.gz
dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.zip
Use sqlite UPSERT
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/roster_manager.vala6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdino/src/service/roster_manager.vala b/libdino/src/service/roster_manager.vala
index 62428882..8d9d91fb 100644
--- a/libdino/src/service/roster_manager.vala
+++ b/libdino/src/service/roster_manager.vala
@@ -128,9 +128,9 @@ public class RosterStoreImpl : Roster.Storage, Object {
public void set_item(Roster.Item item) {
items[item.jid] = item;
- db.roster.insert().or("REPLACE")
- .value(db.roster.account_id, account.id)
- .value(db.roster.jid, item.jid.to_string())
+ db.roster.upsert()
+ .value(db.roster.account_id, account.id, true)
+ .value(db.roster.jid, item.jid.to_string(), true)
.value(db.roster.handle, item.name)
.value(db.roster.subscription, item.subscription)
.perform();