my @join_channels = ();
foreach my $channel (@channels) {
my $channel_session = config_get_key3('channels', $channel, 'session');
- if ($channel_session == $session) {
+ my $channel_autojoin = config_get_key3('channels', $channel, 'autojoin');
+ if (!defined($channel_autojoin)) {
+ $channel_autojoin = '';
+ }
+ # autojoin is the default
+ my $channel_autojoin_result = 1;
+ given ($channel_autojoin) {
+ when(/^0$/) {$channel_autojoin_result = 0;}
+ when(/^n$/) {$channel_autojoin_result = 0;}
+ when(/^no$/) {$channel_autojoin_result = 0;}
+ when(/^1$/) {$channel_autojoin_result = 1;}
+ when(/^y$/) {$channel_autojoin_result = 1;}
+ when(/^yes$/) {$channel_autojoin_result = 1;}
+ }
+ if ($channel_session == $session and $channel_autojoin_result == 1) {
push(@join_channels, $channel);
print_msg("assign irc channel '$channel' to session '$session'", DEBUG);
}
- nickserv handling (passwords)
- verify channel list from time to time, autojoin missing channels
- allow a password for the ?join command
-- predefine channels in the configuration which are not autojoined
- verify existence of required tables at startup OK
- move translations to a separate file OK
- channel passwords OK
+- predefine channels in the configuration which are not autojoined OK