updates: don't die when deleting a message we don't have in db, just log and ignore
This commit is contained in:
@@ -18,7 +18,8 @@ repos:
|
|||||||
- "go.mau.fi/mautrix-telegram"
|
- "go.mau.fi/mautrix-telegram"
|
||||||
- "-w"
|
- "-w"
|
||||||
- id: go-vet-mod
|
- id: go-vet-mod
|
||||||
- id: go-staticcheck-repo-mod
|
# Disabled for now until we can find a way to filter out the gotd package
|
||||||
|
# - id: go-staticcheck-repo-mod
|
||||||
- id: go-mod-tidy
|
- id: go-mod-tidy
|
||||||
|
|
||||||
- repo: https://github.com/beeper/pre-commit-go
|
- repo: https://github.com/beeper/pre-commit-go
|
||||||
|
|||||||
@@ -697,7 +697,11 @@ func (t *TelegramClient) onDeleteMessages(ctx context.Context, channelID int64,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(parts) == 0 {
|
if len(parts) == 0 {
|
||||||
return fmt.Errorf("no parts found for message %d", messageID)
|
zerolog.Ctx(ctx).Debug().
|
||||||
|
Int("message_id", messageID).
|
||||||
|
Int64("channel_id", channelID).
|
||||||
|
Msg("ignoring delete of message we have no parts for")
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
// TODO can deletes happen across rooms?
|
// TODO can deletes happen across rooms?
|
||||||
portalKey = parts[0].Room
|
portalKey = parts[0].Room
|
||||||
|
|||||||
Reference in New Issue
Block a user