@@ -56,7 +56,7 @@ class RoomVersion:
5656 state_res = attr .ib (type = int ) # one of the StateResolutionVersions
5757 enforce_key_validity = attr .ib (type = bool )
5858
59- # Before MSC2261/ MSC2432, m.room.aliases had special auth rules and redaction rules
59+ # Before MSC2432, m.room.aliases had special auth rules and redaction rules
6060 special_case_aliases_auth = attr .ib (type = bool )
6161 # Strictly enforce canonicaljson, do not allow:
6262 # * Integers outside the range of [-2 ^ 53 + 1, 2 ^ 53 - 1]
@@ -70,6 +70,9 @@ class RoomVersion:
7070 msc2176_redaction_rules = attr .ib (type = bool )
7171 # MSC3083: Support the 'restricted' join_rule.
7272 msc3083_join_rules = attr .ib (type = bool )
73+ # MSC2403: Allows join_rules to be set to 'knock', changes auth rules to allow sending
74+ # m.room.membership event with membership 'knock'.
75+ msc2403_knocking = attr .ib (type = bool )
7376
7477
7578class RoomVersions :
@@ -84,6 +87,7 @@ class RoomVersions:
8487 limit_notifications_power_levels = False ,
8588 msc2176_redaction_rules = False ,
8689 msc3083_join_rules = False ,
90+ msc2403_knocking = False ,
8791 )
8892 V2 = RoomVersion (
8993 "2" ,
@@ -96,6 +100,7 @@ class RoomVersions:
96100 limit_notifications_power_levels = False ,
97101 msc2176_redaction_rules = False ,
98102 msc3083_join_rules = False ,
103+ msc2403_knocking = False ,
99104 )
100105 V3 = RoomVersion (
101106 "3" ,
@@ -108,6 +113,7 @@ class RoomVersions:
108113 limit_notifications_power_levels = False ,
109114 msc2176_redaction_rules = False ,
110115 msc3083_join_rules = False ,
116+ msc2403_knocking = False ,
111117 )
112118 V4 = RoomVersion (
113119 "4" ,
@@ -120,6 +126,7 @@ class RoomVersions:
120126 limit_notifications_power_levels = False ,
121127 msc2176_redaction_rules = False ,
122128 msc3083_join_rules = False ,
129+ msc2403_knocking = False ,
123130 )
124131 V5 = RoomVersion (
125132 "5" ,
@@ -132,6 +139,7 @@ class RoomVersions:
132139 limit_notifications_power_levels = False ,
133140 msc2176_redaction_rules = False ,
134141 msc3083_join_rules = False ,
142+ msc2403_knocking = False ,
135143 )
136144 V6 = RoomVersion (
137145 "6" ,
@@ -144,6 +152,7 @@ class RoomVersions:
144152 limit_notifications_power_levels = True ,
145153 msc2176_redaction_rules = False ,
146154 msc3083_join_rules = False ,
155+ msc2403_knocking = False ,
147156 )
148157 MSC2176 = RoomVersion (
149158 "org.matrix.msc2176" ,
@@ -156,6 +165,7 @@ class RoomVersions:
156165 limit_notifications_power_levels = True ,
157166 msc2176_redaction_rules = True ,
158167 msc3083_join_rules = False ,
168+ msc2403_knocking = False ,
159169 )
160170 MSC3083 = RoomVersion (
161171 "org.matrix.msc3083" ,
@@ -168,6 +178,20 @@ class RoomVersions:
168178 limit_notifications_power_levels = True ,
169179 msc2176_redaction_rules = False ,
170180 msc3083_join_rules = True ,
181+ msc2403_knocking = False ,
182+ )
183+ MSC2403 = RoomVersion (
184+ "xyz.amorgan.knock" ,
185+ RoomDisposition .UNSTABLE ,
186+ EventFormatVersions .V3 ,
187+ StateResolutionVersions .V2 ,
188+ enforce_key_validity = True ,
189+ special_case_aliases_auth = False ,
190+ strict_canonicaljson = True ,
191+ limit_notifications_power_levels = True ,
192+ msc2176_redaction_rules = False ,
193+ msc3083_join_rules = False ,
194+ msc2403_knocking = True ,
171195 )
172196
173197
@@ -183,4 +207,5 @@ class RoomVersions:
183207 RoomVersions .MSC2176 ,
184208 RoomVersions .MSC3083 ,
185209 )
210+ # Note that we do not include MSC2043 here unless it is enabled in the config.
186211} # type: Dict[str, RoomVersion]
0 commit comments