fixes #661 and also contains a cleanup of config access (only for e2ee and mdns)

This commit is contained in:
holger krekel
2019-10-02 20:30:41 +02:00
parent 92438737c9
commit 5c1b9c83f7
7 changed files with 17 additions and 45 deletions

View File

@@ -46,12 +46,8 @@ pub struct EncryptHelper {
impl EncryptHelper {
pub fn new(context: &Context) -> Result<EncryptHelper> {
let prefer_encrypt = context
.sql
.get_config_int(&context, "e2ee_enabled")
.and_then(EncryptPreference::from_i32)
.unwrap_or_default();
let prefer_encrypt =
EncryptPreference::from_i32(context.get_config_int(Config::E2eeEnabled)).unwrap();
let addr = match context.get_config(Config::ConfiguredAddr) {
None => {
bail!("addr not configured!");