Skip to content

Commit

Permalink
decrypt: request unavailable messages from phone after 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 26, 2024
1 parent eb41d1f commit 018536a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (cli *Client) handlePlaintextMessage(info *types.MessageInfo, node *waBinar
func (cli *Client) decryptMessages(info *types.MessageInfo, node *waBinary.Node) {
if len(node.GetChildrenByTag("unavailable")) > 0 && len(node.GetChildrenByTag("enc")) == 0 {
cli.Log.Warnf("Unavailable message %s from %s", info.ID, info.SourceString())
go cli.sendAck(node)
go cli.delayedRequestMessageFromPhone(info)
cli.dispatchEvent(&events.UndecryptableMessage{Info: *info, IsUnavailable: true})
return
}
Expand Down Expand Up @@ -301,9 +301,7 @@ func (cli *Client) decryptMessages(info *types.MessageInfo, node *waBinary.Node)
return
}
retryCount := ag.OptionalInt("count")
if retryCount > 0 {
cli.cancelDelayedRequestFromPhone(info.ID)
}
cli.cancelDelayedRequestFromPhone(info.ID)

var msg waE2E.Message
switch ag.Int("v") {
Expand Down

0 comments on commit 018536a

Please sign in to comment.