mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-05-29 01:03:53 +02:00
Add checkpoints for ignored redactions. Closes #399
This commit is contained in:
parent
1608bdf612
commit
0a8cc8fd39
|
@ -2168,12 +2168,15 @@ func (portal *Portal) HandleMatrixRedaction(sender *User, evt *event.Event) {
|
|||
msg := portal.bridge.DB.Message.GetByMXID(evt.Redacts)
|
||||
if msg == nil {
|
||||
portal.log.Debugfln("Ignoring redaction %s of unknown event by %s", msg, senderLogIdentifier)
|
||||
portal.bridge.AS.SendErrorMessageSendCheckpoint(evt, appservice.StepRemote, errors.New("target not found"), true)
|
||||
return
|
||||
} else if msg.IsFakeJID() {
|
||||
portal.log.Debugfln("Ignoring redaction %s of fake event by %s", msg, senderLogIdentifier)
|
||||
portal.bridge.AS.SendErrorMessageSendCheckpoint(evt, appservice.StepRemote, errors.New("target is a fake event"), true)
|
||||
return
|
||||
} else if msg.Sender.User != sender.JID.User {
|
||||
portal.log.Debugfln("Ignoring redaction %s of %s/%s by %s: message was sent by someone else (%s, not %s)", evt.ID, msg.MXID, msg.JID, senderLogIdentifier, msg.Sender, sender.JID)
|
||||
portal.bridge.AS.SendErrorMessageSendCheckpoint(evt, appservice.StepRemote, errors.New("message was sent by someone else"), true)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue