Skip to content

Commit

Permalink
irssi/coffee.pl: handle "ls"
Browse files Browse the repository at this point in the history
  • Loading branch information
grawity committed Feb 3, 2014
1 parent 7951233 commit ea348b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions irssi/coffee.pl
Expand Up @@ -3,7 +3,7 @@
use vars qw($VERSION %IRSSI);
use Irssi;

$VERSION = '0.2';
$VERSION = '0.3';
%IRSSI = (
name => 'spacefail',
description => 'Warns you if you have extra spaces before /command',
Expand All @@ -13,11 +13,17 @@

Irssi::signal_add("send text" => sub {
my ($line, $server, $witem) = @_;

$witem //= Irssi::active_win;

if ($line =~ m|^\s+/(\w+)|) {
Irssi::command("scrollback end");
$witem //= Irssi::active_win;
$witem->command("scrollback end");
$witem->print("Stopped command \002/$1\002 from being sent to channel.",
MSGLEVEL_CLIENTERROR);
Irssi::signal_stop;
}
elsif ($line eq 'ls') {
$witem->command("names");
Irssi::signal_stop;
}
});

0 comments on commit ea348b2

Please sign in to comment.