12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- from typing import Callable , Dict , Optional
15
+ from typing import Callable , Dict , List , Optional
16
16
17
17
import attr
18
18
@@ -91,6 +91,12 @@ class RoomVersion:
91
91
msc3787_knock_restricted_join_rule : bool
92
92
# MSC3667: Enforce integer power levels
93
93
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 ]
94
100
95
101
96
102
class RoomVersions :
@@ -111,6 +117,7 @@ class RoomVersions:
111
117
msc2716_redactions = False ,
112
118
msc3787_knock_restricted_join_rule = False ,
113
119
msc3667_int_only_power_levels = False ,
120
+ msc3931_push_features = [],
114
121
)
115
122
V2 = RoomVersion (
116
123
"2" ,
@@ -129,6 +136,7 @@ class RoomVersions:
129
136
msc2716_redactions = False ,
130
137
msc3787_knock_restricted_join_rule = False ,
131
138
msc3667_int_only_power_levels = False ,
139
+ msc3931_push_features = [],
132
140
)
133
141
V3 = RoomVersion (
134
142
"3" ,
@@ -147,6 +155,7 @@ class RoomVersions:
147
155
msc2716_redactions = False ,
148
156
msc3787_knock_restricted_join_rule = False ,
149
157
msc3667_int_only_power_levels = False ,
158
+ msc3931_push_features = [],
150
159
)
151
160
V4 = RoomVersion (
152
161
"4" ,
@@ -165,6 +174,7 @@ class RoomVersions:
165
174
msc2716_redactions = False ,
166
175
msc3787_knock_restricted_join_rule = False ,
167
176
msc3667_int_only_power_levels = False ,
177
+ msc3931_push_features = [],
168
178
)
169
179
V5 = RoomVersion (
170
180
"5" ,
@@ -183,6 +193,7 @@ class RoomVersions:
183
193
msc2716_redactions = False ,
184
194
msc3787_knock_restricted_join_rule = False ,
185
195
msc3667_int_only_power_levels = False ,
196
+ msc3931_push_features = [],
186
197
)
187
198
V6 = RoomVersion (
188
199
"6" ,
@@ -201,6 +212,7 @@ class RoomVersions:
201
212
msc2716_redactions = False ,
202
213
msc3787_knock_restricted_join_rule = False ,
203
214
msc3667_int_only_power_levels = False ,
215
+ msc3931_push_features = [],
204
216
)
205
217
MSC2176 = RoomVersion (
206
218
"org.matrix.msc2176" ,
@@ -219,6 +231,7 @@ class RoomVersions:
219
231
msc2716_redactions = False ,
220
232
msc3787_knock_restricted_join_rule = False ,
221
233
msc3667_int_only_power_levels = False ,
234
+ msc3931_push_features = [],
222
235
)
223
236
V7 = RoomVersion (
224
237
"7" ,
@@ -237,6 +250,7 @@ class RoomVersions:
237
250
msc2716_redactions = False ,
238
251
msc3787_knock_restricted_join_rule = False ,
239
252
msc3667_int_only_power_levels = False ,
253
+ msc3931_push_features = [],
240
254
)
241
255
V8 = RoomVersion (
242
256
"8" ,
@@ -255,6 +269,7 @@ class RoomVersions:
255
269
msc2716_redactions = False ,
256
270
msc3787_knock_restricted_join_rule = False ,
257
271
msc3667_int_only_power_levels = False ,
272
+ msc3931_push_features = [],
258
273
)
259
274
V9 = RoomVersion (
260
275
"9" ,
@@ -273,6 +288,7 @@ class RoomVersions:
273
288
msc2716_redactions = False ,
274
289
msc3787_knock_restricted_join_rule = False ,
275
290
msc3667_int_only_power_levels = False ,
291
+ msc3931_push_features = [],
276
292
)
277
293
MSC3787 = RoomVersion (
278
294
"org.matrix.msc3787" ,
@@ -291,6 +307,7 @@ class RoomVersions:
291
307
msc2716_redactions = False ,
292
308
msc3787_knock_restricted_join_rule = True ,
293
309
msc3667_int_only_power_levels = False ,
310
+ msc3931_push_features = [],
294
311
)
295
312
V10 = RoomVersion (
296
313
"10" ,
@@ -309,6 +326,7 @@ class RoomVersions:
309
326
msc2716_redactions = False ,
310
327
msc3787_knock_restricted_join_rule = True ,
311
328
msc3667_int_only_power_levels = True ,
329
+ msc3931_push_features = [],
312
330
)
313
331
MSC2716v4 = RoomVersion (
314
332
"org.matrix.msc2716v4" ,
@@ -327,6 +345,7 @@ class RoomVersions:
327
345
msc2716_redactions = True ,
328
346
msc3787_knock_restricted_join_rule = False ,
329
347
msc3667_int_only_power_levels = False ,
348
+ msc3931_push_features = [],
330
349
)
331
350
332
351
0 commit comments