license => 'GPLv3+',
);
-my($channel,$person,$nick,$user,$host,$real,$account,$string,$issues,$running,@jchannels,@jchannelstocheck);
+my($channel,$person,$nick,$user,$host,$real,$account,$string,$issues,$running,@jchannels,@jchannelstocheck,$debug);
$running=0;
#Clear variables and register redirects
&reset();
+ $debug = Irssi::settings_get_bool('bansearch_debug');
#Split command arguments into a nick and a channel separated by a space
($person,$channel)=split(/ /, $data, 2);
$maskreg=~s/\*/\.\*\?/g;
#We only want to display who set the ban/quiet if it is listed as a person
- if($setby=~m/^[^!.]+\.[^!]+$/i) {
+ if($setby!~m/!/) {
$setby='';
}
else {
$issues++;
}
else {
-# Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match $account" . $setby);
+ Irssi::active_win()->print("$type against \x02$mask\x02 in $banchannel does NOT match $account" . $setby) if $debug;
}
}
# cannot join other channel
if($maskreg=~m/^\$a$/i) {
if($account!~m/^0$/) {
Irssi::active_win()->print(
- "$type against \x02$mask\x02 in $banchannel matches identified user." . $setby);
+ "$type against \x02$mask\x02 in $banchannel matches identified user" . $setby);
$issues++;
}
else {
-# Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match $account" . $setby);
+ Irssi::active_win()->print("$type against \x02$mask\x02 in $banchannel does NOT match unidentified user" . $setby) if $debug;
}
}
# any unidentified user
if($maskreg=~m/^\$\~a$/i) {
if($account=~m/^0$/) {
Irssi::active_win()->print(
- "$type against \x02$mask\x02 in $banchannel matches unidentified user." . $setby);
+ "$type against \x02$mask\x02 in $banchannel matches unidentified user" . $setby);
$issues++;
}
else {
-# Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match $account" . $setby);
+ Irssi::active_win()->print("$type against \x02$mask\x02 in $banchannel does NOT match identified user" . $setby) if $debug;
}
}
# ircname
$issues++;
}
else {
-# Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match real name of $real" . $setby);
+ Irssi::active_win()->print("$type against \x02$mask\x02 in $banchannel does NOT match real name of $real" . $setby) if $debug;
}
}
# full match
$issues++;
}
else {
-# Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match $full" . $setby);
+ Irssi::active_win()->print("$type against \x02$mask\x02 in $banchannel does NOT match $full" . $setby) if $debug;
}
}
}
$issues++;
}
else {
-# Irssi::active_win()->print("$type against \x02$mask\x02 does NOT match $string" . $setby);
+ Irssi::active_win()->print("$type against \x02$mask\x02 in $banchannel does NOT match $string" . $setby) if $debug;
}
}
}
$server->send_raw("MODE $channel q");
}
elsif($data=~m/^Quiet/) {
- $server->redirect_event('mode channel',1, $channel, 0, undef,
- {
- 'event 324' => 'redir rpl_channelmodeis',
- '' => 'event empty',
- }
- );
if (@jchannelstocheck) {
my $nextchannel = pop(@jchannelstocheck);
$server->redirect_event('mode b',1, $nextchannel, 0, undef,
);
$server->send_raw("MODE $nextchannel b");
} else {
+ $server->redirect_event('mode channel',1, $channel, 0, undef,
+ {
+ 'event 324' => 'redir rpl_channelmodeis',
+ '' => 'event empty',
+ }
+ );
$server->send_raw("MODE $channel");
}
}
}
Irssi::command_bind('bansearch', 'bansearch');
+Irssi::settings_add_bool('bansearch', 'bansearch_debug', 0);
# vim:set ts=8 sw=4: