- implement channel password handling
authorAndreas Scherbaum <andreas@scherbaum.biz>
Thu, 9 Aug 2012 22:50:30 +0000 (00:50 +0200)
committerAndreas Scherbaum <andreas@scherbaum.biz>
Thu, 9 Aug 2012 22:50:30 +0000 (00:50 +0200)
docbot.pl
todo.txt

index 9ed88191b3abcb3dfa305bf27271eb1a3b5d6991..24b96eecd92d2e156ab14106333d8bf191bf428a 100755 (executable)
--- 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;
index 8e0f69f05cb444c188f85e237d8f1732092adf33..fc9716498a54e25ba17a4923d05f8016d1bc0698 100644 (file)
--- 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