diff options
| -rwxr-xr-x | idalius.pl | 17 | 
1 files changed, 12 insertions, 5 deletions
@@ -201,14 +201,11 @@ sub handle_common {  	my $channel = $where->[0];  	my $output; -	# Return early if should ignore -	return if should_ignore($nick); -  	$what =~ s/^\s+|\s+$//g;  	my $stripped_what = strip_color(strip_formatting($what));  	my $no_prefix_what = $stripped_what; -	if ($config{prefix_nick} && $no_prefix_what =~ s/^\Q$current_nick\E[:,]\s+//g || +	if (!should_ignore($nick) && $config{prefix_nick} && $no_prefix_what =~ s/^\Q$current_nick\E[:,]\s+//g ||  	    $no_prefix_what =~ s/^$config{prefix}//) {  		$output = run_command($no_prefix_what, $who, $where);  		$irc->yield(privmsg => $where => $output) if $output; @@ -217,8 +214,18 @@ sub handle_common {  	# handler names are defined as being prefixed with on_  	$message_type = "on_$message_type"; +	my $ignore_suffix = "_yes_really_even_from_ignored_nicks";  	for my $module (@{$config{plugins}}) { -		if (module_is_enabled($module) && $module->can($message_type)) { +		if (module_is_enabled($module)) { +			if (!should_ignore($nick) and $module->can($message_type)) { +				# Leave message type unchanged +			} elsif ($module->can($message_type.$ignore_suffix)) { +				# Handler for non-ignored and ignored exists +				$message_type = $message_type.$ignore_suffix; +			} else { +				# No handler +				next; +			}  			$output = $module->$message_type(\&log_info, $irc->nick_name, $who, $where, $what, $stripped_what, $irc);  			$irc->yield(privmsg => $where => $output) if $output;  			strike_add($nick, $channel) if $output;  | 
