fix: propagating mod.started and mod.stopped events

This commit is contained in:
evilsocket 2019-03-15 17:28:20 +01:00
commit c89123f305
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 10 additions and 10 deletions

View file

@ -66,10 +66,12 @@ func (mod *EventsStream) viewEndpointEvent(e session.Event) {
} }
func (mod *EventsStream) viewModuleEvent(e session.Event) { func (mod *EventsStream) viewModuleEvent(e session.Event) {
fmt.Fprintf(mod.output, "[%s] [%s] %s\n", if *mod.Session.Options.Debug {
e.Time.Format(mod.timeFormat), fmt.Fprintf(mod.output, "[%s] [%s] %s\n",
tui.Green(e.Tag), e.Time.Format(mod.timeFormat),
e.Data) tui.Green(e.Tag),
e.Data)
}
} }
func (mod *EventsStream) viewSnifferEvent(e session.Event) { func (mod *EventsStream) viewSnifferEvent(e session.Event) {

View file

@ -186,12 +186,10 @@ func (m *SessionModule) SetRunning(running bool, cb func()) error {
m.Started = running m.Started = running
m.StatusLock.Unlock() m.StatusLock.Unlock()
if *m.Session.Options.Debug { if running {
if running { m.Session.Events.Add("mod.started", m.Name)
m.Session.Events.Add("mod.started", m.Name) } else {
} else { m.Session.Events.Add("mod.stopped", m.Name)
m.Session.Events.Add("mod.stopped", m.Name)
}
} }
if cb != nil { if cb != nil {