aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Healey <richh@boxdice.com.au>2011-01-05 00:05:45 +0000
committerRich Healey <richh@boxdice.com.au>2011-01-05 00:05:45 +0000
commit65a6ee85146c34a8f3f71354ff35159f93810adc (patch)
treec82726653c9db92be15b79fb8bb359073d6bbce8
parentMerge branch 'dev' of github.com:shabble/irssi-scripts into dev (diff)
downloadirssi-scripts-65a6ee85146c34a8f3f71354ff35159f93810adc.tar.gz
irssi-scripts-65a6ee85146c34a8f3f71354ff35159f93810adc.zip
Added support for tab completion.
I believe this patch will work with your original setup too :)
-rw-r--r--auto-server/auto_server.pl16
1 files changed, 15 insertions, 1 deletions
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 {