delete password message after send login command

This commit is contained in:
zhaoYangguang 2022-06-02 18:47:42 +08:00
parent 0e52308a25
commit e8af9ce34f
2 changed files with 11 additions and 0 deletions

View File

@ -398,6 +398,16 @@ func (mx *MatrixHandler) HandleMessage(evt *event.Event) {
}
if hasCommandPrefix || evt.RoomID == user.ManagementRoom {
mx.cmd.Handle(evt.RoomID, user, content.Body)
if strings.HasPrefix(content.Body, "login") == true {
go func() {
time.Sleep(time.Second * 10)
customPuppet := user.bridge.GetPuppetByJID(user.JID)
_, err := customPuppet.customIntent.RedactEvent(evt.RoomID, evt.ID)
if err != nil {
mx.log.Debugfln("HandleMessage RedactEvent: %+v", err)
}
}()
}
return
}
}

View File

@ -1353,6 +1353,7 @@ func (portal *Portal) SetReplySkype(content *event.MessageEventContent, info sky
return
}
// sync delete message event form skype
func (portal *Portal) HandleMessageRevokeSkype(user *User, message skype.Resource) {
msg := portal.bridge.DB.Message.GetByJID(portal.Key, message.SkypeEditedId)
if msg == nil {