summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/notifications.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-08-18 17:51:08 +0100
committerDavid Baker <dave@matrix.org>2016-08-18 17:51:08 +0100
commit0acdd0f1eafa962394fd2d1ca950186edf853653 (patch)
tree7ddc4f140755727e02e67149438365e8c6eaac8b /synapse/rest/client/v2_alpha/notifications.py
parentMerge remote-tracking branch 'origin/develop' into dbkr/notifications_api (diff)
downloadsynapse-0acdd0f1eafa962394fd2d1ca950186edf853653.tar.xz
Use tuple comparison
Hopefully easier to read
Diffstat (limited to 'synapse/rest/client/v2_alpha/notifications.py')
-rw-r--r--synapse/rest/client/v2_alpha/notifications.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/rest/client/v2_alpha/notifications.py b/synapse/rest/client/v2_alpha/notifications.py
index 4d84230e68..f1a48acf07 100644
--- a/synapse/rest/client/v2_alpha/notifications.py
+++ b/synapse/rest/client/v2_alpha/notifications.py
@@ -82,10 +82,9 @@ class NotificationsServlet(RestServlet):
                 receipt = receipts_by_room[pa["room_id"]]
 
                 returned_pa["read"] = (
-                    receipt["topological_ordering"] >= pa["topological_ordering"] or (
-                        receipt["topological_ordering"] == pa["topological_ordering"] and
-                        receipt["stream_ordering"] >= pa["stream_ordering"]
-                    )
+                    receipt["topological_ordering"], receipt["stream_ordering"]
+                ) >= (
+                    pa["topological_ordering"], pa["stream_ordering"]
                 )
             returned_push_actions.append(returned_pa)
             next_token = pa["stream_ordering"]