aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-09-10 20:05:21 +1200
committerDavid Phillips <david@sighup.nz>2018-09-10 20:05:21 +1200
commit7fa7d0a4e3011caa6ad824c59cde43d4fe7c485b (patch)
tree2752841a5dd8ca62abae84e6b830a77210fdf2f2
parent851fb8fb8feb881a63c40bce0d963ce425a95ef7 (diff)
downloadidalius-7fa7d0a4e3011caa6ad824c59cde43d4fe7c485b.tar.xz
Rename handlers to on_*
-rw-r--r--Plugin/Antiflood.pm6
-rw-r--r--Plugin/Jinx.pm4
-rw-r--r--Plugin/Titillate.pm6
-rw-r--r--Plugin/URL_Title.pm6
-rwxr-xr-xidalius.pl2
5 files changed, 13 insertions, 11 deletions
diff --git a/Plugin/Antiflood.pm b/Plugin/Antiflood.pm
index fbd77a5..eafa50c 100644
--- a/Plugin/Antiflood.pm
+++ b/Plugin/Antiflood.pm
@@ -18,7 +18,7 @@ sub configure {
return $self;
}
-sub message {
+sub on_message {
my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_;
my $channel = $where->[0];
my $nick = (split /!/, $who)[0];
@@ -36,7 +36,7 @@ sub message {
return;
}
-sub action {
- message(@_);
+sub on_action {
+ on_message(@_);
}
1;
diff --git a/Plugin/Jinx.pm b/Plugin/Jinx.pm
index 507f242..04c43c8 100644
--- a/Plugin/Jinx.pm
+++ b/Plugin/Jinx.pm
@@ -21,7 +21,7 @@ sub configure {
return $self;
}
-sub message {
+sub on_message {
my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_;
return if defined $last_response and $what eq $last_response;
@@ -36,7 +36,7 @@ sub message {
return;
}
-sub action {
+sub on_action {
my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_;
return if defined $last_response and $what eq $last_response;
diff --git a/Plugin/Titillate.pm b/Plugin/Titillate.pm
index fe31ba3..79f1a4a 100644
--- a/Plugin/Titillate.pm
+++ b/Plugin/Titillate.pm
@@ -13,7 +13,7 @@ sub configure {
return $self;
}
-sub message {
+sub on_message {
my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_;
my $gathered = "";
my @expressions = (keys %{$config{triggers}});
@@ -33,7 +33,7 @@ sub message {
return $gathered;
}
-sub action {
- message(@_);
+sub on_action {
+ on_message(@_);
}
1;
diff --git a/Plugin/URL_Title.pm b/Plugin/URL_Title.pm
index 6e0d775..53d6326 100644
--- a/Plugin/URL_Title.pm
+++ b/Plugin/URL_Title.pm
@@ -27,7 +27,7 @@ sub start_handler
"tagname,self");
}
-sub message
+sub on_message
{
my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_;
my $url;
@@ -81,7 +81,7 @@ sub message
return $composed_title;
}
-sub action {
- message(@_);
+sub on_action {
+ on_message(@_);
}
1;
diff --git a/idalius.pl b/idalius.pl
index 9982930..d65a4e1 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -214,6 +214,8 @@ sub handle_common {
strike_add($nick, $channel) if $output;
}
+ # handler names are defined as being prefixed with on_
+ $message_type = "on_$message_type";
for my $module (@{$config{plugins}}) {
if (module_is_enabled($module) && $module->can($message_type)) {
$output = $module->$message_type(\&log_info, $irc->nick_name, $who, $where, $what, $stripped_what, $irc);