From 2ea24485853160c1b86632a0a7371132bcb280cb Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 7 Nov 2019 13:32:35 +0000 Subject: [PATCH 1/4] 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: From 20f576ba9bccb97e425d07a802de05bb1bb2ac53 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 7 Nov 2019 13:33:43 +0000 Subject: [PATCH 2/4] Fix typo --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index bc0a391..662bea2 100644 --- a/config.py +++ b/config.py @@ -63,7 +63,7 @@ class Config(object): 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 + "matrix.device_id is not provided, which means that end-to-end" " encryption won't work correctly" ) From 1ba710fd7b41e1871df1258932a1b7c4e3886180 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 7 Nov 2019 14:37:25 +0000 Subject: [PATCH 3/4] Update config.py Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 662bea2..df2993f 100644 --- a/config.py +++ b/config.py @@ -63,7 +63,7 @@ class Config(object): 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" + "Config option matrix.device_id is not provided, which means " " encryption won't work correctly" ) From 51469ae70924bfbbf747c652a72b016336f8f149 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 7 Nov 2019 14:37:31 +0000 Subject: [PATCH 4/4] Update config.py Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index df2993f..bc63f83 100644 --- a/config.py +++ b/config.py @@ -64,7 +64,7 @@ class Config(object): if not self.device_id: logger.warning( "Config option matrix.device_id is not provided, which means " - " encryption won't work correctly" + "that end-to-end encryption won't work correctly" ) self.homeserver_url = matrix.get("homeserver_url")