rendered paste body#!/usr/bin/perl
use warnings;
use strict;
use Irssi;
our $VERSION = "0.1";
our %IRSSI = (
authors => 'Urchlay',
contact => 'Urchlay on NewNet',
name => 'spaceslash',
description => 'treat " /command" as though the space weren\'t there',
license => 'Same as Perl',
url => 'none',
);
sub sig_own_public {
my $msg = $_[1];
if($msg =~ s{^\s+/}{/}) {
if($msg =~ s{/\s+/}{/}) {
Irssi::signal_continue($_[0], $msg, $_[2]);
return;
}
Irssi::signal_stop();
my $s = Irssi::active_server();
if($s) {
$s->command($msg);
} else {
Irssi::command($msg);
}
}
}
Irssi::signal_add("message own_public", \&sig_own_public);