Fix tests

This commit is contained in:
Kegan Dougal 2020-07-02 11:18:18 +01:00
parent c96652fb07
commit 72ae5c4750
4 changed files with 19 additions and 1 deletions

View file

@ -410,6 +410,19 @@ func createRoom(
} }
} }
if r.Visibility == "public" {
// expose this room in the published room list
var pubRes roomserverAPI.PerformPublishResponse
rsAPI.PerformPublish(req.Context(), &roomserverAPI.PerformPublishRequest{
RoomID: roomID,
Visibility: "public",
}, &pubRes)
if pubRes.Error != nil {
// treat as non-fatal since the room is already made by this point
util.GetLogger(req.Context()).WithError(pubRes.Error).Error("failed to visibility:public")
}
}
response := createRoomResponse{ response := createRoomResponse{
RoomID: roomID, RoomID: roomID,
RoomAlias: roomAlias, RoomAlias: roomAlias,

View file

@ -205,6 +205,9 @@ func publicRooms(ctx context.Context, request PublicRoomReq, rsAPI roomserverAPI
var limit int16 var limit int16
var offset int64 var offset int64
limit = request.Limit limit = request.Limit
if limit == 0 {
limit = 50
}
offset, err := strconv.ParseInt(request.Since, 10, 64) offset, err := strconv.ParseInt(request.Since, 10, 64)
// ParseInt returns 0 and an error when trying to parse an empty string // ParseInt returns 0 and an error when trying to parse an empty string
// In that case, we want to assign 0 so we ignore the error // In that case, we want to assign 0 so we ignore the error

View file

@ -64,7 +64,7 @@ func ExtractContentValue(ev *gomatrixserverlib.HeaderedEvent) string {
case gomatrixserverlib.MRoomName: case gomatrixserverlib.MRoomName:
key = "name" key = "name"
case "m.room.avatar": case "m.room.avatar":
key = "avatar" key = "url"
case "m.room.topic": case "m.room.topic":
key = "topic" key = "topic"
case "m.room.guest_access": case "m.room.guest_access":

View file

@ -181,6 +181,8 @@ Outbound federation can query profile data
/event/ on joined room works /event/ on joined room works
/event/ does not allow access to events before the user joined /event/ does not allow access to events before the user joined
Federation key API allows unsigned requests for keys Federation key API allows unsigned requests for keys
GET /publicRooms lists rooms
GET /publicRooms includes avatar URLs
Can paginate public room list Can paginate public room list
GET /directory/room/:room_alias yields room ID GET /directory/room/:room_alias yields room ID
PUT /directory/room/:room_alias creates alias PUT /directory/room/:room_alias creates alias