From 8600de88063c0899c7ae33101a76efd3235cbe6b Mon Sep 17 00:00:00 2001 From: wowaname Date: Wed, 14 Sep 2016 00:19:39 +0000 Subject: [PATCH] change /infolist new now you can create infolists of any type and look through them --- scripts/infolist.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/infolist.pl b/scripts/infolist.pl index 4564504..e30283d 100644 --- a/scripts/infolist.pl +++ b/scripts/infolist.pl @@ -55,7 +55,7 @@ sub look { } elsif (/^p:(.+)/) { $item .= "p:$1: ".weechat::infolist_pointer($iptr, $1); } elsif (/^b:(.+)/) { - $item .= "b:$1: ".weechat::infolist_buffer($iptr, $1); + $item .= "b:$1: "#.weechat::infolist_buffer($iptr, $1); } elsif (/^t:(.+)/) { $item .= "t:$1: ".weechat::infolist_time($iptr, $1); } @@ -90,11 +90,13 @@ sub infolist_cb { weechat::command('', '/debug infolists'); } elsif ($args =~ /^(0x[0-9a-f]+) *(.+)/i) { infolist($1, $2); - } elsif ($args =~ /^new/) { + } elsif ($args =~ /^new *([^ ]*) *([^ ]*|\-) *(.*|\-)/) { # let's get a nicklist and leave it open - my $iptr = weechat::infolist_get('irc_nick', '', - weechat::buffer_get_string($buffer, 'localvar_server').','. - weechat::buffer_get_string($buffer, 'localvar_channel')); + my $iptr = weechat::infolist_get( + $1, + $2 eq '-' ? '' : $2, + $3 eq '-' ? '' : $3 + ); $iptr ? info("infolist created at $iptr") : error("error creating infolist"); }