[pseudoIDs] changing event ID fix (#3195)

power levels events in pseudo IDs sometimes changed event IDs (this was
already fixed earlier, but one of the edgecases was not covered, and is
now covered)

Signed-off-by: `Sam Wedgwood <sam@wedgwood.dev>`
This commit is contained in:
Sam Wedgwood 2023-09-12 16:32:24 +01:00 committed by GitHub
parent bea73c765a
commit 058081e68e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -500,7 +500,7 @@ func (p *PDUStreamProvider) updatePowerLevelEvent(ctx context.Context, ev *rstyp
prevContent := gjson.GetBytes(ev.JSON(), "unsigned.prev_content") prevContent := gjson.GetBytes(ev.JSON(), "unsigned.prev_content")
if !prevContent.Exists() { if !prevContent.Exists() {
var evNew gomatrixserverlib.PDU var evNew gomatrixserverlib.PDU
evNew, err = gomatrixserverlib.MustGetRoomVersion(ev.Version()).NewEventFromTrustedJSON(newEv, false) evNew, err = gomatrixserverlib.MustGetRoomVersion(ev.Version()).NewEventFromTrustedJSONWithEventID(ev.EventID(), newEv, false)
if err != nil { if err != nil {
return nil, err return nil, err
} }