summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-12-23 18:22:41 +0100
committerdelthas <delthas@dille.cc>2022-12-23 18:22:41 +0100
commit7adcd798bb3a4cc445ece29d96a7091ddd1bde1b (patch)
tree8c3217e8f93d3f5ef71bd16dcf5e16214458f6a4
parentnp: 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.go10
1 files changed, 9 insertions, 1 deletions
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
}