Skip to content

Commit

Permalink
client: use synchronous acks for whatsapp when portal event buffer is…
Browse files Browse the repository at this point in the history
… disabled
  • Loading branch information
tulir committed Feb 10, 2025
1 parent 104e70c commit 4f4ea19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/rs/zerolog v1.33.0
go.mau.fi/util v0.8.5-0.20250203220331-1c0d19ea6003
go.mau.fi/webp v0.2.0
go.mau.fi/whatsmeow v0.0.0-20250131212655-c3c6a06399a5
go.mau.fi/whatsmeow v0.0.0-20250210124836-838d5eeaf73e
golang.org/x/image v0.23.0
golang.org/x/net v0.34.0
golang.org/x/sync v0.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ go.mau.fi/util v0.8.5-0.20250203220331-1c0d19ea6003 h1:ye5l+QpYW5CpGVMedb3EHlmfl
go.mau.fi/util v0.8.5-0.20250203220331-1c0d19ea6003/go.mod h1:MOfGTs1CBuK6ERTcSL4lb5YU7/ujz09eOPVEDckuazY=
go.mau.fi/webp v0.2.0 h1:QVMenHw7JDb4vall5sV75JNBQj9Hw4u8AKbi1QetHvg=
go.mau.fi/webp v0.2.0/go.mod h1:VSg9MyODn12Mb5pyG0NIyNFhujrmoFSsZBs8syOZD1Q=
go.mau.fi/whatsmeow v0.0.0-20250131212655-c3c6a06399a5 h1:B2YzMq0PfGN+SCPW9gKnfvGBQTod6aNL096xDRmi2hY=
go.mau.fi/whatsmeow v0.0.0-20250131212655-c3c6a06399a5/go.mod h1:PG1x7fBW66I9q/e8a9mU2qF9M94+kK32MceMWgxBoiw=
go.mau.fi/whatsmeow v0.0.0-20250210124836-838d5eeaf73e h1:29JB5UMhd3kzLj0GpKUnZM8ZpyP3o9Kd0iDRtXgLvog=
go.mau.fi/whatsmeow v0.0.0-20250210124836-838d5eeaf73e/go.mod h1:PG1x7fBW66I9q/e8a9mU2qF9M94+kK32MceMWgxBoiw=
go.mau.fi/zeroconfig v0.1.3 h1:As9wYDKmktjmNZW5i1vn8zvJlmGKHeVxHVIBMXsm4kM=
go.mau.fi/zeroconfig v0.1.3/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
Expand Down
3 changes: 3 additions & 0 deletions pkg/connector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func (wa *WhatsAppConnector) LoadUserLogin(_ context.Context, login *bridgev2.Us
log := w.UserLogin.Log.With().Str("component", "whatsmeow").Logger()
w.Client = whatsmeow.NewClient(w.Device, waLog.Zerolog(log))
w.Client.AddEventHandler(w.handleWAEvent)
if bridgev2.PortalEventBuffer == 0 {
w.Client.SynchronousAck = true
}
w.Client.AutomaticMessageRerequestFromPhone = true
w.Client.GetMessageForRetry = w.trackNotFoundRetry
w.Client.PreRetryCallback = w.trackFoundRetry
Expand Down

0 comments on commit 4f4ea19

Please sign in to comment.