diff options
author | Erik Johnston <erik@matrix.org> | 2015-09-25 11:38:28 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-09-25 11:38:28 +0100 |
commit | a14665bde7730872627e956860be0d727a53e26d (patch) | |
tree | eeb44967874a737bd2492b6591966a389de1aeda /synapse/storage/roommember.py | |
parent | Bundle in some room state in the unsigned bit of the invite when sending to i... (diff) | |
parent | Merge pull request #289 from matrix-org/markjh/fix_sql (diff) | |
download | synapse-a14665bde7730872627e956860be0d727a53e26d.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/invite_state
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r-- | synapse/storage/roommember.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index 2a59ee7d6d..41c939efb1 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -30,7 +30,7 @@ logger = logging.getLogger(__name__) RoomsForUser = namedtuple( "RoomsForUser", - ("room_id", "sender", "membership", "event_id") + ("room_id", "sender", "membership", "event_id", "stream_ordering") ) @@ -141,11 +141,13 @@ class RoomMemberStore(SQLBaseStore): args.extend(membership_list) sql = ( - "SELECT m.event_id, m.room_id, m.sender, m.membership" - " FROM room_memberships as m" - " INNER JOIN current_state_events as c" - " ON m.event_id = c.event_id " - " AND m.room_id = c.room_id " + "SELECT m.room_id, m.sender, m.membership, m.event_id, e.stream_ordering" + " FROM current_state_events as c" + " INNER JOIN room_memberships as m" + " ON m.event_id = c.event_id" + " INNER JOIN events as e" + " ON e.event_id = c.event_id" + " AND m.room_id = c.room_id" " AND m.user_id = c.state_key" " WHERE %s" ) % (where_clause,) |