From 90116b4b98e8da3164bef7997f62f18ce4d0c322 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Sun, 25 Jan 2004 00:53:50 +0000 Subject: [PATCH] Some more drastic auto-fixing code for really annoying servers. --- webtools/mozbot/mozbot.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webtools/mozbot/mozbot.pl b/webtools/mozbot/mozbot.pl index e1248479ca5..f76c09f354c 100755 --- a/webtools/mozbot/mozbot.pl +++ b/webtools/mozbot/mozbot.pl @@ -609,7 +609,16 @@ sub on_disconnected { return if defined($self->{'__mozbot__shutdown'}); # HACK HACK HACK $self->{'__mozbot__shutdown'} = 1; # HACK HACK HACK my($reason) = $event->args; - if ($reason =~ /Bad user info/osi and $serverRestrictsIRCNames ne $server) { + if ($reason =~ /Connection timed out/osi + and ($serverRestrictsIRCNames ne $server + or $serverExpectsValidUsername ne $server)) { + # try to set everything up as simple as possible + $serverRestrictsIRCNames = $server; + $serverExpectsValidUsername = $server; + &Configuration::Save($cfgfile, &configStructure(\$serverRestrictsIRCNames)); + &debug('Hrm, $server is having issues. We\'re gonna try to be nice.'); + &debug("The full message from the server was: '$reason'"); + } elsif ($reason =~ /Bad user info/osi and $serverRestrictsIRCNames ne $server) { # change our IRC name to something simpler by setting the flag $serverRestrictsIRCNames = $server; &Configuration::Save($cfgfile, &configStructure(\$serverRestrictsIRCNames));