Use stable identifiers for MSC3771 & MSC3773. (#14050)

These are both part of Matrix 1.4 which has now been released.

For now, support both the unstable and stable identifiers.
This commit is contained in:
Patrick Cloke 2022-10-07 09:26:40 -04:00 committed by GitHub
parent 0adeccafc6
commit 66a7857334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 47 additions and 50 deletions

View file

@ -84,6 +84,7 @@ ROOM_EVENT_FILTER_SCHEMA = {
"contains_url": {"type": "boolean"},
"lazy_load_members": {"type": "boolean"},
"include_redundant_members": {"type": "boolean"},
"unread_thread_notifications": {"type": "boolean"},
"org.matrix.msc3773.unread_thread_notifications": {"type": "boolean"},
# Include or exclude events with the provided labels.
# cf https://github.com/matrix-org/matrix-doc/pull/2326
@ -308,12 +309,16 @@ class Filter:
self.include_redundant_members = filter_json.get(
"include_redundant_members", False
)
if hs.config.experimental.msc3773_enabled:
self.unread_thread_notifications: bool = filter_json.get(
self.unread_thread_notifications: bool = filter_json.get(
"unread_thread_notifications", False
)
if (
not self.unread_thread_notifications
and hs.config.experimental.msc3773_enabled
):
self.unread_thread_notifications = filter_json.get(
"org.matrix.msc3773.unread_thread_notifications", False
)
else:
self.unread_thread_notifications = False
self.types = filter_json.get("types", None)
self.not_types = filter_json.get("not_types", [])