summaryrefslogtreecommitdiffstats
path: root/scripts/showhilight.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/showhilight.pl
parentInitial commit. (diff)
downloadirssi-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 'scripts/showhilight.pl')
-rw-r--r--scripts/showhilight.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/showhilight.pl b/scripts/showhilight.pl
new file mode 100644
index 0000000..e55dd31
--- /dev/null
+++ b/scripts/showhilight.pl
@@ -0,0 +1,32 @@
+# Print hilighted messages with MSGLEVEL_PUBLIC to active window
+# for irssi 0.7.99 by Paweł 'Styx' Chuchmała based on hilightwin.pl by Timo Sirainen
+use strict;
+use Irssi;
+use vars qw($VERSION %IRSSI);
+$VERSION = "0.2";
+%IRSSI = (
+ authors => "Paweł \'Styx\' Chuchmała",
+ contact => "styx\@irc.pl",
+ name => "showhilight",
+ description => "Show hilight messages in active window",
+ license => "GNU GPLv2",
+ changed => "Fri Jun 28 11:09:42 CET 2002"
+
+);
+
+sub sig_printtext {
+ my ($dest, $text, $stripped) = @_;
+
+ my $window = Irssi::active_win();
+
+ if (($dest->{level} & MSGLEVEL_HILIGHT) && ($dest->{level} & MSGLEVEL_PUBLIC) &&
+ ($window->{refnum} != $dest->{window}->{refnum}) && ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) {
+
+ $text =~ s/%/%%/g;
+ $text = $dest->{target}.":%K[".Irssi::settings_get_str('hilight_color').$dest->{window}->{refnum}."%K]:".$text;
+
+ $window->print($text, MSGLEVEL_CLIENTCRAP);
+ }
+}
+
+Irssi::signal_add('print text', 'sig_printtext');