diff options
author | Tulir Asokan <tulir@maunium.net> | 2019-06-17 12:27:31 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2019-06-17 12:27:31 +0300 |
commit | fe439f076ad3d76c459c9a76c4bbdcda5182ed85 (patch) | |
tree | c15399d67bea1661088146e0c28cab0a39a3a4ed /ui/messages/html | |
parent | 754f8e493df64d6532ace194f3e75c9ccf5bfd95 (diff) |
Wrap events in custom struct to add gomuks-specific fields
Diffstat (limited to 'ui/messages/html')
-rw-r--r-- | ui/messages/html/parser.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/messages/html/parser.go b/ui/messages/html/parser.go index a0757c4..99f9c29 100644 --- a/ui/messages/html/parser.go +++ b/ui/messages/html/parser.go @@ -27,6 +27,7 @@ import ( "github.com/lucasb-eyer/go-colorful" "golang.org/x/net/html" + "maunium.net/go/gomuks/matrix/event" "maunium.net/go/mautrix" "maunium.net/go/tcell" @@ -382,7 +383,7 @@ func (parser *htmlParser) Parse(htmlData string) Entity { const TabLength = 4 // Parse parses a HTML-formatted Matrix event into a UIMessage. -func Parse(room *rooms.Room, evt *mautrix.Event, senderDisplayname string) Entity { +func Parse(room *rooms.Room, evt *event.Event, senderDisplayname string) Entity { htmlData := evt.Content.FormattedBody if evt.Content.Format != mautrix.FormatHTML { htmlData = strings.Replace(html.EscapeString(evt.Content.Body), "\n", "<br/>", -1) |