From 65a6ee85146c34a8f3f71354ff35159f93810adc Mon Sep 17 00:00:00 2001 From: Rich Healey Date: Wed, 5 Jan 2011 11:05:45 +1100 Subject: Added support for tab completion. I believe this patch will work with your original setup too :) --- auto-server/auto_server.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'auto-server') diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index 7054664..a9f6645 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -55,7 +55,7 @@ our %IRSSI = ( license => 'Public Domain', ); -my $channel_map; +my $channel_map = {}; my @hack_channels; my $pending_joins; @@ -104,6 +104,7 @@ sub haxy_print_hook { sub parse_channel_map { #my $data = Irssi::settings_get_str('joinplus_server_maps'); + unbind_completion(); my $data = retrieve_channels(); my @items = split /\s+/, $data; if (@items % 2 == 0) { @@ -113,6 +114,19 @@ sub parse_channel_map { $channel_map = {}; } _debug_print Dumper($channel_map); + bind_completion(); +} + +sub bind_completion { + foreach(%$channel_map) { + Irssi::command_bind("join+ $_", \&join_plus); + } +} + +sub unbind_completion { + foreach(%$channel_map) { + Irssi::command_unbind("join+ $_", \&join_plus); + } } sub join_plus { -- cgit v1.2.3 From be164408bab4128c4e67b6ac2e0f0183702c1790 Mon Sep 17 00:00:00 2001 From: Rich Healey Date: Fri, 7 Jan 2011 14:13:41 +1100 Subject: - is a valid character in a channel name. --- auto-server/auto_server.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'auto-server') diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index a9f6645..447a131 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -135,7 +135,7 @@ sub join_plus { # parse out channel name from args: my $channel; - if ($args =~ m/^(#?[#a-zA-Z0-9]+)/) { + if ($args =~ m/^(#?[#a-zA-Z0-9-]+)/) { $channel = $1; _debug_print ("Channel is: $channel"); } -- cgit v1.2.3