diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
commit | 03929dac2a29664878d2c971648a4fe1fb698462 (patch) | |
tree | 02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/page_reeler.pl | |
parent | Initial commit. (diff) | |
download | irssi-scripts-upstream/20231031.tar.xz irssi-scripts-upstream/20231031.zip |
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | scripts/page_reeler.pl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/page_reeler.pl b/scripts/page_reeler.pl new file mode 100644 index 0000000..502045a --- /dev/null +++ b/scripts/page_reeler.pl @@ -0,0 +1,47 @@ +# Page script 0.2 +# +# Thomas Graf <irssi@reeler.org> + +use strict; +use Irssi; +use Irssi::Irc; +use vars qw($VERSION %IRSSI); +$VERSION = "0.2"; +%IRSSI = ( + authors => 'Thomas Graf', + contact => 'irssi@reeler.org', + name => 'page', + description => 'display and send CTCP PAGE', + license => 'GNU GPLv2 or later', + url => 'http://irssi.reeler.org/', +); + +sub sig_ctcp_msg +{ + my ($server, $args, $sender, $addr, $target) = @_; + + if ( $args =~ /page/i ) { + Irssi::active_win()->printformat(MSGLEVEL_CRAP, 'page', "$sender!$addr is paging you!"); + Irssi::signal_stop(); + } +} + +sub sig_page +{ + my ($cmd_line, $server, $win_item) = @_; + my @args = split(' ', $cmd_line); + + if (@args <= 0) { + Irssi::active_win()->print("Usage: PAGE <nick>"); + return; + } + + my $nick = lc(shift(@args)); + + $server->command("CTCP $nick PAGE"); +} + +Irssi::signal_add_first('default ctcp msg', 'sig_ctcp_msg'); +Irssi::command_bind('page', 'sig_page'); + +Irssi::theme_register(['page', '[%gPAGE%n]$0-']); |