Skip to content

Commit

Permalink
dependencies: update mautrix-go
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 2, 2024
1 parent b9780f7 commit 2310238
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
google.golang.org/protobuf v1.35.2
gopkg.in/yaml.v3 v3.0.1
maunium.net/go/mautrix v0.22.1-0.20241120132537-ed709621d43a
maunium.net/go/mautrix v0.22.1-0.20241202131110-166ba04aae02
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
maunium.net/go/mautrix v0.22.1-0.20241120132537-ed709621d43a h1:5dijBIsVWXhsRoAP67fu3ZPaiZDc617uOTwZLtGro+o=
maunium.net/go/mautrix v0.22.1-0.20241120132537-ed709621d43a/go.mod h1:oqwf9WYC/brqucM+heYk4gX11O59nP+ljvyxVhndFIM=
maunium.net/go/mautrix v0.22.1-0.20241202131110-166ba04aae02 h1:g8L4GpOhyg5EuXtASDKyU9Cg79ZjATlUnh+giFumQgc=
maunium.net/go/mautrix v0.22.1-0.20241202131110-166ba04aae02/go.mod h1:oqwf9WYC/brqucM+heYk4gX11O59nP+ljvyxVhndFIM=
5 changes: 2 additions & 3 deletions pkg/connector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ func (gc *GMConnector) LoadUserLogin(ctx context.Context, login *bridgev2.UserLo
return nil
}

func (gc *GMClient) Connect(ctx context.Context) error {
func (gc *GMClient) Connect(ctx context.Context) {
if gc.Client == nil {
gc.UserLogin.BridgeState.Send(status.BridgeState{
StateEvent: status.StateBadCredentials,
Error: GMNotLoggedIn,
})
return nil
return
}
err := gc.Client.Connect()
if err != nil {
Expand All @@ -114,7 +114,6 @@ func (gc *GMClient) Connect(ctx context.Context) error {
})
}
}
return nil
}

func (gc *GMClient) Disconnect() {
Expand Down
5 changes: 1 addition & 4 deletions pkg/connector/handlegmessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,7 @@ func (gc *GMClient) hackyResetActive() {
if !gc.ready && gc.PhoneResponding && gc.Client != nil {
gc.UserLogin.Log.Warn().Msg("Client is still not ready, reconnecting")
gc.ResetClient()
err = gc.Connect(context.TODO())
if err != nil {
gc.UserLogin.Log.Err(err).Msg("Failed to reconnect after force reset")
}
gc.Connect(gc.UserLogin.Log.WithContext(context.TODO()))
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/connector/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,7 @@ func (gc *GMConnector) finishLogin(ctx context.Context, user *bridgev2.User, cli
// the phone won't recognize the session the bridge will get unpaired.
time.Sleep(2 * time.Second)
}
err = ul.Client.Connect(ul.Log.WithContext(context.Background()))
if err != nil {
return nil, fmt.Errorf("failed to connect after login: %w", err)
}
ul.Client.Connect(ul.Log.WithContext(context.Background()))
return &bridgev2.LoginStep{
Type: bridgev2.LoginStepTypeComplete,
StepID: LoginStepIDComplete,
Expand Down

0 comments on commit 2310238

Please sign in to comment.