mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 11:13:12 -06:00
Don't try to re-fetch the event in the output message
This commit is contained in:
parent
4c15c73b3a
commit
a2600cd27b
|
|
@ -156,12 +156,20 @@ func (s *OutputRoomEventConsumer) onNewRoomEvent(
|
|||
ev := msg.Event
|
||||
|
||||
addsStateEvents := []*gomatrixserverlib.HeaderedEvent{}
|
||||
foundEventIDs := map[string]bool{}
|
||||
missingAddStateEventIDs := make([]string, 0, len(msg.AddsStateEventIDs))
|
||||
foundEventIDs := map[string]bool{
|
||||
msg.Event.EventID(): true,
|
||||
}
|
||||
if len(msg.AddsStateEventIDs) > 0 {
|
||||
for _, eventID := range msg.AddsStateEventIDs {
|
||||
foundEventIDs[eventID] = false
|
||||
if _, ok := foundEventIDs[eventID]; !ok {
|
||||
foundEventIDs[eventID] = false
|
||||
missingAddStateEventIDs = append(missingAddStateEventIDs, eventID)
|
||||
}
|
||||
}
|
||||
foundEvents, err := s.db.Events(ctx, msg.AddsStateEventIDs)
|
||||
}
|
||||
if len(missingAddStateEventIDs) > 0 {
|
||||
foundEvents, err := s.db.Events(ctx, missingAddStateEventIDs)
|
||||
if err != nil {
|
||||
return fmt.Errorf("s.db.Events: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue