diff options
author | David Phillips <david@sighup.nz> | 2019-06-23 14:35:00 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2019-06-23 14:35:00 +1200 |
commit | 932c71ff21720227faf0d489555d1e242199eecf (patch) | |
tree | 54b951efa98f22464d30b6332686fe34dc203b4f | |
parent | cc32474c98aa46b69856e276a46f325e29588f93 (diff) | |
download | idalius-932c71ff21720227faf0d489555d1e242199eecf.tar.xz |
Add IRC codes to special events
-rw-r--r-- | Plugin/Autojoin.pm | 2 | ||||
-rw-r--r-- | Plugin/Log.pm | 16 | ||||
-rwxr-xr-x | idalius.pl | 14 |
3 files changed, 15 insertions, 17 deletions
diff --git a/Plugin/Autojoin.pm b/Plugin/Autojoin.pm index 73155ab..4288c42 100644 --- a/Plugin/Autojoin.pm +++ b/Plugin/Autojoin.pm @@ -15,7 +15,7 @@ sub configure { return $self; } -sub on_welcome { +sub on_001_welcome { my ($self, $logger, $server, $message, $irc) = @_; $irc->yield(join => $_) for @{$config->{channels}}; return; diff --git a/Plugin/Log.pm b/Plugin/Log.pm index a993d3f..dc2c6d3 100644 --- a/Plugin/Log.pm +++ b/Plugin/Log.pm @@ -33,25 +33,25 @@ sub configure { } # IRC 001 -sub on_welcome { +sub on_001_welcome { my ($self, $logger, $server, $message, $irc) = @_; $logger->("$t{info}Connected to $t{host}$server$t{info} --- \"$t{message}$message$t{info}\"$t{reset}"); } # IRC 002 -sub on_your_host { +sub on_002_your_host { my ($self, $logger, $message, $irc) = @_; $logger->("$t{info} --- \"$t{message}$message$t{info}\"$t{reset}"); } # IRC 003 -sub on_created { +sub on_003_created { my ($self, $logger, $message, $irc) = @_; $logger->("$t{info} --- \"$t{message}$message$t{info}\"$t{reset}"); } # IRC 004 -sub on_my_info { +sub on_004_my_info { my ($self, $logger, $message, $irc) = @_; $logger->("$t{info} --- \"$t{message}$message$t{info}\"$t{reset}"); } @@ -86,7 +86,6 @@ sub on_255_user_me { $logger->("$t{info}Online: \"$t{message}$message$t{info}\"$t{reset}"); } - sub on_message { my ($self, $logger, $who, $where, $raw_what, $what, $irc) = @_; $logger->("$t{bracket}\[$t{channel}$where->[0]$t{bracket}\] $t{nick}$who: $t{message}$what$t{reset}"); @@ -151,22 +150,21 @@ sub on_ping { return; } -sub on_motd_content { +sub on_372_motd_content { my ($self, $logger, $server, $motd, $irc) = @_; $logger->("$t{info}MOTD: $t{message}$motd$t{reset}"); return; } -sub on_motd_begin { +sub on_375_motd_begin { my ($self, $logger, $server, $message, $irc) = @_; $logger->("$t{info}$message$t{reset}"); return; } -sub on_motd_end { +sub on_376_motd_end { my ($self, $logger, $server, $message, $irc) = @_; $logger->("$t{info}$message$t{reset}"); return; } - 1; @@ -326,7 +326,7 @@ sub irc_001 { my ($poek, $server, $message) = @_[KERNEL, ARG0, ARG1]; my @empty = (); - trigger_modules("welcome", undef, undef, \@empty, ($server, $message)); + trigger_modules("001_welcome", undef, undef, \@empty, ($server, $message)); # FIXME move to forward ping module $poek->delay(custom_ping => $ping_delay); @@ -338,7 +338,7 @@ sub irc_002 { my $message = $_[ARG1]; my @empty = (); - trigger_modules("your_host", undef, undef, \@empty, ($message)); + trigger_modules("002_your_host", undef, undef, \@empty, ($message)); return; } @@ -347,7 +347,7 @@ sub irc_003 { my $message = $_[ARG1]; my @empty = (); - trigger_modules("created", undef, undef, \@empty, ($message)); + trigger_modules("003_created", undef, undef, \@empty, ($message)); return; } @@ -356,7 +356,7 @@ sub irc_004 { my $message = $_[ARG1]; my @empty = (); - trigger_modules("my_info", undef, undef, \@empty, ($message)); + trigger_modules("004_my_info", undef, undef, \@empty, ($message)); return; } @@ -412,7 +412,7 @@ sub irc_372 { my ($server, $motd) = @_[ARG0..ARG1]; my @empty = (); - trigger_modules("motd_content", undef, undef, \@empty, ($server, $motd)); + trigger_modules("372_motd_content", undef, undef, \@empty, ($server, $motd)); return; } @@ -421,7 +421,7 @@ sub irc_375 { my ($server, $message) = @_[ARG0..ARG1]; my @empty = (); - trigger_modules("motd_begin", undef, undef, \@empty, ($server, $message)); + trigger_modules("375_motd_begin", undef, undef, \@empty, ($server, $message)); return; } @@ -430,7 +430,7 @@ sub irc_376 { my ($server, $message) = @_[ARG0..ARG1]; my @empty = (); - trigger_modules("motd_end", undef, undef, \@empty, ($server, $message)); + trigger_modules("376_motd_end", undef, undef, \@empty, ($server, $message)); return; } |