X-Git-Url: https://git.donarmstrong.com/?p=irc.git;a=blobdiff_plain;f=.irssi%2Fscripts%2Fauto_bleh.pl;h=e2abc92813cc5eee1e75d2fbb4ee238b2d590b4a;hp=97200e02e9718557f1ad81d0a2d35b3aee096b3b;hb=20543723cfcada5552b3344660641393bb9fb569;hpb=97abb3c2b1d547d1bffba3b5a5294c396a17501b diff --git a/.irssi/scripts/auto_bleh.pl b/.irssi/scripts/auto_bleh.pl index 97200e0..e2abc92 100644 --- a/.irssi/scripts/auto_bleh.pl +++ b/.irssi/scripts/auto_bleh.pl @@ -143,7 +143,7 @@ sub do_auto_bleh { # OFTC now supports +q/-q. #quiet => 'ban', #unquiet => 'unban', - timeout => 'btimeout', + #timeout => 'btimeout', ); for my $key (keys %fn_mapping) { if ($$cmd{$key}) { @@ -209,7 +209,8 @@ sub get_op { sub i_want { my $action = shift; - return "I've wanted to $action->{type} $action->{nick} off $action->{channel} on $action->{network} since $action->{inserted}"; + return "I've wanted to ".join(',', keys %{$action->{type}||{'do something to'=>undef}}}). + " $action->{nick} off $action->{channel} on $action->{network} since $action->{inserted}"; } sub take_action { @@ -232,7 +233,7 @@ sub take_action { Irssi::print("Quieting $action->{nick} on $action->{channel} with hostname $action->{hostname}") if $DEBUG; # Find hostname if ($action->{hostname}) { - $server->send_raw("MODE $action->{channel} +b %*!*@".$action->{hostname}) if $action->{hostname} ne ''; #quiet hostname + $server->send_raw("MODE $action->{channel} +q *!*@".$action->{hostname}) if $action->{hostname} ne ''; #quiet hostname } } @@ -324,11 +325,17 @@ sub attempt_actions { Irssi::print(i_want($actions->{$_})) if $DEBUG; # Find the server to take action on my $server = Irssi::server_find_chatnet($actions->{$_}->{network}); - Irssi::print("Unable to find server for chatnet: $actions->{$_}->{network}") and return if not defined $server; + if (not defined $server) { + Irssi::print("Unable to find server for chatnet: $actions->{$_}->{network}"); + return; + } Irssi::print("Found server for chatnet: $actions->{$_}->{network}") if $DEBUG; # Find the channel to take action on my $s_channel = $server->channel_find($actions->{$_}->{channel}); - Irssi::print("Unable to find channel for channel: $actions->{$_}->{channel}") and return if not defined $s_channel; + if (not defined $s_channel){ + Irssi::print("Unable to find channel for channel: $actions->{$_}->{channel}"); + return; + } Irssi::print("Found channel for channel: $actions->{$_}->{channel}") if $DEBUG; # Are we opped on that channel? if ($s_channel->{chanop}) { # Yes? Take the action against the user.