aboutsummaryrefslogtreecommitdiff
path: root/ui/messages
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-05-27 14:49:46 +0300
committerTulir Asokan <tulir@maunium.net>2018-05-27 14:51:16 +0300
commitb63c451706ab2cec003689e2e8047af737fb1b1c (patch)
treeb0ec45cdb42e575f6e54e5cb0c76dfceecbaba2e /ui/messages
parentc9e138c5e8e589efa82e2b3cad189806dc35d981 (diff)
Fix m.emote messages in bare message views
Diffstat (limited to 'ui/messages')
-rw-r--r--ui/messages/textbase.go12
1 files changed, 8 insertions, 4 deletions
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')