aboutsummaryrefslogtreecommitdiffstats
path: root/auto-server
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-04-22 02:27:12 +0000
committerTom Feist <shabble@metavore.org>2011-04-22 02:27:12 +0000
commitfe6e50a76dba36899782fdda0f97590ee5f02a3c (patch)
treea8ae7406048f00807ba54aecb5dfcd9c0dd08944 /auto-server
parentremoved docs/ from dev branch, since they're all in their own repo (well, wiki) (diff)
parentfeature-tests/key_sig: test to see if there's any useful info in the 'keyboard (diff)
downloadirssi-scripts-fe6e50a76dba36899782fdda0f97590ee5f02a3c.tar.gz
irssi-scripts-fe6e50a76dba36899782fdda0f97590ee5f02a3c.zip
Merge branch 'master' into dev
Diffstat (limited to '')
-rw-r--r--auto-server/auto_server.pl18
1 files changed, 16 insertions, 2 deletions
diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl
index 7054664..447a131 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 {
@@ -121,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");
}