mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Update check for remote join event
This commit is contained in:
parent
d0e7bc0f27
commit
623b61b3c2
1 changed files with 4 additions and 17 deletions
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue