summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-06-22 13:54:17 +0100
committerDavid Baker <dave@matrix.org>2018-06-22 13:54:17 +0100
commitfd28d13e19939c4d0bc29a8b9f6c122162058b84 (patch)
tree54f27bfaba300bfe47afff27e22174183e633462 /synapse/handlers/room.py
parentMerge pull request #3202 from matrix-org/michaelkaye/domain_based_rule_checker (diff)
downloadsynapse-fd28d13e19939c4d0bc29a8b9f6c122162058b84.tar.xz
Server-enforced e2e for private rooms
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 8df8fcbbad..a66433ad55 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -46,12 +46,14 @@ class RoomCreationHandler(BaseHandler):
             "history_visibility": "shared",
             "original_invitees_have_ops": False,
             "guest_can_join": True,
+            "encryption_alg": "m.megolm.v1.aes-sha2",
         },
         RoomCreationPreset.TRUSTED_PRIVATE_CHAT: {
             "join_rules": JoinRules.INVITE,
             "history_visibility": "shared",
             "original_invitees_have_ops": True,
             "guest_can_join": True,
+            "encryption_alg": "m.megolm.v1.aes-sha2",
         },
         RoomCreationPreset.PUBLIC_CHAT: {
             "join_rules": JoinRules.PUBLIC,
@@ -373,6 +375,15 @@ class RoomCreationHandler(BaseHandler):
                 content=content,
             )
 
+        if "encryption_alg" in config:
+            send(
+                etype="m.room.encryption",
+                state_key="",
+                content={
+                    'algorithm': config["encryption_alg"],
+                }
+            )
+
 
 class RoomContextHandler(BaseHandler):
     @defer.inlineCallbacks