@@ -51,11 +51,11 @@ class RoomDisposition:
51
51
class RoomVersion :
52
52
"""An object which describes the unique attributes of a room version."""
53
53
54
- identifier = attr .ib () # str; the identifier for this version
55
- disposition = attr .ib () # str; one of the RoomDispositions
56
- event_format = attr .ib () # int; one of the EventFormatVersions
57
- state_res = attr .ib () # int; one of the StateResolutionVersions
58
- enforce_key_validity = attr .ib () # bool
54
+ identifier = attr .ib (type = str ) # the identifier for this version
55
+ disposition = attr .ib (type = str ) # one of the RoomDispositions
56
+ event_format = attr .ib (type = int ) # one of the EventFormatVersions
57
+ state_res = attr .ib (type = int ) # one of the StateResolutionVersions
58
+ enforce_key_validity = attr .ib (type = bool )
59
59
60
60
# bool: before MSC2261/MSC2432, m.room.aliases had special auth rules and redaction rules
61
61
special_case_aliases_auth = attr .ib (type = bool )
@@ -64,9 +64,11 @@ class RoomVersion:
64
64
# * Floats
65
65
# * NaN, Infinity, -Infinity
66
66
strict_canonicaljson = attr .ib (type = bool )
67
- # bool: MSC2209: Check 'notifications' key while verifying
67
+ # MSC2209: Check 'notifications' key while verifying
68
68
# m.room.power_levels auth rules.
69
69
limit_notifications_power_levels = attr .ib (type = bool )
70
+ # MSC2174/MSC2176: Apply updated redaction rules algorithm.
71
+ msc2176_redaction_rules = attr .ib (type = bool )
70
72
71
73
72
74
class RoomVersions :
@@ -79,6 +81,7 @@ class RoomVersions:
79
81
special_case_aliases_auth = True ,
80
82
strict_canonicaljson = False ,
81
83
limit_notifications_power_levels = False ,
84
+ msc2176_redaction_rules = False ,
82
85
)
83
86
V2 = RoomVersion (
84
87
"2" ,
@@ -89,6 +92,7 @@ class RoomVersions:
89
92
special_case_aliases_auth = True ,
90
93
strict_canonicaljson = False ,
91
94
limit_notifications_power_levels = False ,
95
+ msc2176_redaction_rules = False ,
92
96
)
93
97
V3 = RoomVersion (
94
98
"3" ,
@@ -99,6 +103,7 @@ class RoomVersions:
99
103
special_case_aliases_auth = True ,
100
104
strict_canonicaljson = False ,
101
105
limit_notifications_power_levels = False ,
106
+ msc2176_redaction_rules = False ,
102
107
)
103
108
V4 = RoomVersion (
104
109
"4" ,
@@ -109,6 +114,7 @@ class RoomVersions:
109
114
special_case_aliases_auth = True ,
110
115
strict_canonicaljson = False ,
111
116
limit_notifications_power_levels = False ,
117
+ msc2176_redaction_rules = False ,
112
118
)
113
119
V5 = RoomVersion (
114
120
"5" ,
@@ -119,6 +125,7 @@ class RoomVersions:
119
125
special_case_aliases_auth = True ,
120
126
strict_canonicaljson = False ,
121
127
limit_notifications_power_levels = False ,
128
+ msc2176_redaction_rules = False ,
122
129
)
123
130
V6 = RoomVersion (
124
131
"6" ,
@@ -129,6 +136,18 @@ class RoomVersions:
129
136
special_case_aliases_auth = False ,
130
137
strict_canonicaljson = True ,
131
138
limit_notifications_power_levels = True ,
139
+ msc2176_redaction_rules = False ,
140
+ )
141
+ MSC2176 = RoomVersion (
142
+ "org.matrix.msc2176" ,
143
+ RoomDisposition .UNSTABLE ,
144
+ EventFormatVersions .V3 ,
145
+ StateResolutionVersions .V2 ,
146
+ enforce_key_validity = True ,
147
+ special_case_aliases_auth = False ,
148
+ strict_canonicaljson = True ,
149
+ limit_notifications_power_levels = True ,
150
+ msc2176_redaction_rules = True ,
132
151
)
133
152
134
153
@@ -141,5 +160,6 @@ class RoomVersions:
141
160
RoomVersions .V4 ,
142
161
RoomVersions .V5 ,
143
162
RoomVersions .V6 ,
163
+ RoomVersions .MSC2176 ,
144
164
)
145
165
} # type: Dict[str, RoomVersion]
0 commit comments