aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-07-03 14:28:43 +0100
committerGitHub <noreply@github.com>2020-07-03 14:28:43 +0100
commit3a28ddfb7a01999f4681333e7c8526b2a430f357 (patch)
tree1c8486a8867fced55279849f8891ea985ee6a666 /clientapi
parent3797c38ec86977e92a06679d8cc0642ed6ce6b63 (diff)
Yggdrasil demo initial public room directory (#1181)
* Don't return null to public directory request * Initial support for finding public rooms in Yggdrasil demo (incomplete) * Increase QUIC idle time to 15 minutes
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/routing/directory_public.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/clientapi/routing/directory_public.go b/clientapi/routing/directory_public.go
index 925c1b8a..fcf3f656 100644
--- a/clientapi/routing/directory_public.go
+++ b/clientapi/routing/directory_public.go
@@ -71,7 +71,9 @@ func publicRooms(ctx context.Context, request PublicRoomReq, rsAPI roomserverAPI
stateAPI currentstateAPI.CurrentStateInternalAPI, extRoomsProvider api.ExtraPublicRoomsProvider,
) (*gomatrixserverlib.RespPublicRooms, error) {
- var response gomatrixserverlib.RespPublicRooms
+ response := gomatrixserverlib.RespPublicRooms{
+ Chunk: []gomatrixserverlib.PublicRoom{},
+ }
var limit int16
var offset int64
limit = request.Limit
@@ -103,7 +105,9 @@ func publicRooms(ctx context.Context, request PublicRoomReq, rsAPI roomserverAPI
if next >= 0 {
response.NextBatch = "T" + strconv.Itoa(next)
}
- response.Chunk = chunk
+ if chunk != nil {
+ response.Chunk = chunk
+ }
return &response, err
}