summaryrefslogtreecommitdiffstats
path: root/scripts/dispatch.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
commit03929dac2a29664878d2c971648a4fe1fb698462 (patch)
tree02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/dispatch.pl
parentInitial commit. (diff)
downloadirssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.tar.xz
irssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.zip
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/dispatch.pl')
-rw-r--r--scripts/dispatch.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/dispatch.pl b/scripts/dispatch.pl
new file mode 100644
index 0000000..6050520
--- /dev/null
+++ b/scripts/dispatch.pl
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+use Irssi;
+use Irssi::Irc;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "0.0.2";
+%IRSSI = (
+ authors => "Sebastian 'yath' Schmidt",
+ contact => "yathen\@web.de",
+ name => "Command dispatcher",
+ description => "This scripts sends unknown commands to the server",
+ license => "GNU GPLv2",
+ changed => "Tue Mar 5 14:55:29 CET 2002",
+);
+
+sub event_default_command {
+ my ($command, $server) = @_;
+ return if (Irssi::settings_get_bool("dispatch_unknown_commands") == 0
+ || !$server);
+ $server->send_raw($command);
+ Irssi::signal_stop();
+}
+
+Irssi::settings_add_bool("misc", "dispatch_unknown_commands", 1);
+Irssi::signal_add_first("default command", "event_default_command");