Don't panic if redacting attachment fails

This commit is contained in:
Tulir Asokan 2023-08-29 11:43:09 +03:00
parent 185f9a8963
commit c710ea18aa

View file

@ -884,12 +884,13 @@ func (portal *Portal) handleDiscordMessageUpdate(user *User, msg *discordgo.Mess
for _, deletedAttachment := range attachmentMap {
resp, err := intent.RedactEvent(portal.MXID, deletedAttachment.MXID)
if err != nil {
log.Warn().Err(err).
log.Err(err).
Str("event_id", deletedAttachment.MXID.String()).
Msg("Failed to redact attachment")
} else {
redactions.Str(deletedAttachment.AttachmentID, resp.EventID.String())
}
deletedAttachment.Delete()
redactions.Str(deletedAttachment.AttachmentID, resp.EventID.String())
}
var converted *ConvertedMessage