diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py
index de7c56bc0f..82aeef8d19 100644
--- a/synapse/api/filtering.py
+++ b/synapse/api/filtering.py
@@ -128,20 +128,7 @@ USER_FILTER_SCHEMA = {
"account_data": {"$ref": "#/definitions/filter"},
"room": {"$ref": "#/definitions/room_filter"},
"event_format": {"type": "string", "enum": ["client", "federation"]},
- "event_fields": {
- "type": "array",
- "items": {
- "type": "string",
- # Don't allow '\\' in event field filters. This makes matching
- # events a lot easier as we can then use a negative lookbehind
- # assertion to split '\.' If we allowed \\ then it would
- # incorrectly split '\\.' See synapse.events.utils.serialize_event
- #
- # Note that because this is a regular expression, we have to escape
- # each backslash in the pattern.
- "pattern": r"^((?!\\\\).)*$",
- },
- },
+ "event_fields": {"type": "array", "items": {"type": "string"}},
},
"additionalProperties": True, # Allow new fields for forward compatibility
}
diff --git a/synapse/api/room_versions.py b/synapse/api/room_versions.py
index 7030b133d3..035a14171b 100644
--- a/synapse/api/room_versions.py
+++ b/synapse/api/room_versions.py
@@ -485,6 +485,30 @@ class RoomVersions:
msc3931_push_features=(),
msc3989_redaction_rules=True,
)
+ MSC3820opt2 = RoomVersion(
+ # Based upon v10
+ "org.matrix.msc3820.opt2",
+ RoomDisposition.UNSTABLE,
+ EventFormatVersions.ROOM_V4_PLUS,
+ StateResolutionVersions.V2,
+ enforce_key_validity=True,
+ special_case_aliases_auth=False,
+ strict_canonicaljson=True,
+ limit_notifications_power_levels=True,
+ msc2175_implicit_room_creator=True, # Used by MSC3820
+ msc2176_redaction_rules=True, # Used by MSC3820
+ msc3083_join_rules=True,
+ msc3375_redaction_rules=True,
+ msc2403_knocking=True,
+ msc2716_historical=False,
+ msc2716_redactions=False,
+ msc3389_relation_redactions=False,
+ msc3787_knock_restricted_join_rule=True,
+ msc3667_int_only_power_levels=True,
+ msc3821_redaction_rules=True, # Used by MSC3820
+ msc3931_push_features=(),
+ msc3989_redaction_rules=True, # Used by MSC3820
+ )
KNOWN_ROOM_VERSIONS: Dict[str, RoomVersion] = {
|