summaryrefslogtreecommitdiff
path: root/cmd/irc/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/irc/main.go')
-rw-r--r--cmd/irc/main.go8
1 files changed, 6 insertions, 2 deletions
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":