summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-08-19 11:28:00 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-08-19 11:28:00 +0200
commitcf883fc48fc5404d1b37f9f8005286e227123147 (patch)
tree4ed1d16d9dac9de3857d424d60fc5637c8562b67 /app.go
parentAdd /R command (diff)
ui: Show self /msg and /r even if echo-message is off
Diffstat (limited to 'app.go')
-rw-r--r--app.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/app.go b/app.go
index 47ab02f..6025595 100644
--- a/app.go
+++ b/app.go
@@ -379,8 +379,24 @@ func (app *App) handleInput(buffer, content string) {
target := split[0]
content := split[1]
app.s.PrivMsg(target, content)
- // TODO echo mssage
+ if !app.s.HasCapability("echo-message") {
+ if app.s.IsChannel(target) {
+ buffer = ui.Home
+ } else {
+ buffer = target
+ }
+ line := ui.LineFromIRCMessage(time.Now(), app.s.Nick(), content, false, false)
+ app.win.AddLine(buffer, line)
+ }
case "R":
+ if buffer != ui.Home {
+ return
+ }
+
app.s.PrivMsg(app.lastQuery, args)
+ if !app.s.HasCapability("echo-message") {
+ line := ui.LineFromIRCMessage(time.Now(), app.s.Nick(), args, false, false)
+ app.win.AddLine(ui.Home, line)
+ }
}
}