From b94cd9ee214c9ef76e3a135daefba77801ec2609 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Sun, 19 Oct 2003 17:02:07 +0000 Subject: [PATCH] Undocumented (for now) feature: let the user override the bot's username from the config file by setting the 'username' configuration option to a true value (defaults to 0). --- webtools/mozbot/mozbot.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webtools/mozbot/mozbot.pl b/webtools/mozbot/mozbot.pl index f578a3ae9e43..4bab6f1726b5 100755 --- a/webtools/mozbot/mozbot.pl +++ b/webtools/mozbot/mozbot.pl @@ -196,6 +196,7 @@ my %users = ('admin' => &newPassword('password')); # default password for admin my %userFlags = ('admin' => 3); # bitmask; 0x1 = admin, 0x2 = delete user a soon as other admin authenticates my $helpline = 'http://www.mozilla.org/projects/mozbot/'; # used in IRC name and in help my $serverRestrictsIRCNames = ''; +my $username = 0; # makes the username default to the pid ($USERNAME) my @modulenames = ('General', 'Greeting', 'Infobot', 'Parrot'); # - which variables can be saved. @@ -219,6 +220,7 @@ my @modulenames = ('General', 'Greeting', 'Infobot', 'Parrot'); [\%userFlags, 'userFlags'], # usernames => bits [\$variablepattern, 'variablepattern'], [\$helpline, 'helpline'], + [\$username, 'username'], [\$serverRestrictsIRCNames, 'simpleIRCNameServer'], [\$Mails::smtphost, 'smtphost'], ); @@ -306,7 +308,7 @@ sub connect { Password => $password, Nick => $nicks[$nick], Ircname => $ircname, - Username => $USERNAME, + Username => $username || $USERNAME, LocalAddr => $localAddr, )) { &debug("Could not connect. Are you sure '$server:$port' is a valid host?");