Permalink
Browse files

irssi/coffee.pl: handle "ls"

  • Loading branch information...
grawity committed Feb 3, 2014
1 parent 7951233 commit ea348b22bc38b6d5cac2a9a2f9fef29937fb02ca
Showing with 9 additions and 3 deletions.
  1. +9 −3 irssi/coffee.pl
View
@@ -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',
@@ -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.