mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-13 17:13:11 +01:00
Use consistent error message for media not found errors
Sometimes it's encrypted, sometimes it's not
This commit is contained in:
parent
fdb0718670
commit
289d410a4b
1 changed files with 5 additions and 1 deletions
|
@ -2304,7 +2304,11 @@ func (portal *Portal) handleMediaRetry(retry *events.MediaRetry, source *User) {
|
||||||
errorName := waProto.MediaRetryNotification_MediaRetryNotificationResultType_name[int32(retryData.GetResult())]
|
errorName := waProto.MediaRetryNotification_MediaRetryNotificationResultType_name[int32(retryData.GetResult())]
|
||||||
portal.log.Warnfln("Got error response in media retry notification for %s: %s", retry.MessageID, errorName)
|
portal.log.Warnfln("Got error response in media retry notification for %s: %s", retry.MessageID, errorName)
|
||||||
portal.log.Debugfln("Error response contents: %s / %s", retryData.GetStanzaId(), retryData.GetDirectPath())
|
portal.log.Debugfln("Error response contents: %s / %s", retryData.GetStanzaId(), retryData.GetDirectPath())
|
||||||
|
if retryData.GetResult() == waProto.MediaRetryNotification_NOT_FOUND {
|
||||||
|
portal.sendMediaRetryFailureEdit(intent, msg, whatsmeow.ErrMediaNotAvailableOnPhone)
|
||||||
|
} else {
|
||||||
portal.sendMediaRetryFailureEdit(intent, msg, fmt.Errorf("phone sent error response: %s", errorName))
|
portal.sendMediaRetryFailureEdit(intent, msg, fmt.Errorf("phone sent error response: %s", errorName))
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue