From 7d2f995a097086be01426cc79c9c801dabaf9e3b Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 24 Mar 2017 22:57:05 +0100 Subject: Fix conversation last_active --- libdino/src/entity/account.vala | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'libdino/src/entity/account.vala') diff --git a/libdino/src/entity/account.vala b/libdino/src/entity/account.vala index 3f1bfdb2..59a76c7d 100644 --- a/libdino/src/entity/account.vala +++ b/libdino/src/entity/account.vala @@ -71,13 +71,20 @@ public class Account : Object { } private void on_update(Object o, ParamSpec sp) { - db.account.update().with(db.account.id, "=", id) - .set(db.account.bare_jid, bare_jid.to_string()) - .set(db.account.resourcepart, resourcepart) - .set(db.account.password, password) - .set(db.account.alias, alias) - .set(db.account.enabled, enabled) - .perform(); + var update = db.account.update().with(db.account.id, "=", id); + switch (sp.name) { + case "bare-jid": + update.set(db.account.bare_jid, bare_jid.to_string()); break; + case "resourcepart": + update.set(db.account.resourcepart, resourcepart); break; + case "password": + update.set(db.account.password, password); break; + case "alias": + update.set(db.account.alias, alias); break; + case "enabled": + update.set(db.account.enabled, enabled); break; + } + update.perform(); } } -- cgit v1.2.3-54-g00ecf