From b34387ad79c1cce48c1ae47edfc6bb8e4f257375 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 9 Nov 2019 13:37:51 -0400 Subject: [PATCH] Implement enabling encryption when creating room --- src/python/matrix_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 79313f54..a778be01 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -453,7 +453,7 @@ class MatrixClient(nio.AsyncClient): name: Optional[str] = None, topic: Optional[str] = None, public: bool = False, - encrypt: bool = False, # TODO + encrypt: bool = False, federate: bool = True, ) -> str: @@ -464,6 +464,8 @@ class MatrixClient(nio.AsyncClient): visibility = nio.RoomVisibility.public if public else nio.RoomVisibility.private, + initial_state = + [nio.EnableEncryptionBuilder().as_dict()] if encrypt else [], ) if isinstance(response, nio.RoomCreateError):