forked from MirrorHub/mautrix-whatsapp
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())
|
||||||
portal.sendMediaRetryFailureEdit(intent, msg, fmt.Errorf("phone sent error response: %s", errorName))
|
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))
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue