diff options
author | Jordan Bracco <href@random.sh> | 2023-01-01 02:05:44 +0100 |
---|---|---|
committer | Jordan Bracco <href@random.sh> | 2023-01-15 17:32:46 +0100 |
commit | 1639b84d8685a09706abb303e21f1d73ec57ad1a (patch) | |
tree | aaf1c962054e7dc7b48dd8424ba34b9d4819c05e | |
parent | feat(ui): Only show nickname once for multiple consecutive messages (diff) |
feat(ui): improve /TOPIC ui
-rw-r--r-- | app.go | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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)), }) |