summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorailin-nemui2016-05-01 21:19:34 +0200
committerailin-nemui2016-05-01 21:19:34 +0200
commitad9f6f1a94f4516141164bcc88833b4f920d2346 (patch)
tree513908c3bb595db8f3d78fd9e4c806a846d27b84
parenta3f3ced5b36d606c7a6af342e77006a496306be6 (diff)
parentb4df3a419af2cc7f8e6a52aa64443d1955c4b614 (diff)
downloadscripts.irssi.org-ad9f6f1a94f4516141164bcc88833b4f920d2346.tar.bz2
Merge pull request #270 from vague666/268_fix
Added command_runsub glue
-rw-r--r--scripts/act.pl16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/act.pl b/scripts/act.pl
index f7a7528..21cbbbb 100644
--- a/scripts/act.pl
+++ b/scripts/act.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# resets window activity status
# by c0ffee
# - http://www.penguin-breeder.org/irssi/
@@ -8,7 +8,7 @@ use strict;
use vars qw($VERSION %IRSSI);
use Irssi 20020120;
-$VERSION = "0.14";
+$VERSION = "0.15";
%IRSSI = (
authors => "c0ffee",
contact => "c0ffee\@penguin-breeder.org",
@@ -30,7 +30,17 @@ $VERSION = "0.14";
#
# /ACT ALL sets all windows as non-active
-Irssi::command_bind('act', sub { _act(1); });
+Irssi::command_bind 'act' => sub {
+ my ( $data, $server, $item ) = @_;
+ $data =~ s/\s+$//g;
+ if ($data) {
+ Irssi::command_runsub('act', $data, $server, $item);
+ }
+ else {
+ _act(1);
+ }
+};
+
Irssi::command_bind('act public', sub { _act(2); });
Irssi::command_bind('act all', sub { _act(3); });