aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/entity/message.vala4
-rw-r--r--libdino/src/entity/settings.vala20
-rw-r--r--libdino/src/service/roster_manager.vala6
3 files changed, 21 insertions, 9 deletions
diff --git a/libdino/src/entity/message.vala b/libdino/src/entity/message.vala
index bce3bec4..89ad241a 100644
--- a/libdino/src/entity/message.vala
+++ b/libdino/src/entity/message.vala
@@ -196,8 +196,8 @@ public class Message : Object {
update_builder.perform();
if (sp.get_name() == "real-jid") {
- db.real_jid.insert().or("REPLACE")
- .value(db.real_jid.message_id, id)
+ db.real_jid.upsert()
+ .value(db.real_jid.message_id, id, true)
.value(db.real_jid.real_jid, real_jid.to_string())
.perform();
}
diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala
index bf1ebed4..2aae6055 100644
--- a/libdino/src/entity/settings.vala
+++ b/libdino/src/entity/settings.vala
@@ -22,7 +22,10 @@ public class Settings : Object {
public bool send_typing {
get { return send_typing_; }
set {
- db.settings.insert().or("REPLACE").value(db.settings.key, "send_typing").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "send_typing", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
send_typing_ = value;
}
}
@@ -31,7 +34,10 @@ public class Settings : Object {
public bool send_marker {
get { return send_marker_; }
set {
- db.settings.insert().or("REPLACE").value(db.settings.key, "send_marker").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "send_marker", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
send_marker_ = value;
}
}
@@ -40,7 +46,10 @@ public class Settings : Object {
public bool notifications {
get { return notifications_; }
set {
- db.settings.insert().or("REPLACE").value(db.settings.key, "notifications").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "notifications", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
notifications_ = value;
}
}
@@ -49,7 +58,10 @@ public class Settings : Object {
public bool convert_utf8_smileys {
get { return convert_utf8_smileys_; }
set {
- db.settings.insert().or("REPLACE").value(db.settings.key, "convert_utf8_smileys").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "convert_utf8_smileys", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
convert_utf8_smileys_ = value;
}
}
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();