diff options
author | delthas <delthas@dille.cc> | 2022-12-23 18:22:41 +0100 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-12-23 18:22:41 +0100 |
commit | 7adcd798bb3a4cc445ece29d96a7091ddd1bde1b (patch) | |
tree | 8c3217e8f93d3f5ef71bd16dcf5e16214458f6a4 | |
parent | np: Bump libnp & be more verbose with errors (diff) |
Show MOTD in server buffer only
Also hide MOTD start and end messages.
-rw-r--r-- | app.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 } |