diff options
Diffstat (limited to 'libdino/src/entity')
-rw-r--r-- | libdino/src/entity/message.vala | 4 | ||||
-rw-r--r-- | libdino/src/entity/settings.vala | 20 |
2 files changed, 18 insertions, 6 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; } } |