]> git.donarmstrong.com Git - irc.git/blobdiff - .irssi/scripts/auto_bleh.pl
fix typo
[irc.git] / .irssi / scripts / auto_bleh.pl
index 1bf9e6245a281ad62fa30c008d399d8c7bc36a48..0a8316ea830757c6d7a61b1a9e602c5001760dfc 100644 (file)
@@ -140,9 +140,10 @@ sub do_auto_bleh {
      # turn them into ban and kick, respectively.
      if ($server->{address} !~ $defaults{SMELLSLIKEFN}) {
          my %fn_mapping = (remove  => 'kick',
      # turn them into ban and kick, respectively.
      if ($server->{address} !~ $defaults{SMELLSLIKEFN}) {
          my %fn_mapping = (remove  => 'kick',
-                           quiet   => 'ban',
-                           unquiet => 'unban',
-                           timeout => 'btimeout',
+                           # OFTC now supports +q/-q.
+                           #quiet   => 'ban',
+                           #unquiet => 'unban',
+                           #timeout => 'btimeout',
                           );
          for my $key (keys %fn_mapping) {
               if ($$cmd{$key}) {
                           );
          for my $key (keys %fn_mapping) {
               if ($$cmd{$key}) {
@@ -208,7 +209,8 @@ sub get_op {
 sub i_want {
      my $action = shift;
 
 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 {
 }
 
 sub take_action {
@@ -231,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}) {
          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} +*!*@".$action->{hostname}) if $action->{hostname} ne ''; #quiet hostname
          }
 
      }
          }
 
      }
@@ -323,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(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("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.
          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.