]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Use MSGLEVEL_NO_ACT for debug output
authormartin f. krafft <redacted>
Fri, 17 Sep 2021 22:22:55 +0000 (00:22 +0200)
committermartin f. krafft <redacted>
Sun, 19 Sep 2021 08:13:50 +0000 (10:13 +0200)
We don't need the kludge with a global variable if we set
MSGLEVEL_NO_ACT on all debug output, because that then never triggers
activity itself.

Signed-off-by: martin f. krafft <redacted>
scripts/ctrlact.pl

index 5386d9299eebcbc9c11f21f315ffa1b324cca6b6..eab2e9e01e362e8f66ae08342ad9df9a77ad598a 100644 (file)
@@ -240,7 +240,6 @@ my %OWN_ACTIVITY = ();
 
 ### HELPERS ####################################################################
 
-my $_inhibit_debug_activity = 0;
 use constant DEBUGEVENTFORMAT => "%7s %7.7s %-22.22s  %d %s %d → %-7s  (%-8s ← %s)";
 sub say {
        my ($msg, $level, $inwin) = @_;
@@ -257,9 +256,7 @@ sub debug {
        return unless $debug;
        my ($msg, $inwin) = @_;
        $msg = $msg // "";
-       $_inhibit_debug_activity = 1;
-       say("DEBUG: ".$msg, MSGLEVEL_CRAP, $inwin);
-       $_inhibit_debug_activity = 0;
+       say("DEBUG: ".$msg, MSGLEVEL_CRAP + MSGLEVEL_NO_ACT, $inwin);
 }
 
 use Data::Dumper;
@@ -583,10 +580,7 @@ sub inhibit_win_hilight {
 sub maybe_inhibit_win_hilight {
        my ($win, $oldlevel) = @_;
        return unless $win;
-       if ($_inhibit_debug_activity) {
-               inhibit_win_hilight($win);
-       }
-       elsif ($_inhibit_window && $win->{'refnum'} == $_inhibit_window->{'refnum'}) {
+       if ($_inhibit_window && $win->{'refnum'} == $_inhibit_window->{'refnum'}) {
                inhibit_win_hilight($win);
        }
        else {
git clone https://git.99rst.org/PROJECT