diff --git a/roomserver/storage/postgres/membership_table.go b/roomserver/storage/postgres/membership_table.go index 0106d3e68..e98a87b04 100644 --- a/roomserver/storage/postgres/membership_table.go +++ b/roomserver/storage/postgres/membership_table.go @@ -300,7 +300,7 @@ func (s *membershipStatements) SelectRoomsWithMembership( stmt := sqlutil.TxStmt(txn, s.selectRoomsForUserStmt) rows, err = stmt.QueryContext(ctx, userID) } else { - stmt := sqlutil.TxStmt(txn, s.selectMembershipsFromRoomStmt) + stmt := sqlutil.TxStmt(txn, s.selectRoomsWithMembershipStmt) rows, err = stmt.QueryContext(ctx, membershipState, userID) } diff --git a/roomserver/storage/sqlite3/membership_table.go b/roomserver/storage/sqlite3/membership_table.go index e2b37da4d..f852422e7 100644 --- a/roomserver/storage/sqlite3/membership_table.go +++ b/roomserver/storage/sqlite3/membership_table.go @@ -277,7 +277,7 @@ func (s *membershipStatements) SelectRoomsWithMembership( stmt := sqlutil.TxStmt(txn, s.selectRoomsForUserStmt) rows, err = stmt.QueryContext(ctx, userID) } else { - stmt := sqlutil.TxStmt(txn, s.selectMembershipsFromRoomStmt) + stmt := sqlutil.TxStmt(txn, s.selectRoomsWithMembershipStmt) rows, err = stmt.QueryContext(ctx, membershipState, userID) }