new: added session.stopped event (and fixed session.started event propagation)

This commit is contained in:
Simone Margaritelli 2022-06-10 22:12:45 +02:00
commit 22de9d3d4f
3 changed files with 5 additions and 4 deletions

View file

@ -155,6 +155,9 @@ func (s *Session) activeHandler(args []string, sess *Session) error {
}
func (s *Session) exitHandler(args []string, sess *Session) error {
// notify any listener that the session is about to end
s.Events.Add("session.stopped", nil)
for _, mod := range s.Modules {
if mod.Running() {
mod.Stop()