Escape the create event content key so it can be extracted correctly
This commit is contained in:
parent
2113da5332
commit
fdd534f86a
|
@ -19,6 +19,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
@ -198,7 +199,8 @@ func (w *walker) walk() *SpacesResponse {
|
||||||
roomType := ""
|
roomType := ""
|
||||||
create := w.stateEvent(roomID, gomatrixserverlib.MRoomCreate, "")
|
create := w.stateEvent(roomID, gomatrixserverlib.MRoomCreate, "")
|
||||||
if create != nil {
|
if create != nil {
|
||||||
roomType = gjson.GetBytes(create.Content(), ConstCreateEventContentKey).Str
|
// escape the `.`s so gjson doesn't think it's nested
|
||||||
|
roomType = gjson.GetBytes(create.Content(), strings.ReplaceAll(ConstCreateEventContentKey, ".", `\.`)).Str
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the total number of events to `PublicRoomsChunk` under `num_refs`. Add `PublicRoomsChunk` to `rooms`.
|
// Add the total number of events to `PublicRoomsChunk` under `num_refs`. Add `PublicRoomsChunk` to `rooms`.
|
||||||
|
|
Loading…
Reference in a new issue