This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ Update support for [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083) to consider changes in the MSC around which servers can issue join events.
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ def add_fields(*fields):
109109 add_fields ("creator" )
110110 elif event_type == EventTypes .JoinRules :
111111 add_fields ("join_rule" )
112+ if room_version .msc3083_join_rules :
113+ add_fields ("allow" )
112114 elif event_type == EventTypes .PowerLevels :
113115 add_fields (
114116 "users" ,
Original file line number Diff line number Diff line change @@ -301,6 +301,49 @@ def test_redacts(self):
301301 room_version = RoomVersions .MSC2176 ,
302302 )
303303
304+ def test_join_rules (self ):
305+ """Join rules events have changed behavior starting with MSC3083."""
306+ self .run_test (
307+ {
308+ "type" : "m.room.join_rules" ,
309+ "event_id" : "$test:domain" ,
310+ "content" : {
311+ "join_rule" : "invite" ,
312+ "allow" : [],
313+ "other_key" : "stripped" ,
314+ },
315+ },
316+ {
317+ "type" : "m.room.join_rules" ,
318+ "event_id" : "$test:domain" ,
319+ "content" : {"join_rule" : "invite" },
320+ "signatures" : {},
321+ "unsigned" : {},
322+ },
323+ )
324+
325+ # After MSC3083, alias events have no special behavior.
326+ self .run_test (
327+ {
328+ "type" : "m.room.join_rules" ,
329+ "content" : {
330+ "join_rule" : "invite" ,
331+ "allow" : [],
332+ "other_key" : "stripped" ,
333+ },
334+ },
335+ {
336+ "type" : "m.room.join_rules" ,
337+ "content" : {
338+ "join_rule" : "invite" ,
339+ "allow" : [],
340+ },
341+ "signatures" : {},
342+ "unsigned" : {},
343+ },
344+ room_version = RoomVersions .MSC3083 ,
345+ )
346+
304347
305348class SerializeEventTestCase (unittest .TestCase ):
306349 def serialize (self , ev , fields ):
You can’t perform that action at this time.
0 commit comments