summary refs log tree commit diff
path: root/synapse/storage/event_push_actions.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-05-24 11:33:32 +0100
committerDavid Baker <dave@matrix.org>2016-05-24 11:33:32 +0100
commit37b7e846200f00a36c6084d426ab73ee5d0e0218 (patch)
treeb99112ad5756cd98693549df1f26aecce2faad77 /synapse/storage/event_push_actions.py
parentActually make the 'read' flag correct (diff)
downloadsynapse-37b7e846200f00a36c6084d426ab73ee5d0e0218.tar.xz
Include the ts the notif was received at
Diffstat (limited to 'synapse/storage/event_push_actions.py')
-rw-r--r--synapse/storage/event_push_actions.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/storage/event_push_actions.py b/synapse/storage/event_push_actions.py
index a9cb042b5a..5123072c44 100644
--- a/synapse/storage/event_push_actions.py
+++ b/synapse/storage/event_push_actions.py
@@ -201,11 +201,13 @@ class EventPushActionsStore(SQLBaseStore):
             else:
                 args = [user_id, limit]
             sql = (
-                "SELECT event_id, room_id, stream_ordering, topological_ordering,"
-                " actions, profile_tag"
-                " FROM event_push_actions"
-                " WHERE user_id = ? %s"
-                " ORDER BY stream_ordering DESC"
+                "SELECT epa.event_id, epa.room_id,"
+                " epa.stream_ordering, epa.topological_ordering,"
+                " epa.actions, epa.profile_tag, e.received_ts"
+                " FROM event_push_actions epa, events e"
+                " WHERE epa.room_id = e.room_id AND epa.event_id = e.event_id"
+                " AND epa.user_id = ? %s"
+                " ORDER BY epa.stream_ordering DESC"
                 " LIMIT ?"
                 % (before_clause,)
             )