From ecdd4f08cb262c8f0c988209e6296c068e1d4cf3 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 5 Jul 2020 17:54:05 +0300 Subject: [PATCH] Support edits without m.new_content --- ui/messages/parser.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/messages/parser.go b/ui/messages/parser.go index 4e87d1f..349794d 100644 --- a/ui/messages/parser.go +++ b/ui/messages/parser.go @@ -196,7 +196,10 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *muksevt.Eve content.RemoveReplyFallback() } if len(evt.Gomuks.Edits) > 0 { - content = evt.Gomuks.Edits[len(evt.Gomuks.Edits)-1].Content.AsMessage().NewContent + newContent := evt.Gomuks.Edits[len(evt.Gomuks.Edits)-1].Content.AsMessage().NewContent + if newContent != nil { + content = newContent + } } switch content.MsgType { case event.MsgText, event.MsgNotice, event.MsgEmote: