Fix roomList query

This commit is contained in:
Christian Pauly 2019-06-12 12:34:46 +02:00
parent db3c3f0c6d
commit 9bd377c4be

View file

@ -467,10 +467,9 @@ class Store {
"SELECT rooms.*, events.origin_server_ts, events.content_json, events.type, events.sender, events.status, events.state_key " + "SELECT rooms.*, events.origin_server_ts, events.content_json, events.type, events.sender, events.status, events.state_key " +
" FROM Rooms rooms LEFT JOIN Events events " + " FROM Rooms rooms LEFT JOIN Events events " +
" ON rooms.id=events.chat_id " + " ON rooms.id=events.chat_id " +
" WHERE rooms.id!='' " + " WHERE rooms.membership" +
" AND rooms.membership" +
(onlyLeft ? "=" : "!=") + (onlyLeft ? "=" : "!=") +
"'left' " + "'leave' " +
(onlyDirect ? " AND rooms.direct_chat_matrix_id!= '' " : "") + (onlyDirect ? " AND rooms.direct_chat_matrix_id!= '' " : "") +
(onlyGroups ? " AND rooms.direct_chat_matrix_id= '' " : "") + (onlyGroups ? " AND rooms.direct_chat_matrix_id= '' " : "") +
" GROUP BY rooms.id " + " GROUP BY rooms.id " +