summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-10-07 09:26:40 -0400
committerGitHub <noreply@github.com>2022-10-07 09:26:40 -0400
commit66a785733458d0b5801097caff53624e202a91b4 (patch)
treeef211ad0fefd409961a03cd0ec8a0fd5b0a5e951 /synapse/api
parentAdd sample worker files for `pusher` and `federation_sender` (#14077) (diff)
downloadsynapse-66a785733458d0b5801097caff53624e202a91b4.tar.xz
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.
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/filtering.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py
index c6e44dcf82..cc31cf8cc7 100644
--- a/synapse/api/filtering.py
+++ b/synapse/api/filtering.py
@@ -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", [])