pong fix for freenode

This commit is contained in:
thomas.figg 2009-03-11 01:01:01 +00:00
parent a3f5795ef3
commit a5267b8cdd
2 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,6 @@
server = irc.synirc.org
#server = irc.synirc.org
server = irc.freenode.org
#server = irc.undernet.org
port = 6667
nick = buttbottest
ident = null

View File

@ -69,6 +69,12 @@ sub process {
process_line($_) for split /\n/, gets();
}
sub cmd_pong {
my $command = shift @_;
$command =~ s/^://;
pong($command =~ /^\d+$/ ? $command : "$CONF{nick} $command")
}
sub process_line {
my $line = shift;
print "$line\n";
@ -81,7 +87,10 @@ sub process_line {
die "from server: @data" if $from eq 'ERROR';
# if server pings, ping back.
pong($command =~ /^:\d+$/ ? $command : ":$CONF{nick}") if $from eq 'PING';
if ($from eq 'PING') {
cmd_pong($command);
}
# If buttbot has successfully connected to the server, join a channel.
if ($command eq '001') {