fix SendEventWithRewrite not to bail if handed a non-state event

This commit is contained in:
Matthew Hodgson 2020-09-27 00:31:15 +01:00
parent 75c3f2df8d
commit 2b4353eeca

View file

@ -46,7 +46,6 @@ func SendEvents(
func SendEventWithState(
ctx context.Context, rsAPI RoomserverInternalAPI, state *gomatrixserverlib.RespState,
event gomatrixserverlib.HeaderedEvent, haveEventIDs map[string]bool,
roomVersion gomatrixserverlib.RoomVersion,
) error {
outliers, err := state.Events()
if err != nil {
@ -60,7 +59,7 @@ func SendEventWithState(
}
ires = append(ires, InputRoomEvent{
Kind: KindOutlier,
Event: outlier.Headered(roomVersion),
Event: outlier.Headered(event.RoomVersion),
AuthEventIDs: outlier.AuthEventIDs(),
})
}
@ -116,9 +115,6 @@ func SendEventWithRewrite(
if haveEventIDs[authOrStateEvent.EventID()] {
continue
}
if event.StateKey() == nil {
continue
}
// We will handle an event as if it's an outlier if one of the
// following conditions is true: