summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/notifications.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-06-20 19:32:02 +1000
committerGitHub <noreply@github.com>2019-06-20 19:32:02 +1000
commit32e7c9e7f20b57dd081023ac42d6931a8da9b3a3 (patch)
tree139ef30c957535699d1ae0474e8b5ba2517196b2 /synapse/rest/client/v2_alpha/notifications.py
parentMerge pull request #5042 from matrix-org/erikj/fix_get_missing_events_error (diff)
downloadsynapse-32e7c9e7f20b57dd081023ac42d6931a8da9b3a3.tar.xz
Run Black. (#5482)
Diffstat (limited to 'synapse/rest/client/v2_alpha/notifications.py')
-rw-r--r--synapse/rest/client/v2_alpha/notifications.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/synapse/rest/client/v2_alpha/notifications.py b/synapse/rest/client/v2_alpha/notifications.py
index 53e666989b..728a52328f 100644
--- a/synapse/rest/client/v2_alpha/notifications.py
+++ b/synapse/rest/client/v2_alpha/notifications.py
@@ -51,7 +51,7 @@ class NotificationsServlet(RestServlet):
         )
 
         receipts_by_room = yield self.store.get_receipts_for_user_with_orderings(
-            user_id, 'm.read'
+            user_id, "m.read"
         )
 
         notif_event_ids = [pa["event_id"] for pa in push_actions]
@@ -67,11 +67,13 @@ class NotificationsServlet(RestServlet):
                 "profile_tag": pa["profile_tag"],
                 "actions": pa["actions"],
                 "ts": pa["received_ts"],
-                "event": (yield self._event_serializer.serialize_event(
-                    notif_events[pa["event_id"]],
-                    self.clock.time_msec(),
-                    event_format=format_event_for_client_v2_without_room_id,
-                )),
+                "event": (
+                    yield self._event_serializer.serialize_event(
+                        notif_events[pa["event_id"]],
+                        self.clock.time_msec(),
+                        event_format=format_event_for_client_v2_without_room_id,
+                    )
+                ),
             }
 
             if pa["room_id"] not in receipts_by_room:
@@ -80,17 +82,15 @@ class NotificationsServlet(RestServlet):
                 receipt = receipts_by_room[pa["room_id"]]
 
                 returned_pa["read"] = (
-                    receipt["topological_ordering"], receipt["stream_ordering"]
-                ) >= (
-                    pa["topological_ordering"], pa["stream_ordering"]
-                )
+                    receipt["topological_ordering"],
+                    receipt["stream_ordering"],
+                ) >= (pa["topological_ordering"], pa["stream_ordering"])
             returned_push_actions.append(returned_pa)
             next_token = str(pa["stream_ordering"])
 
-        defer.returnValue((200, {
-            "notifications": returned_push_actions,
-            "next_token": next_token,
-        }))
+        defer.returnValue(
+            (200, {"notifications": returned_push_actions, "next_token": next_token})
+        )
 
 
 def register_servlets(hs, http_server):