mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-31 10: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,
|
Kind: roomserverAPI.KindNew,
|
||||||
Event: event,
|
Event: event,
|
||||||
Origin: cfg.Matrix.ServerName,
|
Origin: cfg.Matrix.ServerName,
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: roomserverAPI.DoNotSendToOtherServers,
|
SendAsServer: roomserverAPI.DoNotSendToOtherServers,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,6 @@ func SendJoin(
|
||||||
{
|
{
|
||||||
Kind: api.KindNew,
|
Kind: api.KindNew,
|
||||||
Event: event.Headered(stateAndAuthChainResponse.RoomVersion),
|
Event: event.Headered(stateAndAuthChainResponse.RoomVersion),
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: string(cfg.Matrix.ServerName),
|
SendAsServer: string(cfg.Matrix.ServerName),
|
||||||
TransactionID: nil,
|
TransactionID: nil,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,6 @@ func SendLeave(
|
||||||
{
|
{
|
||||||
Kind: api.KindNew,
|
Kind: api.KindNew,
|
||||||
Event: event.Headered(verRes.RoomVersion),
|
Event: event.Headered(verRes.RoomVersion),
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: string(cfg.Matrix.ServerName),
|
SendAsServer: string(cfg.Matrix.ServerName),
|
||||||
TransactionID: nil,
|
TransactionID: nil,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -56,12 +56,6 @@ type InputRoomEvent struct {
|
||||||
Event *gomatrixserverlib.HeaderedEvent `json:"event"`
|
Event *gomatrixserverlib.HeaderedEvent `json:"event"`
|
||||||
// Which server told us about this event.
|
// Which server told us about this event.
|
||||||
Origin gomatrixserverlib.ServerName `json:"origin"`
|
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
|
// Whether the state is supplied as a list of event IDs or whether it
|
||||||
// should be derived from the state at the previous events.
|
// should be derived from the state at the previous events.
|
||||||
HasState bool `json:"has_state"`
|
HasState bool `json:"has_state"`
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ func SendEvents(
|
||||||
Kind: kind,
|
Kind: kind,
|
||||||
Event: event,
|
Event: event,
|
||||||
Origin: origin,
|
Origin: origin,
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: string(sendAsServer),
|
SendAsServer: string(sendAsServer),
|
||||||
TransactionID: txnID,
|
TransactionID: txnID,
|
||||||
}
|
}
|
||||||
|
|
@ -63,10 +62,9 @@ func SendEventWithState(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ires = append(ires, InputRoomEvent{
|
ires = append(ires, InputRoomEvent{
|
||||||
Kind: KindOutlier,
|
Kind: KindOutlier,
|
||||||
Event: outlier.Headered(event.RoomVersion),
|
Event: outlier.Headered(event.RoomVersion),
|
||||||
Origin: origin,
|
Origin: origin,
|
||||||
AuthEventIDs: outlier.AuthEventIDs(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +77,6 @@ func SendEventWithState(
|
||||||
Kind: kind,
|
Kind: kind,
|
||||||
Event: event,
|
Event: event,
|
||||||
Origin: origin,
|
Origin: origin,
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
HasState: true,
|
HasState: true,
|
||||||
StateEventIDs: stateEventIDs,
|
StateEventIDs: stateEventIDs,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -154,10 +154,9 @@ func (t *missingStateReq) processEventWithMissingState(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
outlierRoomEvents = append(outlierRoomEvents, api.InputRoomEvent{
|
outlierRoomEvents = append(outlierRoomEvents, api.InputRoomEvent{
|
||||||
Kind: api.KindOutlier,
|
Kind: api.KindOutlier,
|
||||||
Event: outlier.Headered(roomVersion),
|
Event: outlier.Headered(roomVersion),
|
||||||
Origin: t.origin,
|
Origin: t.origin,
|
||||||
AuthEventIDs: outlier.AuthEventIDs(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// TODO: we could do this concurrently?
|
// TODO: we could do this concurrently?
|
||||||
|
|
@ -179,7 +178,6 @@ func (t *missingStateReq) processEventWithMissingState(
|
||||||
Kind: api.KindOld,
|
Kind: api.KindOld,
|
||||||
Event: backwardsExtremity.Headered(roomVersion),
|
Event: backwardsExtremity.Headered(roomVersion),
|
||||||
Origin: t.origin,
|
Origin: t.origin,
|
||||||
AuthEventIDs: backwardsExtremity.AuthEventIDs(),
|
|
||||||
HasState: true,
|
HasState: true,
|
||||||
StateEventIDs: stateIDs,
|
StateEventIDs: stateIDs,
|
||||||
SendAsServer: api.DoNotSendToOtherServers,
|
SendAsServer: api.DoNotSendToOtherServers,
|
||||||
|
|
@ -197,7 +195,6 @@ func (t *missingStateReq) processEventWithMissingState(
|
||||||
Kind: api.KindOld,
|
Kind: api.KindOld,
|
||||||
Event: newEvent.Headered(roomVersion),
|
Event: newEvent.Headered(roomVersion),
|
||||||
Origin: t.origin,
|
Origin: t.origin,
|
||||||
AuthEventIDs: backwardsExtremity.AuthEventIDs(),
|
|
||||||
SendAsServer: api.DoNotSendToOtherServers,
|
SendAsServer: api.DoNotSendToOtherServers,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,6 @@ func (r *Inviter) PerformInvite(
|
||||||
Kind: api.KindNew,
|
Kind: api.KindNew,
|
||||||
Event: event,
|
Event: event,
|
||||||
Origin: event.Origin(),
|
Origin: event.Origin(),
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: req.SendAsServer,
|
SendAsServer: req.SendAsServer,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,6 @@ func (r *Joiner) performJoinRoomByID(
|
||||||
{
|
{
|
||||||
Kind: rsAPI.KindNew,
|
Kind: rsAPI.KindNew,
|
||||||
Event: event.Headered(buildRes.RoomVersion),
|
Event: event.Headered(buildRes.RoomVersion),
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,6 @@ func (r *Leaver) performLeaveRoomByID(
|
||||||
Kind: api.KindNew,
|
Kind: api.KindNew,
|
||||||
Event: event.Headered(buildRes.RoomVersion),
|
Event: event.Headered(buildRes.RoomVersion),
|
||||||
Origin: event.Origin(),
|
Origin: event.Origin(),
|
||||||
AuthEventIDs: event.AuthEventIDs(),
|
|
||||||
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
SendAsServer: string(r.Cfg.Matrix.ServerName),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -643,9 +643,8 @@ func (rc *reqCtx) injectResponseToRoomserver(res *gomatrixserverlib.MSC2836Event
|
||||||
var ires []roomserver.InputRoomEvent
|
var ires []roomserver.InputRoomEvent
|
||||||
for _, outlier := range append(eventsInOrder, messageEvents...) {
|
for _, outlier := range append(eventsInOrder, messageEvents...) {
|
||||||
ires = append(ires, roomserver.InputRoomEvent{
|
ires = append(ires, roomserver.InputRoomEvent{
|
||||||
Kind: roomserver.KindOutlier,
|
Kind: roomserver.KindOutlier,
|
||||||
Event: outlier.Headered(outlier.Version()),
|
Event: outlier.Headered(outlier.Version()),
|
||||||
AuthEventIDs: outlier.AuthEventIDs(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// we've got the data by this point so use a background context
|
// we've got the data by this point so use a background context
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue