From 19bfee1835ba89246ec9e3e703ceb5c2f8dc6711 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20K=C3=B6sters?= <timo@koesters.xyz>
Date: Thu, 10 Aug 2023 17:45:58 +0200
Subject: [PATCH] improvement: matrix.org is default trusted server if
 unspecified

---
 src/config/mod.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/config/mod.rs b/src/config/mod.rs
index 9128c529..a4d7cca4 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -65,7 +65,7 @@ pub struct Config {
     #[serde(default)]
     pub proxy: ProxyConfig,
     pub jwt_secret: Option<String>,
-    #[serde(default = "Vec::new")]
+    #[serde(default = "default_trusted_servers")]
     pub trusted_servers: Vec<OwnedServerName>,
     #[serde(default = "default_log")]
     pub log: String,
@@ -259,6 +259,10 @@ fn default_max_fetch_prev_events() -> u16 {
     100_u16
 }
 
+fn default_trusted_servers() -> Vec<OwnedServerName> {
+    vec![OwnedServerName::try_from("matrix.org").unwrap()]
+}
+
 fn default_log() -> String {
     "warn,state_res=warn,_=off,sled=off".to_owned()
 }