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 /libdino/src/service/roster_manager.vala | |
parent | 50c55c7f55aff6622d242bdcf2b58d5f7956f28e (diff) | |
download | dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.tar.gz dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.zip |
Use sqlite UPSERT
Diffstat (limited to 'libdino/src/service/roster_manager.vala')
-rw-r--r-- | libdino/src/service/roster_manager.vala | 6 |
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(); |