aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity/settings.vala
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/entity/settings.vala')
-rw-r--r--libdino/src/entity/settings.vala18
1 files changed, 18 insertions, 0 deletions
diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala
index 0b09e9b9..be275efc 100644
--- a/libdino/src/entity/settings.vala
+++ b/libdino/src/entity/settings.vala
@@ -79,6 +79,24 @@ public class Settings : Object {
check_spelling_ = value;
}
}
+
+ public Encryption get_default_encryption(Account account) {
+ string? setting = db.account_settings.get_value(account.id, "default-encryption");
+ if (setting != null) {
+ return (Encryption) int.parse(setting);
+ }
+ return Encryption.NONE;
+ }
+
+ public void set_default_encryption(Account account, Encryption encryption) {
+ db.account_settings.upsert()
+ .value(db.account_settings.key, "default-encryption", true)
+ .value(db.account_settings.account_id, account.id, true)
+ .value(db.account_settings.value, ((int)encryption).to_string())
+ .perform();
+
+
+ }
}
}