fix 'email has been sent' msg type, fixes #48

This commit is contained in:
Aine
2022-11-17 23:19:16 +02:00
parent aba1a6521d
commit 2e712e0a67

View File

@@ -290,12 +290,12 @@ func (b *Bot) saveSentMetadata(ctx context.Context, queued bool, threadID id.Eve
evt := eventFromContext(ctx)
content := email.Content(threadID, cfg.ContentOptions())
notice := format.RenderMarkdown(text, true, true)
notice.MsgType = event.MsgNotice
msgContent, ok := content.Parsed.(*event.MessageEventContent)
if !ok {
b.Error(ctx, evt.RoomID, "cannot parse message")
return
}
msgContent.MsgType = event.MsgNotice
msgContent.Body = notice.Body
msgContent.FormattedBody = notice.FormattedBody
content.Parsed = msgContent