X-Git-Url: https://git.donarmstrong.com/?p=irc.git;a=blobdiff_plain;f=.irssi%2Fscripts%2Fauto_bleh.pl;h=0a8316ea830757c6d7a61b1a9e602c5001760dfc;hp=1ea3a1c264a36eab272446ec3fc649da3a831101;hb=506178958eebde48304e60c62450f391742e6427;hpb=1b40042f5ad0b4fecb9e83f881ede6cdd429b14c diff --git a/.irssi/scripts/auto_bleh.pl b/.irssi/scripts/auto_bleh.pl index 1ea3a1c..0a8316e 100644 --- a/.irssi/scripts/auto_bleh.pl +++ b/.irssi/scripts/auto_bleh.pl @@ -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 { @@ -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.