From 5701062c7f5c595e005ea981296fa6529e041ef3 Mon Sep 17 00:00:00 2001 From: Lobo Torres Date: Wed, 29 Oct 2025 22:21:02 -0300 Subject: [PATCH] send StatEvent on MessageEvent outgoing handler avoids duplicate "not connected to any server" messages when attempting to send messages while disconnected (because of the outgoing event loop handling that message) --- display.go | 1 - event.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/display.go b/display.go index 22517f0..92d0936 100644 --- a/display.go +++ b/display.go @@ -95,7 +95,6 @@ func (app *App) submitTextInput() { } } else { app.outgoing <- MessageEvent(fmt.Sprintf("%s: %s", app.nick, app.input.String())) - app.outgoing <- StatEvent("") } app.input.SetContent("") diff --git a/event.go b/event.go index 41766c1..7a5be88 100644 --- a/event.go +++ b/event.go @@ -124,6 +124,7 @@ func (ev MessageEvent) HandleOutgoing(app *App) error { return err } app.incoming <- SetLastEvent(num) + app.outgoing <- StatEvent("") return nil }