Skip to content

Commit

Permalink
Update amigo.go
Browse files Browse the repository at this point in the history
A small fix for my own needs
  • Loading branch information
mrrecovery authored May 28, 2021
1 parent 9e0ec2c commit e1dbc21
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions amigo.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
errNotConnected = errors.New("Not connected to Asterisk")
)

type handlerFunc func(map[string]string)
type handlerFunc func(map[string]string, Amigo)
type eventHandlerFunc func(string)

// Amigo is a main package struct
Expand Down Expand Up @@ -189,19 +189,19 @@ func (a *Amigo) Connect() {
}

if a.handlers[event] != nil {
a.handlers[event](ev)
a.handlers[event](ev, *a)
}

if a.defaultHandler != nil {
a.defaultHandler(ev)
a.defaultHandler(ev, *a)
}
} else {
if a.defaultHandler != nil {
a.defaultHandler(e)
a.defaultHandler(e, *a)
}

if a.handlers[event] != nil {
a.handlers[event](e)
a.handlers[event](e, *a)
}
}
}
Expand Down

0 comments on commit e1dbc21

Please sign in to comment.