diff options
author | David Phillips <david@yeah.nah.nz> | 2018-12-08 22:54:16 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2018-12-08 22:54:16 +1300 |
commit | 3292180b7f14f69fbc1ff70c5a5b426632a089a0 (patch) | |
tree | 0554448c6bb0ace70e1bf8a96e81650d1c1afd15 | |
parent | 46533aaf87d2e7117b9c5c2b73944e04f1d3f56c (diff) | |
download | idalius-3292180b7f14f69fbc1ff70c5a5b426632a089a0.tar.xz |
Change ignores to hostmask
-rwxr-xr-x | idalius.pl | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -179,8 +179,8 @@ sub strike_add { } sub should_ignore { - my ($nick) = @_; - return grep {$_ eq $nick} @{$config->{_}->{ignore}}; + my ($who) = @_; + return grep {$_ eq $who} @{$config->{_}->{ignore}}; } sub reconnect { @@ -207,7 +207,7 @@ sub handle_common { my $stripped_what = strip_color(strip_formatting($what)); my $no_prefix_what = $stripped_what; my $current_nick = $irc->nick_name(); - if (!should_ignore($nick) && ($config->{_}->{prefix_nick} && $no_prefix_what =~ s/^\Q$current_nick\E[:,]\s+//g || + if (!should_ignore($who) && ($config->{_}->{prefix_nick} && $no_prefix_what =~ s/^\Q$current_nick\E[:,]\s+//g || ($config->{_}->{prefix} && $no_prefix_what =~ s/^\Q$config->{_}->{prefix}//))) { $output = run_command($no_prefix_what, $who, $where, $ided); $irc->yield(privmsg => $where => $output) if $output; @@ -241,14 +241,14 @@ sub trigger_modules { # Return a list of subs capable of handling the given message type for a nick sub handlers_for { - my ($message_type, $nick) = @_; + my ($message_type, $who) = @_; my @handlers = (); - $nick = (split /!/, $nick)[0]; + my $nick = (split /!/, $who)[0]; $message_type = "on_$message_type"; for my $module (@{$config->{_}->{active_plugins}}) { if (module_is_enabled($module)) { - if (!should_ignore($nick) and $module->can($message_type)) { + if (!should_ignore($who) and $module->can($message_type)) { # Leave message type unchanged } elsif ($module->can($message_type.$ignore_suffix)) { $message_type = $message_type.$ignore_suffix; |