Implement sending redactions

This commit is contained in:
Tulir Asokan
2020-03-01 22:35:21 +02:00
parent 5ea77a6c5f
commit c829e436e4
4 changed files with 25 additions and 6 deletions

View File

@ -768,7 +768,13 @@ func (c *Container) PrepareMarkdownMessage(roomID string, msgtype mautrix.Messag
return localEcho
}
// SendMarkdownMessage sends a message with the given markdown text to the given room.
func (c *Container) Redact(roomID, eventID, reason string) error {
defer debug.Recover()
_, err := c.client.RedactEvent(roomID, eventID, mautrix.ReqRedact{Reason: reason})
return err
}
// SendMessage sends the given event.
func (c *Container) SendEvent(event *event.Event) (string, error) {
defer debug.Recover()