Package: irssi-scripts
Version: 20100512
Severity: wishlist
Tags: upstream patch

      Hi!

 Please find attached a patch that allows to change the window name to
which hilightwin logs, making it possible to log into "(status)" window.
This was triggered by some discussion on #irssi, and I try to submit it
to upstream directly, but for the time being, I want to have it sitting
around here.

 Feel free to include it. :)
Rhonda
--- hilightwin.pl.orig	2008-11-04 16:57:42.000000000 +0100
+++ hilightwin.pl	2012-03-12 10:14:16.000000000 +0100
@@ -4,21 +4,22 @@
 #
 # Modded a tiny bit by znx to stop private messages entering the hilighted
 # window (can be toggled) and to put up a timestamp.
+# Also added a setting to specify the windowname to log to.
 #
 
 use Irssi;
 use POSIX;
 use vars qw($VERSION %IRSSI); 
 
-$VERSION = "0.02";
+$VERSION = "0.03";
 %IRSSI = (
-    authors     => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster",
-    contact     => "tss\@iki.fi, znxster\@gmail.com", 
+    authors     => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster, Gerfried Fuchs",
+    contact     => "tss\@iki.fi, znxster\@gmail.com, rhonda\@deb.at", 
     name        => "hilightwin",
     description => "Print hilighted messages to window named \"hilight\"",
     license     => "Public Domain",
     url         => "http://irssi.org/";,
-    changed     => "Sun May 25 18:59:57 BST 2008"
+    changed     => "Mon, 12 Mar 2012 10:14:05 +0100"
 );
 
 sub sig_printtext {
@@ -34,7 +35,7 @@
         ($dest->{level} & ($opt)) &&
         ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0
     ) {
-        $window = Irssi::window_find_name('hilight');
+        $window = Irssi::window_find_name(Irssi::settings_get_str('hilightwin_windowname'));
         
         if ($dest->{level} & MSGLEVEL_PUBLIC) {
             $text = $dest->{target}.": ".$text;
@@ -47,8 +48,9 @@
     }
 }
 
-$window = Irssi::window_find_name('hilight');
-Irssi::print("Create a window named 'hilight'") if (!$window);
+Irssi::settings_add_str('hilightwin','hilightwin_windowname', 'hilight');
+$window = Irssi::window_find_name(Irssi::settings_get_str('hilightwin_windowname'));
+Irssi::print("Create a window named '" . Irssi::settings_get_str('hilightwin_windowname') . "'") if (!$window);
 
 Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1);
 

Reply via email to