mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-25 07:43:10 -06:00
fix SendEventWithRewrite not to bail if handed a non-state event
This commit is contained in:
parent
75c3f2df8d
commit
2b4353eeca
|
|
@ -46,7 +46,6 @@ func SendEvents(
|
||||||
func SendEventWithState(
|
func SendEventWithState(
|
||||||
ctx context.Context, rsAPI RoomserverInternalAPI, state *gomatrixserverlib.RespState,
|
ctx context.Context, rsAPI RoomserverInternalAPI, state *gomatrixserverlib.RespState,
|
||||||
event gomatrixserverlib.HeaderedEvent, haveEventIDs map[string]bool,
|
event gomatrixserverlib.HeaderedEvent, haveEventIDs map[string]bool,
|
||||||
roomVersion gomatrixserverlib.RoomVersion,
|
|
||||||
) error {
|
) error {
|
||||||
outliers, err := state.Events()
|
outliers, err := state.Events()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -60,7 +59,7 @@ func SendEventWithState(
|
||||||
}
|
}
|
||||||
ires = append(ires, InputRoomEvent{
|
ires = append(ires, InputRoomEvent{
|
||||||
Kind: KindOutlier,
|
Kind: KindOutlier,
|
||||||
Event: outlier.Headered(roomVersion),
|
Event: outlier.Headered(event.RoomVersion),
|
||||||
AuthEventIDs: outlier.AuthEventIDs(),
|
AuthEventIDs: outlier.AuthEventIDs(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -116,9 +115,6 @@ func SendEventWithRewrite(
|
||||||
if haveEventIDs[authOrStateEvent.EventID()] {
|
if haveEventIDs[authOrStateEvent.EventID()] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if event.StateKey() == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// We will handle an event as if it's an outlier if one of the
|
// We will handle an event as if it's an outlier if one of the
|
||||||
// following conditions is true:
|
// following conditions is true:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue