From fe439f076ad3d76c459c9a76c4bbdcda5182ed85 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 17 Jun 2019 12:27:31 +0300 Subject: Wrap events in custom struct to add gomuks-specific fields --- ui/messages/html/parser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/messages/html') 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", "
", -1) -- cgit v1.2.3-70-g09d2