diff options
author | Marvin W <git@larma.de> | 2017-03-24 10:40:48 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-03-24 15:18:39 +0100 |
commit | b63e5f5f9fc0fcd85adf2f93f65d61abd4cc0681 (patch) | |
tree | 20543c6e78d28df345304c7d595383338c7676ce /libdino/src/entity/conversation.vala | |
parent | c0314212a0d951494fe6397fa53a9c5689a3ff87 (diff) | |
download | dino-b63e5f5f9fc0fcd85adf2f93f65d61abd4cc0681.tar.gz dino-b63e5f5f9fc0fcd85adf2f93f65d61abd4cc0681.zip |
Some caching and fix gpgme on some systems
Diffstat (limited to 'libdino/src/entity/conversation.vala')
-rw-r--r-- | libdino/src/entity/conversation.vala | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libdino/src/entity/conversation.vala b/libdino/src/entity/conversation.vala index fd226b3e..376d1cef 100644 --- a/libdino/src/entity/conversation.vala +++ b/libdino/src/entity/conversation.vala @@ -74,15 +74,23 @@ public class Conversation : Object { private void on_update(Object o, ParamSpec sp) { var update = db.conversation.update().with(db.conversation.jid_id, "=", db.get_jid_id(counterpart)) - .with(db.conversation.account_id, "=", account.id) - .set(db.conversation.type_, type_) - .set(db.conversation.encryption, encryption) - //.set(conversation.read_up_to, changed_conversation.read_up_to) - .set(db.conversation.active, active); - if (last_active != null) { - update.set(db.conversation.last_active, (long) last_active.to_unix()); - } else { - update.set_null(db.conversation.last_active); + .with(db.conversation.account_id, "=", account.id); + switch (sp.name) { + case "type_": + update.set(db.conversation.type_, type_); break; + case "encryption": + update.set(db.conversation.encryption, encryption); break; + case "read_up_to": + update.set(db.conversation.read_up_to, read_up_to.id); break; + case "active": + update.set(db.conversation.active, active); break; + case "last_active": + if (last_active != null) { + update.set(db.conversation.last_active, (long) last_active.to_unix()); + } else { + update.set_null(db.conversation.last_active); + } + break; } update.perform(); } |