Signed-off-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
This commit is contained in:
Till Faelligen 2025-05-17 19:27:43 +02:00
parent a6fe816066
commit fb059f2303
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -13,7 +13,7 @@ import (
"errors" "errors"
"fmt" "fmt"
//"github.com/element-hq/dendrite/roomserver/internal" // "github.com/element-hq/dendrite/roomserver/internal"
"github.com/element-hq/dendrite/setup/config" "github.com/element-hq/dendrite/setup/config"
"github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/spec" "github.com/matrix-org/gomatrixserverlib/spec"
@ -747,7 +747,7 @@ func GetAuthChain(
// from the database and the `eventsToFetch` will be updated with any new // from the database and the `eventsToFetch` will be updated with any new
// events that we have learned about and need to find. When `eventsToFetch` // events that we have learned about and need to find. When `eventsToFetch`
// is eventually empty, we should have reached the end of the chain. // is eventually empty, we should have reached the end of the chain.
eventsToFetch := authEventIDs eventsToFetch := append([]string{}, authEventIDs...)
authEventsMap := make(map[string]gomatrixserverlib.PDU) authEventsMap := make(map[string]gomatrixserverlib.PDU)
for len(eventsToFetch) > 0 { for len(eventsToFetch) > 0 {
@ -779,7 +779,7 @@ func GetAuthChain(
// We've now retrieved all of the events we can. Flatten them down into an // We've now retrieved all of the events we can. Flatten them down into an
// array and return them. // array and return them.
var authEvents []gomatrixserverlib.PDU authEvents := make([]gomatrixserverlib.PDU, 0, len(authEventsMap))
for _, event := range authEventsMap { for _, event := range authEventsMap {
authEvents = append(authEvents, event) authEvents = append(authEvents, event)
} }