Skip to content

Commit eddaa1b

Browse files
Merge branch 'main' of https://github.com/tulir/whatsmeow
2 parents f37ff13 + 495e4eb commit eddaa1b

25 files changed

+1828
-1374
lines changed

binary/encoder.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func validateHex(value string) bool {
286286
return false
287287
}
288288
for _, char := range value {
289-
if !(char >= '0' && char <= '9') && !(char >= 'A' && char <= 'F') && !(char >= 'a' && char <= 'f') {
289+
if !(char >= '0' && char <= '9') && !(char >= 'A' && char <= 'F') {
290290
return false
291291
}
292292
}
@@ -299,8 +299,6 @@ func packHex(value byte) byte {
299299
return value - '0'
300300
case value >= 'A' && value <= 'F':
301301
return 10 + value - 'A'
302-
case value >= 'a' && value <= 'f':
303-
return 10 + value - 'a'
304302
case value == 0:
305303
return 15
306304
default:

connectionevents.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ func (cli *Client) handleConnectFailure(node *waBinary.Node) {
101101
// By default, expect a disconnect (i.e. prevent auto-reconnect)
102102
cli.expectDisconnect()
103103
willAutoReconnect = false
104-
case reason == events.ConnectFailureServiceUnavailable:
104+
case reason == events.ConnectFailureServiceUnavailable || reason == events.ConnectFailureInternalServerError:
105105
// Auto-reconnect for 503s
106106
case reason == events.ConnectFailureCATInvalid || reason == events.ConnectFailureCATExpired:
107107
// Auto-reconnect when rotating CAT, lock socket to ensure refresh goes through before reconnect
108108
cli.socketLock.RLock()
109109
defer cli.socketLock.RUnlock()
110-
case reason == 500 && message == "biz vname fetch error":
111-
// These happen for business accounts randomly, also auto-reconnect
112110
}
113111
if reason == 403 {
114112
cli.Log.Debugf(

go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ module go.mau.fi/whatsmeow
22

33
go 1.22.0
44

5-
toolchain go1.23.4
5+
toolchain go1.23.5
66

77
require (
88
github.com/google/uuid v1.6.0
99
github.com/gorilla/websocket v1.5.0
1010
github.com/rs/zerolog v1.33.0
1111
go.mau.fi/libsignal v0.1.1
12-
go.mau.fi/util v0.8.3
13-
golang.org/x/crypto v0.31.0
14-
golang.org/x/net v0.33.0
15-
google.golang.org/protobuf v1.36.1
12+
go.mau.fi/util v0.8.4
13+
golang.org/x/crypto v0.32.0
14+
golang.org/x/net v0.34.0
15+
google.golang.org/protobuf v1.36.4
1616
)
1717

1818
require (
1919
filippo.io/edwards25519 v1.1.0 // indirect
2020
github.com/mattn/go-colorable v0.1.13 // indirect
2121
github.com/mattn/go-isatty v0.0.19 // indirect
22-
golang.org/x/sys v0.28.0 // indirect
22+
golang.org/x/sys v0.29.0 // indirect
2323
)

go.sum

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
2525
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
2626
go.mau.fi/libsignal v0.1.1 h1:m/0PGBh4QKP/I1MQ44ti4C0fMbLMuHb95cmDw01FIpI=
2727
go.mau.fi/libsignal v0.1.1/go.mod h1:QLs89F/OA3ThdSL2Wz2p+o+fi8uuQUz0e1BRa6ExdBw=
28-
go.mau.fi/util v0.8.3 h1:sulhXtfquMrQjsOP67x9CzWVBYUwhYeoo8hNQIpCWZ4=
29-
go.mau.fi/util v0.8.3/go.mod h1:c00Db8xog70JeIsEvhdHooylTkTkakgnAOsZ04hplQY=
30-
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
31-
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
32-
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
33-
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
28+
go.mau.fi/util v0.8.4 h1:mVKlJcXWfVo8ZW3f4vqtjGpqtZqJvX4ETekxawt2vnQ=
29+
go.mau.fi/util v0.8.4/go.mod h1:MOfGTs1CBuK6ERTcSL4lb5YU7/ujz09eOPVEDckuazY=
30+
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
31+
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
32+
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
33+
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
3434
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3535
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3636
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
37-
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
38-
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
37+
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
38+
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3939
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
4040
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
41-
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
42-
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
41+
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
42+
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
4343
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
4444
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

group.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (cli *Client) UpdateGroupParticipants(jid types.JID, participantChanges []t
176176
}
177177

178178
// GetGroupRequestParticipants gets the list of participants that have requested to join the group.
179-
func (cli *Client) GetGroupRequestParticipants(jid types.JID) ([]types.JID, error) {
179+
func (cli *Client) GetGroupRequestParticipants(jid types.JID) ([]types.GroupParticipantRequest, error) {
180180
resp, err := cli.sendGroupIQ(context.TODO(), iqGet, jid, waBinary.Node{
181181
Tag: "membership_approval_requests",
182182
})
@@ -188,9 +188,12 @@ func (cli *Client) GetGroupRequestParticipants(jid types.JID) ([]types.JID, erro
188188
return nil, &ElementMissingError{Tag: "membership_approval_requests", In: "response to group request participants query"}
189189
}
190190
requestParticipants := request.GetChildrenByTag("membership_approval_request")
191-
participants := make([]types.JID, len(requestParticipants))
191+
participants := make([]types.GroupParticipantRequest, len(requestParticipants))
192192
for i, req := range requestParticipants {
193-
participants[i] = req.AttrGetter().JID("jid")
193+
participants[i] = types.GroupParticipantRequest{
194+
JID: req.AttrGetter().JID("jid"),
195+
RequestedAt: req.AttrGetter().UnixTime("request_time"),
196+
}
194197
}
195198
return participants, nil
196199
}

message.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ func (cli *Client) decryptMessages(info *types.MessageInfo, node *waBinary.Node)
292292
if err != nil {
293293
cli.Log.Warnf("Error decrypting message from %s: %v", info.SourceString(), err)
294294
isUnavailable := encType == "skmsg" && !containsDirectMsg && errors.Is(err, signalerror.ErrNoSenderKeyForUser)
295-
go cli.sendRetryReceipt(node, info, isUnavailable)
295+
// TODO figure out why @bot messages fail to decrypt
296+
if info.Chat.Server != types.BotServer {
297+
go cli.sendRetryReceipt(node, info, isUnavailable)
298+
}
296299
cli.dispatchEvent(&events.UndecryptableMessage{
297300
Info: *info,
298301
IsUnavailable: isUnavailable,

0 commit comments

Comments
 (0)