diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-24 22:57:05 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-31 01:21:35 +0200 |
commit | 7d2f995a097086be01426cc79c9c801dabaf9e3b (patch) | |
tree | 32b00adeaec82843a9f41fb3de17adc25e62fcc1 /libdino/src/entity/account.vala | |
parent | 3733d24a9066bdd3e038d642a62cf642abd0b0bf (diff) | |
download | dino-7d2f995a097086be01426cc79c9c801dabaf9e3b.tar.gz dino-7d2f995a097086be01426cc79c9c801dabaf9e3b.zip |
Fix conversation last_active
Diffstat (limited to 'libdino/src/entity/account.vala')
-rw-r--r-- | libdino/src/entity/account.vala | 21 |
1 files changed, 14 insertions, 7 deletions
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(); } } |