Import hook_add and hook_del.

This commit is contained in:
Elijah Perrault committed 2011-01-29 15:02:44 -07:00
1 parent ce58dbe132
commit 8aa8962764
1 file changed
+3 -2
+3 -2
View File
@@ -4,13 +4,14 @@
package m_HelloChan; package m_HelloChan;
use strict; use strict;
use warnings; use warnings;
use API::Std qw(hook_add hook_del);
use API::IRC qw(privmsg); use API::IRC qw(privmsg);
# Initialization subroutine. # Initialization subroutine.
sub _init sub _init
{ {
# Add a hook for when we join a channel. # Add a hook for when we join a channel.
API::Std::hook_add("on_ucjoin", "HelloChan", \&m_HelloChan::hello) or return 0; hook_add("on_ucjoin", "HelloChan", \&m_HelloChan::hello) or return 0;
return 1; return 1;
} }
@@ -18,7 +19,7 @@ sub _init
sub _void sub _void
{ {
# Delete the hook. # Delete the hook.
API::Std::hook_del("on_ucjoin", "HelloChan") or return 0; hook_del("on_ucjoin", "HelloChan") or return 0;
return 1; return 1;
} }