diff options
author | eerielili <lionel@les-miquelots.net> | 2024-08-25 13:32:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-25 13:32:38 +0000 |
commit | 45755727db79a2935376d24e7bde7eadb0f2f7ca (patch) | |
tree | 73715da99c9d980079df6f2d561822364655e04d /libdino/src/entity/settings.vala | |
parent | 62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff) | |
parent | 51252f74c94c17d56aa75534652bdc5d43a504cb (diff) | |
download | dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.tar.gz dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.zip |
Merge branch 'master' into add-yourselfadd-yourself
Diffstat (limited to 'libdino/src/entity/settings.vala')
-rw-r--r-- | libdino/src/entity/settings.vala | 18 |
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(); + + + } } } |