From 0beb592c5a6a2767e11a892bdb5ac9bcc5283c38 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 10 Jun 2020 23:40:00 +0200 Subject: Use sqlite UPSERT --- libdino/src/service/roster_manager.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libdino/src/service') 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(); -- cgit v1.2.3-70-g09d2