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)
This commit is contained in:
Lobo 2025-10-29 22:21:02 -03:00
parent b091174e5a
commit 5701062c7f
2 changed files with 1 additions and 1 deletions

View file

@ -95,7 +95,6 @@ func (app *App) submitTextInput() {
} }
} else { } else {
app.outgoing <- MessageEvent(fmt.Sprintf("%s: %s", app.nick, app.input.String())) app.outgoing <- MessageEvent(fmt.Sprintf("%s: %s", app.nick, app.input.String()))
app.outgoing <- StatEvent("")
} }
app.input.SetContent("") app.input.SetContent("")

View file

@ -124,6 +124,7 @@ func (ev MessageEvent) HandleOutgoing(app *App) error {
return err return err
} }
app.incoming <- SetLastEvent(num) app.incoming <- SetLastEvent(num)
app.outgoing <- StatEvent("")
return nil return nil
} }