From b63c451706ab2cec003689e2e8047af737fb1b1c Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 27 May 2018 14:49:46 +0300 Subject: Fix m.emote messages in bare message views --- ui/messages/textbase.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ui/messages') diff --git a/ui/messages/textbase.go b/ui/messages/textbase.go index faf53e6..9f34683 100644 --- a/ui/messages/textbase.go +++ b/ui/messages/textbase.go @@ -58,10 +58,14 @@ func (msg *BaseMessage) calculateBufferWithText(bare bool, text tstring.TString, msg.buffer = []tstring.TString{} if bare { - text = tstring. - NewTString(msg.FormatTime()). - AppendTString(tstring.NewColorTString(fmt.Sprintf(" <%s> ", msg.Sender()), msg.SenderColor())). - AppendTString(text) + newText := tstring.NewTString(msg.FormatTime()) + if len(msg.Sender()) > 0 { + newText = newText.AppendTString(tstring.NewColorTString(fmt.Sprintf(" <%s> ", msg.Sender()), msg.SenderColor())) + } else { + newText = newText.Append(" ") + } + newText = newText.AppendTString(text) + text = newText } forcedLinebreaks := text.Split('\n') -- cgit v1.2.3