mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
1492bf5e40
commit
e98975a213
1 changed files with 4 additions and 3 deletions
|
@ -92,8 +92,7 @@ func (l *TriggerList) Dispatch(e session.Event) (ident string, cmd string, err e
|
|||
|
||||
for id, t := range l.triggers {
|
||||
if e.Tag == t.For {
|
||||
found = true
|
||||
ident = id
|
||||
|
||||
// this is ugly but it's also the only way to allow
|
||||
// the user to do this easily - since each event Data
|
||||
// field is an interface and type casting is not possible
|
||||
|
@ -102,9 +101,11 @@ func (l *TriggerList) Dispatch(e session.Event) (ident string, cmd string, err e
|
|||
// user to access it in the command via JSON-Query, example:
|
||||
//
|
||||
// events.on wifi.client.new "wifi.deauth {{Client\mac}}"
|
||||
cmd = t.Action
|
||||
found = true
|
||||
ident = id
|
||||
buf := ([]byte)(nil)
|
||||
doc := (*jsonquery.Node)(nil)
|
||||
cmd = t.Action
|
||||
// parse each {EXPR}
|
||||
for _, m := range reQueryCapture.FindAllString(t.Action, -1) {
|
||||
// parse the event Data field as a JSON objects once
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue