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

Commit 0d6714d

Browse files
committed
Rename room version flags that are stable.
1 parent 6379048 commit 0d6714d

File tree

12 files changed

+118
-120
lines changed

12 files changed

+118
-120
lines changed

synapse/api/room_versions.py

Lines changed: 88 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,23 @@ class RoomVersion:
7878
# MSC2209: Check 'notifications' key while verifying
7979
# m.room.power_levels auth rules.
8080
limit_notifications_power_levels: bool
81-
# MSC2175: No longer include the creator in m.room.create events.
82-
msc2175_implicit_room_creator: bool
83-
# Apply updated redaction rules algorithm from MSC2174/MSC2176/MSC3821/MSC3989.
81+
# No longer include the creator in m.room.create events.
82+
implicit_room_creator: bool
83+
# Apply updated redaction rules algorithm from room version 11.
8484
updated_redaction_rules: bool
85-
# MSC3083: Support the 'restricted' join_rule.
86-
msc3083_join_rules: bool
87-
# MSC3375: Support for the proper redaction rules for MSC3083. This mustn't
88-
# be enabled if MSC3083 is not.
89-
msc3375_redaction_rules: bool
90-
# MSC2403: Allows join_rules to be set to 'knock', changes auth rules to allow sending
91-
# m.room.membership event with membership 'knock'.
92-
msc2403_knocking: bool
85+
# Support the 'restricted' join rule.
86+
restricted_join_rule: bool
87+
# Support for the proper redaction rules for the restricted join rule. This requires
88+
# restricted_join_rule to be enabled.
89+
restricted_join_rule_fix: bool
90+
# Support the 'knock' join rule.
91+
knock_join_rule: bool
9392
# MSC3389: Protect relation information from redaction.
9493
msc3389_relation_redactions: bool
95-
# MSC3787: Adds support for a `knock_restricted` join rule, mixing concepts of
96-
# knocks and restricted join rules into the same join condition.
97-
msc3787_knock_restricted_join_rule: bool
98-
# MSC3667: Enforce integer power levels
99-
msc3667_int_only_power_levels: bool
94+
# Support the 'knock_restricted' join rule.
95+
knock_restricted_join_rule: bool
96+
# Enforce integer power levels
97+
enforce_int_power_levels: bool
10098
# MSC3931: Adds a push rule condition for "room version feature flags", making
10199
# some push rules room version dependent. Note that adding a flag to this list
102100
# is not enough to mark it "supported": the push rule evaluator also needs to
@@ -115,14 +113,14 @@ class RoomVersions:
115113
special_case_aliases_auth=True,
116114
strict_canonicaljson=False,
117115
limit_notifications_power_levels=False,
118-
msc2175_implicit_room_creator=False,
116+
implicit_room_creator=False,
119117
updated_redaction_rules=False,
120-
msc3083_join_rules=False,
121-
msc3375_redaction_rules=False,
122-
msc2403_knocking=False,
118+
restricted_join_rule=False,
119+
restricted_join_rule_fix=False,
120+
knock_join_rule=False,
123121
msc3389_relation_redactions=False,
124-
msc3787_knock_restricted_join_rule=False,
125-
msc3667_int_only_power_levels=False,
122+
knock_restricted_join_rule=False,
123+
enforce_int_power_levels=False,
126124
msc3931_push_features=(),
127125
)
128126
V2 = RoomVersion(
@@ -134,14 +132,14 @@ class RoomVersions:
134132
special_case_aliases_auth=True,
135133
strict_canonicaljson=False,
136134
limit_notifications_power_levels=False,
137-
msc2175_implicit_room_creator=False,
135+
implicit_room_creator=False,
138136
updated_redaction_rules=False,
139-
msc3083_join_rules=False,
140-
msc3375_redaction_rules=False,
141-
msc2403_knocking=False,
137+
restricted_join_rule=False,
138+
restricted_join_rule_fix=False,
139+
knock_join_rule=False,
142140
msc3389_relation_redactions=False,
143-
msc3787_knock_restricted_join_rule=False,
144-
msc3667_int_only_power_levels=False,
141+
knock_restricted_join_rule=False,
142+
enforce_int_power_levels=False,
145143
msc3931_push_features=(),
146144
)
147145
V3 = RoomVersion(
@@ -153,14 +151,14 @@ class RoomVersions:
153151
special_case_aliases_auth=True,
154152
strict_canonicaljson=False,
155153
limit_notifications_power_levels=False,
156-
msc2175_implicit_room_creator=False,
154+
implicit_room_creator=False,
157155
updated_redaction_rules=False,
158-
msc3083_join_rules=False,
159-
msc3375_redaction_rules=False,
160-
msc2403_knocking=False,
156+
restricted_join_rule=False,
157+
restricted_join_rule_fix=False,
158+
knock_join_rule=False,
161159
msc3389_relation_redactions=False,
162-
msc3787_knock_restricted_join_rule=False,
163-
msc3667_int_only_power_levels=False,
160+
knock_restricted_join_rule=False,
161+
enforce_int_power_levels=False,
164162
msc3931_push_features=(),
165163
)
166164
V4 = RoomVersion(
@@ -172,14 +170,14 @@ class RoomVersions:
172170
special_case_aliases_auth=True,
173171
strict_canonicaljson=False,
174172
limit_notifications_power_levels=False,
175-
msc2175_implicit_room_creator=False,
173+
implicit_room_creator=False,
176174
updated_redaction_rules=False,
177-
msc3083_join_rules=False,
178-
msc3375_redaction_rules=False,
179-
msc2403_knocking=False,
175+
restricted_join_rule=False,
176+
restricted_join_rule_fix=False,
177+
knock_join_rule=False,
180178
msc3389_relation_redactions=False,
181-
msc3787_knock_restricted_join_rule=False,
182-
msc3667_int_only_power_levels=False,
179+
knock_restricted_join_rule=False,
180+
enforce_int_power_levels=False,
183181
msc3931_push_features=(),
184182
)
185183
V5 = RoomVersion(
@@ -191,14 +189,14 @@ class RoomVersions:
191189
special_case_aliases_auth=True,
192190
strict_canonicaljson=False,
193191
limit_notifications_power_levels=False,
194-
msc2175_implicit_room_creator=False,
192+
implicit_room_creator=False,
195193
updated_redaction_rules=False,
196-
msc3083_join_rules=False,
197-
msc3375_redaction_rules=False,
198-
msc2403_knocking=False,
194+
restricted_join_rule=False,
195+
restricted_join_rule_fix=False,
196+
knock_join_rule=False,
199197
msc3389_relation_redactions=False,
200-
msc3787_knock_restricted_join_rule=False,
201-
msc3667_int_only_power_levels=False,
198+
knock_restricted_join_rule=False,
199+
enforce_int_power_levels=False,
202200
msc3931_push_features=(),
203201
)
204202
V6 = RoomVersion(
@@ -210,14 +208,14 @@ class RoomVersions:
210208
special_case_aliases_auth=False,
211209
strict_canonicaljson=True,
212210
limit_notifications_power_levels=True,
213-
msc2175_implicit_room_creator=False,
211+
implicit_room_creator=False,
214212
updated_redaction_rules=False,
215-
msc3083_join_rules=False,
216-
msc3375_redaction_rules=False,
217-
msc2403_knocking=False,
213+
restricted_join_rule=False,
214+
restricted_join_rule_fix=False,
215+
knock_join_rule=False,
218216
msc3389_relation_redactions=False,
219-
msc3787_knock_restricted_join_rule=False,
220-
msc3667_int_only_power_levels=False,
217+
knock_restricted_join_rule=False,
218+
enforce_int_power_levels=False,
221219
msc3931_push_features=(),
222220
)
223221
V7 = RoomVersion(
@@ -229,14 +227,14 @@ class RoomVersions:
229227
special_case_aliases_auth=False,
230228
strict_canonicaljson=True,
231229
limit_notifications_power_levels=True,
232-
msc2175_implicit_room_creator=False,
230+
implicit_room_creator=False,
233231
updated_redaction_rules=False,
234-
msc3083_join_rules=False,
235-
msc3375_redaction_rules=False,
236-
msc2403_knocking=True,
232+
restricted_join_rule=False,
233+
restricted_join_rule_fix=False,
234+
knock_join_rule=True,
237235
msc3389_relation_redactions=False,
238-
msc3787_knock_restricted_join_rule=False,
239-
msc3667_int_only_power_levels=False,
236+
knock_restricted_join_rule=False,
237+
enforce_int_power_levels=False,
240238
msc3931_push_features=(),
241239
)
242240
V8 = RoomVersion(
@@ -248,14 +246,14 @@ class RoomVersions:
248246
special_case_aliases_auth=False,
249247
strict_canonicaljson=True,
250248
limit_notifications_power_levels=True,
251-
msc2175_implicit_room_creator=False,
249+
implicit_room_creator=False,
252250
updated_redaction_rules=False,
253-
msc3083_join_rules=True,
254-
msc3375_redaction_rules=False,
255-
msc2403_knocking=True,
251+
restricted_join_rule=True,
252+
restricted_join_rule_fix=False,
253+
knock_join_rule=True,
256254
msc3389_relation_redactions=False,
257-
msc3787_knock_restricted_join_rule=False,
258-
msc3667_int_only_power_levels=False,
255+
knock_restricted_join_rule=False,
256+
enforce_int_power_levels=False,
259257
msc3931_push_features=(),
260258
)
261259
V9 = RoomVersion(
@@ -267,14 +265,14 @@ class RoomVersions:
267265
special_case_aliases_auth=False,
268266
strict_canonicaljson=True,
269267
limit_notifications_power_levels=True,
270-
msc2175_implicit_room_creator=False,
268+
implicit_room_creator=False,
271269
updated_redaction_rules=False,
272-
msc3083_join_rules=True,
273-
msc3375_redaction_rules=True,
274-
msc2403_knocking=True,
270+
restricted_join_rule=True,
271+
restricted_join_rule_fix=True,
272+
knock_join_rule=True,
275273
msc3389_relation_redactions=False,
276-
msc3787_knock_restricted_join_rule=False,
277-
msc3667_int_only_power_levels=False,
274+
knock_restricted_join_rule=False,
275+
enforce_int_power_levels=False,
278276
msc3931_push_features=(),
279277
)
280278
V10 = RoomVersion(
@@ -286,14 +284,14 @@ class RoomVersions:
286284
special_case_aliases_auth=False,
287285
strict_canonicaljson=True,
288286
limit_notifications_power_levels=True,
289-
msc2175_implicit_room_creator=False,
287+
implicit_room_creator=False,
290288
updated_redaction_rules=False,
291-
msc3083_join_rules=True,
292-
msc3375_redaction_rules=True,
293-
msc2403_knocking=True,
289+
restricted_join_rule=True,
290+
restricted_join_rule_fix=True,
291+
knock_join_rule=True,
294292
msc3389_relation_redactions=False,
295-
msc3787_knock_restricted_join_rule=True,
296-
msc3667_int_only_power_levels=True,
293+
knock_restricted_join_rule=True,
294+
enforce_int_power_levels=True,
297295
msc3931_push_features=(),
298296
)
299297
MSC1767v10 = RoomVersion(
@@ -306,14 +304,14 @@ class RoomVersions:
306304
special_case_aliases_auth=False,
307305
strict_canonicaljson=True,
308306
limit_notifications_power_levels=True,
309-
msc2175_implicit_room_creator=False,
307+
implicit_room_creator=False,
310308
updated_redaction_rules=False,
311-
msc3083_join_rules=True,
312-
msc3375_redaction_rules=True,
313-
msc2403_knocking=True,
309+
restricted_join_rule=True,
310+
restricted_join_rule_fix=True,
311+
knock_join_rule=True,
314312
msc3389_relation_redactions=False,
315-
msc3787_knock_restricted_join_rule=True,
316-
msc3667_int_only_power_levels=True,
313+
knock_restricted_join_rule=True,
314+
enforce_int_power_levels=True,
317315
msc3931_push_features=(PushRuleRoomFlag.EXTENSIBLE_EVENTS,),
318316
)
319317
V11 = RoomVersion(
@@ -325,14 +323,14 @@ class RoomVersions:
325323
special_case_aliases_auth=False,
326324
strict_canonicaljson=True,
327325
limit_notifications_power_levels=True,
328-
msc2175_implicit_room_creator=True, # Used by MSC3820
326+
implicit_room_creator=True, # Used by MSC3820
329327
updated_redaction_rules=True, # Used by MSC3820
330-
msc3083_join_rules=True,
331-
msc3375_redaction_rules=True,
332-
msc2403_knocking=True,
328+
restricted_join_rule=True,
329+
restricted_join_rule_fix=True,
330+
knock_join_rule=True,
333331
msc3389_relation_redactions=False,
334-
msc3787_knock_restricted_join_rule=True,
335-
msc3667_int_only_power_levels=True,
332+
knock_restricted_join_rule=True,
333+
enforce_int_power_levels=True,
336334
msc3931_push_features=(),
337335
)
338336

@@ -379,12 +377,12 @@ class RoomVersionCapability:
379377
RoomVersionCapability(
380378
"knock",
381379
RoomVersions.V7,
382-
lambda room_version: room_version.msc2403_knocking,
380+
lambda room_version: room_version.knock_join_rule,
383381
),
384382
RoomVersionCapability(
385383
"restricted",
386384
RoomVersions.V9,
387-
lambda room_version: room_version.msc3083_join_rules,
385+
lambda room_version: room_version.restricted_join_rule,
388386
),
389387
)
390388
}

0 commit comments

Comments
 (0)