Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Server-enforced e2e for private rooms #3426

Merged
merged 2 commits into from
Jun 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -373,6 +375,15 @@ def send(etype, content, **kwargs):
content=content,
)

if "encryption_alg" in config:
send(
etype="m.room.encryption",
Copy link
Member

@ara4n ara4n Jun 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the standard in synapse is to put all event types in Types

state_key="",
content={
'algorithm': config["encryption_alg"],
}
)


class RoomContextHandler(BaseHandler):
@defer.inlineCallbacks
Expand Down