From 097c657f0ccdf4fd03a3b1c2519652e88bd46df4 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 5 May 2023 18:59:35 -0700 Subject: [PATCH] Commands/ChanOp: minor code-formatting clean-up --- lib/PBot/Core/Commands/ChanOp.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/PBot/Core/Commands/ChanOp.pm b/lib/PBot/Core/Commands/ChanOp.pm index aac54939..ca77aea8 100644 --- a/lib/PBot/Core/Commands/ChanOp.pm +++ b/lib/PBot/Core/Commands/ChanOp.pm @@ -626,11 +626,14 @@ sub do_ban_or_mute($self, $context, $mode) { if (not $length) { # TODO: user account length override $length = $self->{pbot}->{registry}->get_value($channel, "default_${mode}_timeout", 0, $context) - // $self->{pbot}->{registry}->get_value('general', "default_${mode}_timeout", 0, $context) // 60 * 60 * 24; # 24 hours + // $self->{pbot}->{registry}->get_value('general', "default_${mode}_timeout", 0, $context) + // 60 * 60 * 24; # 24 hours } $self->{pbot}->{banlist}->ban_user_timed($channel, $mode eq 'ban' ? 'b' : 'q', $mask, $length, $context->{hostmask}, $reason, $immediately); + $duration = $length > 0 ? duration $length : 'all eternity'; + if ($immediately) { $result .= "$sep$mask " . ($mode eq 'ban' ? 'banned' : 'muted') . " in $channel ($duration)"; $result .= " because $reason" if defined $reason; @@ -648,6 +651,7 @@ sub do_ban_or_mute($self, $context, $mode) { } $result = "/msg $context->{nick} $result" if $result !~ m/remaining/; + return $result; }