Update check for remote join event

This commit is contained in:
Neil Alexander 2021-11-15 10:26:12 +00:00
parent d0e7bc0f27
commit 623b61b3c2
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -259,24 +259,11 @@ func (r *FederationSenderInternalAPI) performJoinUsingServer(
// Find the membership event. // Find the membership event.
var joinEvent *gomatrixserverlib.Event var joinEvent *gomatrixserverlib.Event
var membership string for _, stateEvent := range respState.StateEvents {
for _, event := range respState.StateEvents { if stateEvent.EventID() == event.EventID() {
stateKey := event.StateKey() joinEvent = event
if stateKey == nil { break
continue
} }
if *stateKey != userID {
continue
}
membership, err = event.Membership()
if err != nil {
continue
}
if membership != gomatrixserverlib.Join {
continue
}
joinEvent = event
break
} }
if joinEvent == nil { if joinEvent == nil {
err = fmt.Errorf("The remote server did not send back our join event") err = fmt.Errorf("The remote server did not send back our join event")