summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-08-18 22:26:38 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-08-18 22:26:38 +0200
commit3adffd7a038a22217ddc4aa004c94cc06cea35b2 (patch)
treee1e03259b39cfe899153e46a73457c1d2530ad32
parentirc: Fix RPL_TOPICWHOTIME handling (diff)
Add /R command
-rw-r--r--app.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/app.go b/app.go
index ef0e83d..47ab02f 100644
--- a/app.go
+++ b/app.go
@@ -18,6 +18,8 @@ type App struct {
cfg Config
highlights []string
+
+ lastQuery string
}
func NewApp(cfg Config) (app *App, err error) {
@@ -116,6 +118,7 @@ func (app *App) handleIRCEvent(ev irc.Event) {
l := ui.LineFromIRCMessage(ev.Time, ev.Nick, ev.Content, false, true)
app.win.AddLine(ui.Home, l)
app.win.TypingStop(ui.Home, ev.Nick)
+ app.lastQuery = ev.Nick
} else if ev.Command == "NOTICE" {
l := ui.LineFromIRCMessage(ev.Time, ev.Nick, ev.Content, true, false)
app.win.AddLine("", l)
@@ -377,5 +380,7 @@ func (app *App) handleInput(buffer, content string) {
content := split[1]
app.s.PrivMsg(target, content)
// TODO echo mssage
+ case "R":
+ app.s.PrivMsg(app.lastQuery, args)
}
}