Push fixes

This commit is contained in:
Neil Alexander 2021-11-15 11:27:07 +00:00
parent 623b61b3c2
commit 19ee1a4f38
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 7 additions and 3 deletions

View file

@ -577,12 +577,14 @@ func SendJoin(
// the response in situ. // the response in situ.
replaced := false replaced := false
for i := range stateAndAuthChainResponse.StateEvents { for i := range stateAndAuthChainResponse.StateEvents {
event := stateAndAuthChainResponse.StateEvents[i] stateEvent := stateAndAuthChainResponse.StateEvents[i]
if event.Type() != gomatrixserverlib.MRoomMember { if event.Type() != gomatrixserverlib.MRoomMember {
continue continue
} }
if event.StateKeyEquals(*event.StateKey()) { if stateEvent.StateKeyEquals(*event.StateKey()) {
stateAndAuthChainResponse.StateEvents[i] = event stateAndAuthChainResponse.StateEvents[i] = event.Headered(
stateAndAuthChainResponse.RoomVersion,
)
replaced = true replaced = true
break break
} }

View file

@ -209,6 +209,8 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer(
return fmt.Errorf("respMakeJoin.JoinEvent.Build: %w", err) return fmt.Errorf("respMakeJoin.JoinEvent.Build: %w", err)
} }
fmt.Println("Join event:", event.EventID())
// No longer reuse the request context from this point forward. // No longer reuse the request context from this point forward.
// We don't want the client timing out to interrupt the join. // We don't want the client timing out to interrupt the join.
var cancel context.CancelFunc var cancel context.CancelFunc