Implement enabling encryption when creating room

This commit is contained in:
miruka 2019-11-09 13:37:51 -04:00
parent e7283f48f1
commit b34387ad79

View File

@ -453,7 +453,7 @@ class MatrixClient(nio.AsyncClient):
name: Optional[str] = None, name: Optional[str] = None,
topic: Optional[str] = None, topic: Optional[str] = None,
public: bool = False, public: bool = False,
encrypt: bool = False, # TODO encrypt: bool = False,
federate: bool = True, federate: bool = True,
) -> str: ) -> str:
@ -464,6 +464,8 @@ class MatrixClient(nio.AsyncClient):
visibility = visibility =
nio.RoomVisibility.public if public else nio.RoomVisibility.public if public else
nio.RoomVisibility.private, nio.RoomVisibility.private,
initial_state =
[nio.EnableEncryptionBuilder().as_dict()] if encrypt else [],
) )
if isinstance(response, nio.RoomCreateError): if isinstance(response, nio.RoomCreateError):