Skip to content

Commit

Permalink
Don't panic if redacting attachment fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Aug 29, 2023
1 parent 185f9a8 commit c710ea1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c710ea1

Please sign in to comment.