Package: irssi-scripts
Version: 20060513
Severity: normal
Tags: patch

Hi,

the patch below contains 2 changes for queryresume.pl:

* the first part removes the restriction that it only works for
  queries. Without the && part it also works for channels.

* the second part (more important) fixes the parsing of autolog_path
  for the ${var} syntax which I'm using in my autolog_path because of
  the _ there: /cb/irc/log/${0}_$tag/%Y/${0}-%Y-%m-%d

--- /usr/share/irssi/scripts/queryresume.pl     2003-02-12 14:01:01.000000000 
+0100
+++ ./queryresume.pl    2006-07-22 11:36:26.754436104 +0200
@@ -32,13 +32,14 @@
 
 sub sig_window_item_new ($$) {
     my ($win, $witem) = @_;
-    return unless (ref $witem && $witem->{type} eq 'QUERY');
+    #return unless (ref $witem && $witem->{type} eq 'QUERY');
+    return unless (ref $witem);
     my @data;
     my $filename = Irssi::settings_get_str('autolog_path');
     my $servertag = $witem->{server}->{tag};
     my $name = lc $witem->{name};
-    $filename =~ s/(\$tag|\$1)/$servertag/g;
-    $filename =~ s/\$0/$name/g;
+    $filename =~ s/\$tag\b|\$\{tag\}|\$1\b|\$\{1\}/$servertag/g;
+    $filename =~ s/\$0\b|\$\{0\}/$name/g;
     my @lt = localtime(time);
     my $zone;
     $filename = strftime($filename, @lt, $zone);


If you don't like the first part, remove it - I'm submitting the patch
to fix the ${var} bug.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-686
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Christoph
-- 
[EMAIL PROTECTED] | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to