From 53c6177801e9b8854699909f97eb469fc7cb48c1 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 3 Aug 2017 23:19:02 -0700 Subject: [PATCH] Restore `immediately` functionality to unban/unmute --- PBot/ChanOpCommands.pm | 4 ++-- PBot/ChanOps.pm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/ChanOpCommands.pm b/PBot/ChanOpCommands.pm index 24d82eba..b8c67141 100644 --- a/PBot/ChanOpCommands.pm +++ b/PBot/ChanOpCommands.pm @@ -112,7 +112,7 @@ sub unban_user { return "/msg $nick Usage for /msg: unban " if $channel !~ /^#/; - $self->{pbot}->{chanops}->unban_user($target, $channel); + $self->{pbot}->{chanops}->unban_user($target, $channel, 1); return "/msg $nick $target has been unbanned from $channel."; } @@ -187,7 +187,7 @@ sub unmute_user { return "/msg $nick Usage for /msg: unmute " if $channel !~ /^#/; - $self->{pbot}->{chanops}->unmute_user($target, $channel); + $self->{pbot}->{chanops}->unmute_user($target, $channel, 1); return "/msg $nick $target has been unmuted in $channel."; } diff --git a/PBot/ChanOps.pm b/PBot/ChanOps.pm index 6a2de9f3..e51b78b4 100644 --- a/PBot/ChanOps.pm +++ b/PBot/ChanOps.pm @@ -128,7 +128,7 @@ sub ban_user { sub unban_user { my $self = shift; - my ($mask, $channel) = @_; + my ($mask, $channel, $immediately) = @_; my $bans; @@ -168,7 +168,7 @@ sub unban_user { $unbanned{$baninfo->{banmask}} = 1; $self->add_to_unban_queue($channel, 'b', $baninfo->{banmask}); } - $self->check_unban_queue; + $self->check_unban_queue if $immediately; } sub ban_user_timed { @@ -214,7 +214,7 @@ sub mute_user { sub unmute_user { my $self = shift; - my ($mask, $channel) = @_; + my ($mask, $channel, $immediately) = @_; $mask = lc $mask; $channel = lc $channel; $self->{pbot}->{logger}->log("Unmuting $channel $mask\n"); @@ -225,7 +225,7 @@ sub unmute_user { } $self->add_to_unban_queue($channel, 'q', $mask); - $self->check_unban_queue; + $self->check_unban_queue if $immediately; } sub mute_user_timed {