mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 09:43:10 -06:00
Remove AuthEventIDs from InputRoomEvent
This commit is contained in:
parent
fb168a504d
commit
b17760daee
|
|
@ -459,7 +459,6 @@ func createRoom(
|
|||
Kind: roomserverAPI.KindNew,
|
||||
Event: event,
|
||||
Origin: cfg.Matrix.ServerName,
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: roomserverAPI.DoNotSendToOtherServers,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,7 +324,6 @@ func SendJoin(
|
|||
{
|
||||
Kind: api.KindNew,
|
||||
Event: event.Headered(stateAndAuthChainResponse.RoomVersion),
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: string(cfg.Matrix.ServerName),
|
||||
TransactionID: nil,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -275,7 +275,6 @@ func SendLeave(
|
|||
{
|
||||
Kind: api.KindNew,
|
||||
Event: event.Headered(verRes.RoomVersion),
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: string(cfg.Matrix.ServerName),
|
||||
TransactionID: nil,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -56,12 +56,6 @@ type InputRoomEvent struct {
|
|||
Event *gomatrixserverlib.HeaderedEvent `json:"event"`
|
||||
// Which server told us about this event.
|
||||
Origin gomatrixserverlib.ServerName `json:"origin"`
|
||||
// List of state event IDs that authenticate this event.
|
||||
// These are likely derived from the "auth_events" JSON key of the event.
|
||||
// But can be different because the "auth_events" key can be incomplete or wrong.
|
||||
// For example many matrix events forget to reference the m.room.create event even though it is needed for auth.
|
||||
// (since synapse allows this to happen we have to allow it as well.)
|
||||
AuthEventIDs []string `json:"auth_event_ids"`
|
||||
// Whether the state is supplied as a list of event IDs or whether it
|
||||
// should be derived from the state at the previous events.
|
||||
HasState bool `json:"has_state"`
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ func SendEvents(
|
|||
Kind: kind,
|
||||
Event: event,
|
||||
Origin: origin,
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: string(sendAsServer),
|
||||
TransactionID: txnID,
|
||||
}
|
||||
|
|
@ -63,10 +62,9 @@ func SendEventWithState(
|
|||
continue
|
||||
}
|
||||
ires = append(ires, InputRoomEvent{
|
||||
Kind: KindOutlier,
|
||||
Event: outlier.Headered(event.RoomVersion),
|
||||
Origin: origin,
|
||||
AuthEventIDs: outlier.AuthEventIDs(),
|
||||
Kind: KindOutlier,
|
||||
Event: outlier.Headered(event.RoomVersion),
|
||||
Origin: origin,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +77,6 @@ func SendEventWithState(
|
|||
Kind: kind,
|
||||
Event: event,
|
||||
Origin: origin,
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
HasState: true,
|
||||
StateEventIDs: stateEventIDs,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -154,10 +154,9 @@ func (t *missingStateReq) processEventWithMissingState(
|
|||
continue
|
||||
}
|
||||
outlierRoomEvents = append(outlierRoomEvents, api.InputRoomEvent{
|
||||
Kind: api.KindOutlier,
|
||||
Event: outlier.Headered(roomVersion),
|
||||
Origin: t.origin,
|
||||
AuthEventIDs: outlier.AuthEventIDs(),
|
||||
Kind: api.KindOutlier,
|
||||
Event: outlier.Headered(roomVersion),
|
||||
Origin: t.origin,
|
||||
})
|
||||
}
|
||||
// TODO: we could do this concurrently?
|
||||
|
|
@ -179,7 +178,6 @@ func (t *missingStateReq) processEventWithMissingState(
|
|||
Kind: api.KindOld,
|
||||
Event: backwardsExtremity.Headered(roomVersion),
|
||||
Origin: t.origin,
|
||||
AuthEventIDs: backwardsExtremity.AuthEventIDs(),
|
||||
HasState: true,
|
||||
StateEventIDs: stateIDs,
|
||||
SendAsServer: api.DoNotSendToOtherServers,
|
||||
|
|
@ -197,7 +195,6 @@ func (t *missingStateReq) processEventWithMissingState(
|
|||
Kind: api.KindOld,
|
||||
Event: newEvent.Headered(roomVersion),
|
||||
Origin: t.origin,
|
||||
AuthEventIDs: backwardsExtremity.AuthEventIDs(),
|
||||
SendAsServer: api.DoNotSendToOtherServers,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -173,7 +173,6 @@ func (r *Inviter) PerformInvite(
|
|||
Kind: api.KindNew,
|
||||
Event: event,
|
||||
Origin: event.Origin(),
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: req.SendAsServer,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -271,7 +271,6 @@ func (r *Joiner) performJoinRoomByID(
|
|||
{
|
||||
Kind: rsAPI.KindNew,
|
||||
Event: event.Headered(buildRes.RoomVersion),
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ func (r *Leaver) performLeaveRoomByID(
|
|||
Kind: api.KindNew,
|
||||
Event: event.Headered(buildRes.RoomVersion),
|
||||
Origin: event.Origin(),
|
||||
AuthEventIDs: event.AuthEventIDs(),
|
||||
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -643,9 +643,8 @@ func (rc *reqCtx) injectResponseToRoomserver(res *gomatrixserverlib.MSC2836Event
|
|||
var ires []roomserver.InputRoomEvent
|
||||
for _, outlier := range append(eventsInOrder, messageEvents...) {
|
||||
ires = append(ires, roomserver.InputRoomEvent{
|
||||
Kind: roomserver.KindOutlier,
|
||||
Event: outlier.Headered(outlier.Version()),
|
||||
AuthEventIDs: outlier.AuthEventIDs(),
|
||||
Kind: roomserver.KindOutlier,
|
||||
Event: outlier.Headered(outlier.Version()),
|
||||
})
|
||||
}
|
||||
// we've got the data by this point so use a background context
|
||||
|
|
|
|||
Loading…
Reference in a new issue