commit 3adffd7
Hubert Hirtz
·
2020-08-18 20:26:38 +0000 UTC
parent bf05951
Add /R command
1 files changed,
+5,
-0
M
app.go
M
app.go
+5,
-0
1@@ -18,6 +18,8 @@ type App struct {
2
3 cfg Config
4 highlights []string
5+
6+ lastQuery string
7 }
8
9 func NewApp(cfg Config) (app *App, err error) {
10@@ -116,6 +118,7 @@ func (app *App) handleIRCEvent(ev irc.Event) {
11 l := ui.LineFromIRCMessage(ev.Time, ev.Nick, ev.Content, false, true)
12 app.win.AddLine(ui.Home, l)
13 app.win.TypingStop(ui.Home, ev.Nick)
14+ app.lastQuery = ev.Nick
15 } else if ev.Command == "NOTICE" {
16 l := ui.LineFromIRCMessage(ev.Time, ev.Nick, ev.Content, true, false)
17 app.win.AddLine("", l)
18@@ -377,5 +380,7 @@ func (app *App) handleInput(buffer, content string) {
19 content := split[1]
20 app.s.PrivMsg(target, content)
21 // TODO echo mssage
22+ case "R":
23+ app.s.PrivMsg(app.lastQuery, args)
24 }
25 }