diff options
| author | 2016-01-14 14:50:40 -0700 | |
|---|---|---|
| committer | 2016-01-14 14:50:40 -0700 | |
| commit | 8ff9ba40fcbfc00260466509c4cbb95d43f8b682 (patch) | |
| tree | b2d3a4d0e71b27931625194054365561a0613c80 /lib/ASM/Commander.pm | |
| parent | da7d90773b8acf3dde1731f81237bb451ab73e33 (diff) | |
Register command-processing handlers inside of the command module, rather than having the event handler module call the command handler module
Diffstat (limited to 'lib/ASM/Commander.pm')
| -rw-r--r-- | lib/ASM/Commander.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ASM/Commander.pm b/lib/ASM/Commander.pm index 054c57c..f53781f 100644 --- a/lib/ASM/Commander.pm +++ b/lib/ASM/Commander.pm @@ -142,9 +142,13 @@ my $cmdtbl = { sub new { my $module = shift; + my ($conn) = @_; my $self = {}; $self->{cmdtbl} = $cmdtbl; + $self->{CONN} = $conn; bless($self); + $conn->add_handler('msg', sub { command($self, @_); }, "after"); + $conn->add_handler('public', sub { command($self, @_); }, "after"); return $self; } |
