summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-05-23 18:48:02 +0100
committerDavid Baker <dave@matrix.org>2016-05-23 18:48:02 +0100
commitb791a530da1d89e36297cb626950cb42a7ea9226 (patch)
treecf2181147d53e8da1e03a3205ae3764aa7d1721c
parentAdd GET /notifications API (diff)
downloadsynapse-b791a530da1d89e36297cb626950cb42a7ea9226.tar.xz
Actually make the 'read' flag correct
-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 505e998393..9600256962 100644
--- a/synapse/rest/client/v2_alpha/notifications.py
+++ b/synapse/rest/client/v2_alpha/notifications.py
@@ -81,10 +81,9 @@ class NotificationsServlet(RestServlet):
                 receipt = receipts_by_room[pa["room_id"]]
 
                 returned_pa["read"] = (
-                    pa["topological_ordering"] > receipt["topological_ordering"]
-                    or (
-                        pa["topological_ordering"] == receipt["topological_ordering"]
-                        and pa["stream_ordering"] > receipt["stream_ordering"]
+                    receipt["topological_ordering"] >= pa["topological_ordering"] or (
+                        receipt["topological_ordering"] == pa["topological_ordering"] and
+                        receipt["stream_ordering"] >= pa["stream_ordering"]
                     )
                 )
             returned_push_actions.append(returned_pa)