change /infolist new

now you can create infolists of any type and look through them
This commit is contained in:
wowaname 2016-09-14 00:19:39 +00:00
parent cc737019cb
commit 8600de8806

View File

@ -55,7 +55,7 @@ sub look {
} elsif (/^p:(.+)/) { } elsif (/^p:(.+)/) {
$item .= "p:$1: ".weechat::infolist_pointer($iptr, $1); $item .= "p:$1: ".weechat::infolist_pointer($iptr, $1);
} elsif (/^b:(.+)/) { } elsif (/^b:(.+)/) {
$item .= "b:$1: ".weechat::infolist_buffer($iptr, $1); $item .= "b:$1: "#.weechat::infolist_buffer($iptr, $1);
} elsif (/^t:(.+)/) { } elsif (/^t:(.+)/) {
$item .= "t:$1: ".weechat::infolist_time($iptr, $1); $item .= "t:$1: ".weechat::infolist_time($iptr, $1);
} }
@ -90,11 +90,13 @@ sub infolist_cb {
weechat::command('', '/debug infolists'); weechat::command('', '/debug infolists');
} elsif ($args =~ /^(0x[0-9a-f]+) *(.+)/i) { } elsif ($args =~ /^(0x[0-9a-f]+) *(.+)/i) {
infolist($1, $2); infolist($1, $2);
} elsif ($args =~ /^new/) { } elsif ($args =~ /^new *([^ ]*) *([^ ]*|\-) *(.*|\-)/) {
# let's get a nicklist and leave it open # let's get a nicklist and leave it open
my $iptr = weechat::infolist_get('irc_nick', '', my $iptr = weechat::infolist_get(
weechat::buffer_get_string($buffer, 'localvar_server').','. $1,
weechat::buffer_get_string($buffer, 'localvar_channel')); $2 eq '-' ? '' : $2,
$3 eq '-' ? '' : $3
);
$iptr ? info("infolist created at $iptr") : $iptr ? info("infolist created at $iptr") :
error("error creating infolist"); error("error creating infolist");
} }