mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 15:03:09 -06:00
only enable translation logic on pseudo ID rooms
- see added TODO for more info
This commit is contained in:
parent
96e5690b44
commit
c090e7f6bf
|
|
@ -217,6 +217,18 @@ func OnIncomingStateTypeRequest(
|
|||
var worldReadable bool
|
||||
var wantLatestState bool
|
||||
|
||||
roomVer, err := rsAPI.QueryRoomVersionForRoom(ctx, roomID)
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusForbidden,
|
||||
JSON: spec.Forbidden(fmt.Sprintf("Unknown room %q or user %q has never joined this room", roomID, device.UserID)),
|
||||
}
|
||||
}
|
||||
|
||||
// Only enable translation logic on pseudo ID rooms
|
||||
// TODO: remove the if check, synctypes.FromClientStateKey handles non-pseudo ID rooms,
|
||||
// but has some logic to be worked out (see comment in synctypes.FromClientStateKey for details)
|
||||
if roomVer == gomatrixserverlib.RoomVersionPseudoIDs {
|
||||
parsedRoomID, err := spec.NewRoomID(roomID)
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
|
|
@ -245,6 +257,7 @@ func OnIncomingStateTypeRequest(
|
|||
}
|
||||
}
|
||||
stateKey = *newStateKey
|
||||
}
|
||||
|
||||
// Always fetch visibility so that we can work out whether to show
|
||||
// the latest events or the last event from when the user was joined.
|
||||
|
|
|
|||
Loading…
Reference in a new issue