From f6ed22854234c6d651433c034578c10a4486480a Mon Sep 17 00:00:00 2001 From: Hubert Hirtz Date: Sat, 1 Aug 2020 18:03:26 +0200 Subject: Show messages from self when echo-message is disabled --- cmd/irc/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd/irc/main.go') diff --git a/cmd/irc/main.go b/cmd/irc/main.go index 51a6b0a..6245793 100644 --- a/cmd/irc/main.go +++ b/cmd/irc/main.go @@ -188,7 +188,7 @@ func handleUIEvent(app *ui.UI, s *irc.Session, ev tcell.Event) { case tcell.KeyEnter: buffer := app.CurrentBuffer() input := app.InputEnter() - handleInput(s, buffer, input) + handleInput(app, s, buffer, input) case tcell.KeyRune: app.InputRune(ev.Rune()) if app.CurrentBuffer() != "home" && !strings.HasPrefix(app.Input(), "/") { @@ -219,7 +219,7 @@ func parseCommand(s string) (command, args string) { return } -func handleInput(s *irc.Session, buffer, content string) { +func handleInput(app *ui.UI, s *irc.Session, buffer, content string) { cmd, args := parseCommand(content) switch cmd { @@ -229,6 +229,10 @@ func handleInput(s *irc.Session, buffer, content string) { } s.PrivMsg(buffer, args) + if !s.HasCapability("echo-message") { + line := formatIRCMessage(s.Nick(), args) + app.AddLine(buffer, line, time.Now(), false) + } case "QUOTE": s.SendRaw(args) case "J", "JOIN": -- cgit v1.2.3