reuse event ID when updating power level events

- (when updating power level events for pseudo IDs)
- before this, there were some subtle bugs arising from mismatched event IDs
This commit is contained in:
Sam Wedgwood 2023-07-26 17:09:55 +01:00
parent 4b4fab209c
commit 5c014faa18

View file

@ -519,7 +519,7 @@ func (p *PDUStreamProvider) updatePowerLevelEvent(ctx context.Context, ev *rstyp
}
var evNew gomatrixserverlib.PDU
evNew, err = gomatrixserverlib.MustGetRoomVersion(gomatrixserverlib.RoomVersionPseudoIDs).NewEventFromTrustedJSON(newEv, false)
evNew, err = gomatrixserverlib.MustGetRoomVersion(gomatrixserverlib.RoomVersionPseudoIDs).NewEventFromTrustedJSONWithEventID(ev.EventID(), newEv, false)
if err != nil {
return nil, err
}