From: Andreas Scherbaum Date: Thu, 9 Aug 2012 22:50:30 +0000 (+0200) Subject: - implement channel password handling X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=5296318712a9e3d49adbb9248283df80ee4e7952;p=docbot.git - implement channel password handling --- diff --git a/docbot.pl b/docbot.pl index 9ed8819..24b96ee 100755 --- a/docbot.pl +++ b/docbot.pl @@ -3532,7 +3532,12 @@ sub on_connect { my %chan_data = (); foreach my $channel (@join_channels) { # based on the current configuration, each channel can only be joined by one bot session - $irc->yield( join => $channel ); + my $channel_password = config_get_key3('channels', $channel, 'password'); + if (defined($channel_password) and length($channel_password) > 0) { + $irc->yield( join => $channel, $channel_password ); + } else { + $irc->yield( join => $channel ); + } $chan_data{$channel} = {}; } $heap->{'chan_data_' . $session} = \%chan_data; diff --git a/todo.txt b/todo.txt index 8e0f69f..fc97164 100644 --- a/todo.txt +++ b/todo.txt @@ -6,7 +6,6 @@ - extra channel - track each channel message and see, if the bot was mentioned - Log::Log4perl? -- channel passwords - nickserv handling (passwords) - verify channel list from time to time, autojoin missing channels @@ -27,3 +26,4 @@ - implement --help OK - verify existence of required tables at startup OK - move translations to a separate file OK +- channel passwords OK