diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index c1ef0f89..6b979171 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -577,12 +577,14 @@ func SendJoin( // the response in situ. replaced := false for i := range stateAndAuthChainResponse.StateEvents { - event := stateAndAuthChainResponse.StateEvents[i] + stateEvent := stateAndAuthChainResponse.StateEvents[i] if event.Type() != gomatrixserverlib.MRoomMember { continue } - if event.StateKeyEquals(*event.StateKey()) { - stateAndAuthChainResponse.StateEvents[i] = event + if stateEvent.StateKeyEquals(*event.StateKey()) { + stateAndAuthChainResponse.StateEvents[i] = event.Headered( + stateAndAuthChainResponse.RoomVersion, + ) replaced = true break } diff --git a/federationsender/internal/perform.go b/federationsender/internal/perform.go index fabb7e9e..f358c2ea 100644 --- a/federationsender/internal/perform.go +++ b/federationsender/internal/perform.go @@ -209,6 +209,8 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer( return fmt.Errorf("respMakeJoin.JoinEvent.Build: %w", err) } + fmt.Println("Join event:", event.EventID()) + // No longer reuse the request context from this point forward. // We don't want the client timing out to interrupt the join. var cancel context.CancelFunc