Fix the bug that messages cannot be deleted synchronously if the room is created in the matrix client
(maybe there is a better way)
This commit is contained in:
parent
16af59c848
commit
da535e7346
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue