Skip to content

Commit

Permalink
Switch to bad credentials when we get an IG challenge or suspended er…
Browse files Browse the repository at this point in the history
…ror on message conversion
  • Loading branch information
Fizzadar committed Jul 26, 2024
1 parent 58c77b9 commit b99ef34
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,18 @@ func (portal *Portal) handleMatrixMessage(ctx context.Context, sender *User, evt
Error: MetaCookieRemoved,
})
err = errLoggedOut
} else if errors.Is(err, messagix.ErrChallengeRequired) {
go sender.DisconnectFromError(status.BridgeState{
StateEvent: status.StateBadCredentials,
Error: IGChallengeRequired,
})
err = errLoggedOut
} else if errors.Is(err, messagix.ErrAccountSuspended) {
go sender.DisconnectFromError(status.BridgeState{
StateEvent: status.StateBadCredentials,
Error: IGAccountSuspended,
})
err = errLoggedOut
}
}
if err != nil {
Expand Down

0 comments on commit b99ef34

Please sign in to comment.