mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Get rooms where user is either a member or send an event
This commit is contained in:
parent
a2cf1aaf48
commit
3e736b3628
|
|
@ -75,7 +75,7 @@ const DeleteRoomStateForRoomSQL = "" +
|
|||
"DELETE FROM syncapi_current_room_state WHERE event_id = $1"
|
||||
|
||||
const selectRoomIDsWithMembershipSQL = "" +
|
||||
"SELECT DISTINCT room_id FROM syncapi_current_room_state WHERE type = 'm.room.member' AND state_key = $1 AND membership = $2"
|
||||
"SELECT DISTINCT room_id FROM syncapi_current_room_state WHERE (type = 'm.room.member' AND state_key = $1 AND membership = $2) OR sender = $1"
|
||||
|
||||
const selectRoomIDsWithAnyMembershipSQL = "" +
|
||||
"SELECT DISTINCT room_id, membership FROM syncapi_current_room_state WHERE type = 'm.room.member' AND state_key = $1"
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const DeleteRoomStateForRoomSQL = "" +
|
|||
"DELETE FROM syncapi_current_room_state WHERE event_id = $1"
|
||||
|
||||
const selectRoomIDsWithMembershipSQL = "" +
|
||||
"SELECT DISTINCT room_id FROM syncapi_current_room_state WHERE type = 'm.room.member' AND state_key = $1 AND membership = $2"
|
||||
"SELECT DISTINCT room_id FROM syncapi_current_room_state WHERE (type = 'm.room.member' AND state_key = $1 AND membership = $2) OR sender = $3"
|
||||
|
||||
const selectRoomIDsWithAnyMembershipSQL = "" +
|
||||
"SELECT DISTINCT room_id, membership FROM syncapi_current_room_state WHERE type = 'm.room.member' AND state_key = $1"
|
||||
|
|
@ -165,7 +165,7 @@ func (s *currentRoomStateStatements) SelectRoomIDsWithMembership(
|
|||
membership string, // nolint: unparam
|
||||
) ([]string, error) {
|
||||
stmt := sqlutil.TxStmt(txn, s.selectRoomIDsWithMembershipStmt)
|
||||
rows, err := stmt.QueryContext(ctx, userID, membership)
|
||||
rows, err := stmt.QueryContext(ctx, userID, membership, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue