summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2023-01-01 02:05:44 +0100
committerJordan Bracco <href@random.sh>2023-01-15 17:32:46 +0100
commit1639b84d8685a09706abb303e21f1d73ec57ad1a (patch)
treeaaf1c962054e7dc7b48dd8424ba34b9d4819c05e
parentfeat(ui): Only show nickname once for multiple consecutive messages (diff)
feat(ui): improve /TOPIC ui
-rw-r--r--app.go14
1 files changed, 10 insertions, 4 deletions
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)),
})