From 4849ef08b861ee5886f879c320ee6e1d8169f139 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 22 May 2018 21:18:46 +0300 Subject: [PATCH] Re-enable coloring of new name in name change events --- ui/messages/parser/parser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/messages/parser/parser.go b/ui/messages/parser/parser.go index 1fb64c4..19c86e7 100644 --- a/ui/messages/parser/parser.go +++ b/ui/messages/parser/parser.go @@ -145,7 +145,9 @@ func getMembershipEventContent(room *rooms.Room, evt *gomatrix.Event) (sender st } else if displayname != prevDisplayname { sender = "---" text = tstring.NewColorTString(fmt.Sprintf("%s changed their display name to %s.", prevDisplayname, displayname), tcell.ColorGreen) - text.Colorize(0, len(prevDisplayname), widget.GetHashColor(*evt.StateKey)) + color := widget.GetHashColor(*evt.StateKey) + text.Colorize(0, len(prevDisplayname), color) + text.Colorize(len(prevDisplayname) + len(" changed their display name to "), len(displayname), color) } return }