From 2ea24485853160c1b86632a0a7371132bcb280cb Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 7 Nov 2019 13:32:35 +0000 Subject: [PATCH] Remove the default value for device_id nio doesn't need a device_id unless E2EE is used, so the correct behaviour should be to default it to `None` and, if it's missing, warn the user of what might happen. --- config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 6be3e7a..bc0a391 100644 --- a/config.py +++ b/config.py @@ -60,7 +60,12 @@ class Config(object): if not self.access_token: raise ConfigError("matrix.access_token is a required field") - self.device_id = matrix.get("device_id", "cribbage bot") + self.device_id = matrix.get("device_id") + if not self.device_id: + logger.warning( + "matrix.device_id is not provided, which means that end-to-end + " encryption won't work correctly" + ) self.homeserver_url = matrix.get("homeserver_url") if not self.homeserver_url: