From da535e73462b467ce887875137d02ee59ab07fd4 Mon Sep 17 00:00:00 2001 From: zhaoYangguang <1163765691@qq.com> Date: Mon, 14 Dec 2020 19:25:07 +0800 Subject: [PATCH] Fix the bug that messages cannot be deleted synchronously if the room is created in the matrix client (maybe there is a better way) --- portal.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/portal.go b/portal.go index 069c9fc..a46c5f7 100644 --- a/portal.go +++ b/portal.go @@ -1338,6 +1338,10 @@ func (portal *Portal) HandleMessageRevokeSkype(user *User, message skype.Resourc } _, err := intent.RedactEvent(portal.MXID, msg.MXID) if err != nil { + // TODO Maybe there is a better implementation + if strings.Index(err.Error(), "M_FORBIDDEN") > -1 { + _, err = portal.MainIntent().RedactEvent(portal.MXID, msg.MXID) + } portal.log.Errorln("Failed to redact %s: %v", msg.JID, err) return }