From 9eed830f296dab257759f5276d0963467007aa6b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 26 Dec 2024 17:08:34 -0500 Subject: initial commit --- spaceslash.pl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 spaceslash.pl (limited to 'spaceslash.pl') diff --git a/spaceslash.pl b/spaceslash.pl new file mode 100644 index 0000000..73ea73a --- /dev/null +++ b/spaceslash.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use Irssi qw/signal_continue signal_stop active_server command signal_add/; + +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_send_text { + if($_[0] =~ s{^\s+/}{/}) { + if($_[0] =~ s{/\s+/\s*}{/}) { + signal_continue(@_); + return; + } + + signal_stop(); + my $s = active_server(); + if($s) { + $s->command($_[0]); + } else { + command($_[0]); + } + } +} + +signal_add("send text", \&sig_send_text); -- cgit v1.2.3