mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-23 14:53:10 -06:00
Create previous event references in StoreEvent
This commit is contained in:
parent
994be80b7a
commit
4e96930f55
|
|
@ -117,7 +117,6 @@ type latestEventsUpdater struct {
|
|||
}
|
||||
|
||||
func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
||||
prevEvents := u.event.PrevEvents()
|
||||
u.lastEventIDSent = u.updater.LastEventIDSent()
|
||||
u.oldStateNID = u.updater.CurrentStateSnapshotNID()
|
||||
|
||||
|
|
@ -141,12 +140,6 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Update the roomserver_previous_events table with references. This
|
||||
// is effectively tracking the structure of the DAG.
|
||||
if err = u.updater.StorePreviousEvents(u.stateAtEvent.EventNID, prevEvents); err != nil {
|
||||
return fmt.Errorf("u.updater.StorePreviousEvents: %w", err)
|
||||
}
|
||||
|
||||
// Work out what the latest events are. This will include the new
|
||||
// event if it is not already referenced.
|
||||
u.calculateLatest(
|
||||
|
|
|
|||
|
|
@ -468,6 +468,11 @@ func (d *Database) StoreEvent(
|
|||
if !isRejected { // ignore rejected redaction events
|
||||
redactionEvent, redactedEventID, err = d.handleRedactions(ctx, txn, eventNID, event)
|
||||
}
|
||||
for _, prev := range event.PrevEvents() {
|
||||
if err = d.PrevEventsTable.InsertPreviousEvent(ctx, txn, prev.EventID, prev.EventSHA256, eventNID); err != nil {
|
||||
return fmt.Errorf("d.PrevEventsTable.InsertPreviousEvent: %w", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -473,4 +473,5 @@ Inbound federation rejects invites which include invalid JSON for room version 6
|
|||
Inbound federation rejects invite rejections which include invalid JSON for room version 6
|
||||
GET /capabilities is present and well formed for registered user
|
||||
m.room.history_visibility == "joined" allows/forbids appropriately for Guest users
|
||||
m.room.history_visibility == "joined" allows/forbids appropriately for Real users
|
||||
m.room.history_visibility == "joined" allows/forbids appropriately for Real users
|
||||
Users cannot kick users who have already left a room
|
||||
|
|
|
|||
Loading…
Reference in a new issue