1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- from typing import Callable , Dict , Optional
15+ from typing import Callable , Dict , List , Optional
1616
1717import attr
1818
@@ -91,6 +91,12 @@ class RoomVersion:
9191 msc3787_knock_restricted_join_rule : bool
9292 # MSC3667: Enforce integer power levels
9393 msc3667_int_only_power_levels : bool
94+ # MSC3931: Adds a push rule condition for "room version feature flags", making
95+ # some push rules room version dependent. Note that adding a flag to this list
96+ # is not enough to mark it "supported": the push rule evaluator also needs to
97+ # support the flag. Unknown flags are ignored by the evaluator, making conditions
98+ # fail if used.
99+ msc3931_push_features : List [str ]
94100
95101
96102class RoomVersions :
@@ -111,6 +117,7 @@ class RoomVersions:
111117 msc2716_redactions = False ,
112118 msc3787_knock_restricted_join_rule = False ,
113119 msc3667_int_only_power_levels = False ,
120+ msc3931_push_features = [],
114121 )
115122 V2 = RoomVersion (
116123 "2" ,
@@ -129,6 +136,7 @@ class RoomVersions:
129136 msc2716_redactions = False ,
130137 msc3787_knock_restricted_join_rule = False ,
131138 msc3667_int_only_power_levels = False ,
139+ msc3931_push_features = [],
132140 )
133141 V3 = RoomVersion (
134142 "3" ,
@@ -147,6 +155,7 @@ class RoomVersions:
147155 msc2716_redactions = False ,
148156 msc3787_knock_restricted_join_rule = False ,
149157 msc3667_int_only_power_levels = False ,
158+ msc3931_push_features = [],
150159 )
151160 V4 = RoomVersion (
152161 "4" ,
@@ -165,6 +174,7 @@ class RoomVersions:
165174 msc2716_redactions = False ,
166175 msc3787_knock_restricted_join_rule = False ,
167176 msc3667_int_only_power_levels = False ,
177+ msc3931_push_features = [],
168178 )
169179 V5 = RoomVersion (
170180 "5" ,
@@ -183,6 +193,7 @@ class RoomVersions:
183193 msc2716_redactions = False ,
184194 msc3787_knock_restricted_join_rule = False ,
185195 msc3667_int_only_power_levels = False ,
196+ msc3931_push_features = [],
186197 )
187198 V6 = RoomVersion (
188199 "6" ,
@@ -201,6 +212,7 @@ class RoomVersions:
201212 msc2716_redactions = False ,
202213 msc3787_knock_restricted_join_rule = False ,
203214 msc3667_int_only_power_levels = False ,
215+ msc3931_push_features = [],
204216 )
205217 MSC2176 = RoomVersion (
206218 "org.matrix.msc2176" ,
@@ -219,6 +231,7 @@ class RoomVersions:
219231 msc2716_redactions = False ,
220232 msc3787_knock_restricted_join_rule = False ,
221233 msc3667_int_only_power_levels = False ,
234+ msc3931_push_features = [],
222235 )
223236 V7 = RoomVersion (
224237 "7" ,
@@ -237,6 +250,7 @@ class RoomVersions:
237250 msc2716_redactions = False ,
238251 msc3787_knock_restricted_join_rule = False ,
239252 msc3667_int_only_power_levels = False ,
253+ msc3931_push_features = [],
240254 )
241255 V8 = RoomVersion (
242256 "8" ,
@@ -255,6 +269,7 @@ class RoomVersions:
255269 msc2716_redactions = False ,
256270 msc3787_knock_restricted_join_rule = False ,
257271 msc3667_int_only_power_levels = False ,
272+ msc3931_push_features = [],
258273 )
259274 V9 = RoomVersion (
260275 "9" ,
@@ -273,6 +288,7 @@ class RoomVersions:
273288 msc2716_redactions = False ,
274289 msc3787_knock_restricted_join_rule = False ,
275290 msc3667_int_only_power_levels = False ,
291+ msc3931_push_features = [],
276292 )
277293 MSC3787 = RoomVersion (
278294 "org.matrix.msc3787" ,
@@ -291,6 +307,7 @@ class RoomVersions:
291307 msc2716_redactions = False ,
292308 msc3787_knock_restricted_join_rule = True ,
293309 msc3667_int_only_power_levels = False ,
310+ msc3931_push_features = [],
294311 )
295312 V10 = RoomVersion (
296313 "10" ,
@@ -309,6 +326,7 @@ class RoomVersions:
309326 msc2716_redactions = False ,
310327 msc3787_knock_restricted_join_rule = True ,
311328 msc3667_int_only_power_levels = True ,
329+ msc3931_push_features = [],
312330 )
313331 MSC2716v4 = RoomVersion (
314332 "org.matrix.msc2716v4" ,
@@ -327,6 +345,7 @@ class RoomVersions:
327345 msc2716_redactions = True ,
328346 msc3787_knock_restricted_join_rule = False ,
329347 msc3667_int_only_power_levels = False ,
348+ msc3931_push_features = [],
330349 )
331350
332351
0 commit comments