strip out empty roomd deltas

This commit is contained in:
Matthew Hodgson 2020-09-01 21:59:35 +01:00
parent 85bce11964
commit 75b91ac9e5

View file

@ -856,6 +856,12 @@ func (d *Database) addRoomDeltaToResponse(
return err
}
// XXX: should we ever get this far if we have no recent events or state in this room?
// in practice we do for peeks, but possibly not joins?
if len(recentEvents) == 0 && len(delta.stateEvents) == 0 {
return nil
}
switch delta.membership {
case gomatrixserverlib.Join:
jr := types.NewJoinResponse()