From 1639b84d8685a09706abb303e21f1d73ec57ad1a Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Sun, 1 Jan 2023 02:05:44 +0100 Subject: feat(ui): improve /TOPIC ui --- app.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'app.go') diff --git a/app.go b/app.go index f65ec4c..cc4137b 100644 --- a/app.go +++ b/app.go @@ -1492,14 +1492,20 @@ func (app *App) printTopic(netID, buffer string) (ok bool) { } topic, who, at := s.Topic(buffer) topic = ui.IRCString(topic).String() - if who == nil { - body = fmt.Sprintf("Topic: %s", topic) + app.win.AddLine(netID, buffer, ui.Line{ + At: time.Now(), + Head: "topic", + HeadColor: tcell.ColorGray, + Body: ui.Styled(topic, tcell.StyleDefault.Foreground(tcell.ColorWhite)), + }) + if who != nil { + body = fmt.Sprintf("%s at %s", who, at.Local().Format("Mon 2 Jan 15:04:05")) } else { - body = fmt.Sprintf("Topic (by %s, %s): %s", who, at.Local().Format("Mon Jan 2 15:04:05"), topic) + body = fmt.Sprintf("%s", at.Local().Format("Mon 2 Jan 15:04:05")) } app.win.AddLine(netID, buffer, ui.Line{ At: time.Now(), - Head: "--", + Head: "—", HeadColor: tcell.ColorGray, Body: ui.Styled(body, tcell.StyleDefault.Foreground(tcell.ColorGray)), }) -- cgit v1.2.3