mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 11:41:38 +00:00
Always send [] from federated rooms, not null
This commit is contained in:
parent
1a79060b46
commit
18e3c40da4
@ -426,6 +426,18 @@ func (w *walker) federatedRoomInfo(roomID string, vias []string) (*gomatrixserve
|
|||||||
util.GetLogger(w.ctx).WithError(err).Warnf("failed to call MSC2946Spaces on server %s", serverName)
|
util.GetLogger(w.ctx).WithError(err).Warnf("failed to call MSC2946Spaces on server %s", serverName)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// ensure nil slices are empty as we send this to the client sometimes
|
||||||
|
if res.Room.ChildrenState == nil {
|
||||||
|
res.Room.ChildrenState = []gomatrixserverlib.MSC2946StrippedEvent{}
|
||||||
|
}
|
||||||
|
for i := 0; i < len(res.Children); i++ {
|
||||||
|
child := res.Children[i]
|
||||||
|
if child.ChildrenState == nil {
|
||||||
|
child.ChildrenState = []gomatrixserverlib.MSC2946StrippedEvent{}
|
||||||
|
}
|
||||||
|
res.Children[i] = child
|
||||||
|
}
|
||||||
|
|
||||||
return &res, nil
|
return &res, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user