Stream public room changes down replication

This commit is contained in:
Erik Johnston 2016-09-15 11:47:23 +01:00
parent 4fb65a1091
commit 211786ecd6
4 changed files with 74 additions and 1 deletions

View file

@ -307,3 +307,19 @@ class RoomStore(SQLBaseStore):
return self.runInteraction(
"get_public_room_changes", get_public_room_changes_txn
)
def get_all_new_public_rooms(self, prev_id, current_id, limit):
def get_all_new_public_rooms(txn):
sql = ("""
SELECT stream_id, room_id, visibility FROM public_room_list_stream
WHERE stream_id > ? AND stream_id <= ?
ORDER BY stream_id ASC
LIMIT ?
""")
txn.execute(sql, (prev_id, current_id, limit,))
return txn.fetchall()
return self.runInteraction(
"get_all_new_public_rooms", get_all_new_public_rooms
)