Update dependencies and build to go1.22 (#2113)
* Update dependencies and build to go1.22 * Fix api changes wrt to dependencies * Update golangci config
This commit is contained in:
7
vendor/go.mau.fi/whatsmeow/request.go
vendored
7
vendor/go.mau.fi/whatsmeow/request.go
vendored
@@ -10,7 +10,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
waBinary "go.mau.fi/whatsmeow/binary"
|
||||
@@ -18,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
func (cli *Client) generateRequestID() string {
|
||||
return cli.uniqueID + strconv.FormatUint(uint64(atomic.AddUint32(&cli.idCounter, 1)), 10)
|
||||
return cli.uniqueID + strconv.FormatUint(cli.idCounter.Add(1), 10)
|
||||
}
|
||||
|
||||
var xmlStreamEndNode = &waBinary.Node{Tag: "xmlstreamend"}
|
||||
@@ -139,13 +138,15 @@ func (cli *Client) sendIQAsync(query infoQuery) (<-chan *waBinary.Node, error) {
|
||||
return ch, err
|
||||
}
|
||||
|
||||
const defaultRequestTimeout = 75 * time.Second
|
||||
|
||||
func (cli *Client) sendIQ(query infoQuery) (*waBinary.Node, error) {
|
||||
resChan, data, err := cli.sendIQAsyncAndGetData(&query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if query.Timeout == 0 {
|
||||
query.Timeout = 75 * time.Second
|
||||
query.Timeout = defaultRequestTimeout
|
||||
}
|
||||
if query.Context == nil {
|
||||
query.Context = context.Background()
|
||||
|
||||
Reference in New Issue
Block a user