From 2c5872f12039c1ffea9923fd8356ceafc86bcfdb Mon Sep 17 00:00:00 2001 From: delthas Date: Sun, 11 Jul 2021 20:45:57 +0200 Subject: Print the channel topic on join Fixes: #45 --- commands.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'commands.go') diff --git a/commands.go b/commands.go index 3f92540..447340d 100644 --- a/commands.go +++ b/commands.go @@ -358,20 +358,7 @@ func commandDoR(app *App, buffer string, args []string) (err error) { func commandDoTopic(app *App, buffer string, args []string) (err error) { if len(args) == 0 { - var body string - - topic, who, at := app.s.Topic(buffer) - if who == nil { - body = fmt.Sprintf("Topic: %s", topic) - } else { - body = fmt.Sprintf("Topic (by %s, %s): %s", who, at.Local().Format("Mon Jan 2 15:04:05"), topic) - } - app.win.AddLine(buffer, ui.NotifyNone, ui.Line{ - At: time.Now(), - Head: "--", - HeadColor: tcell.ColorGray, - Body: ui.Styled(body, tcell.StyleDefault.Foreground(tcell.ColorGray)), - }) + app.printTopic(buffer) } else { app.s.ChangeTopic(buffer, args[0]) } -- cgit v1.2.3