Skip to content

Commit

Permalink
Ignore ErrFileLengthMismatch and other soft errors on receiving files.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoehermann committed Jan 13, 2023
1 parent f5ad70f commit 8680dff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/go/handle_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ func (handler *Handler) handle_attachment(message *waProto.Message, source types
mimetype = sm.Mimetype
}
if err != nil {
purple_display_system_message(handler.account, chat, source.IsGroup, fmt.Sprintf("Message contained an attachment, but the download failed: %#v", err))
return
if data == nil || len(data) == 0 {
purple_display_system_message(handler.account, chat, source.IsGroup, fmt.Sprintf("Message contained an attachment, but the download failed: %v", err))
return
} else {
handler.log.Warnf("Forwarding file %s to frontend regardless of error: %v", filename, err)
}
}
if filename != "" {
sender := source.Sender.ToNonAD()
Expand Down

0 comments on commit 8680dff

Please sign in to comment.