aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity/settings.vala
diff options
context:
space:
mode:
authoreerielili <lionel@les-miquelots.net>2024-08-25 13:32:38 +0000
committerGitHub <noreply@github.com>2024-08-25 13:32:38 +0000
commit45755727db79a2935376d24e7bde7eadb0f2f7ca (patch)
tree73715da99c9d980079df6f2d561822364655e04d /libdino/src/entity/settings.vala
parent62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff)
parent51252f74c94c17d56aa75534652bdc5d43a504cb (diff)
downloaddino-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.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();
+
+
+ }
}
}