From 7adcd798bb3a4cc445ece29d96a7091ddd1bde1b Mon Sep 17 00:00:00 2001 From: delthas Date: Fri, 23 Dec 2022 18:22:41 +0100 Subject: Show MOTD in server buffer only Also hide MOTD start and end messages. --- app.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index bc760f8..99bcda6 100644 --- a/app.go +++ b/app.go @@ -987,6 +987,14 @@ func (app *App) handleIRCEvent(netID string, ev interface{}) { if isBlackListed(msg.Command) { break } + if ev.Code == "372" { + app.win.AddLine(netID, "", ui.Line{ + At: msg.TimeOrNow(), + Head: "MOTD --", + Body: ui.PlainString(ev.Message), + }) + break + } var head string var body string switch ev.Severity { @@ -1012,7 +1020,7 @@ func (app *App) handleIRCEvent(netID string, ev interface{}) { func isBlackListed(command string) bool { switch command { - case "002", "003", "004", "422": + case "002", "003", "004", "375", "376", "422": // useless connection messages return true } -- cgit v1.2.3