- Timestamp:
- Apr 3, 2011, 3:06:01 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 5d4262c
- Parents:
- 59425a3
- git-author:
- Nelson Elhage <nelhage@mit.edu> (02/26/11 20:43:58)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (04/03/11 15:06:01)
- Location:
- perl/modules/IRC/lib/BarnOwl/Module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
r851a0e0 r3713b86 31 31 our %ircnets; 32 32 our %channels; 33 our %reconnect;34 33 35 34 sub startup { … … 398 397 if ($conn->conn->{socket}) { 399 398 $conn->conn->disconnect("Goodbye!"); 400 } elsif ($ reconnect{$conn->alias}) {399 } elsif ($conn->{reconnect_timer}) { 401 400 BarnOwl::admin_message('IRC', 402 401 "[" . $conn->alias . "] Reconnect cancelled"); 403 402 $conn->cancel_reconnect; 403 delete $ircnets{$conn->alias}; 404 404 } 405 405 } … … 620 620 my $allow_disconnected = shift; 621 621 622 return $ircnets{$key} if exists $ircnets{$key}; 623 return $reconnect{$key} if $allow_disconnected && exists $reconnect{$key}; 624 die("No such ircnet: $key\n") 622 my $conn = $ircnets{$key}; 623 die("No such ircnet: $key\n") unless $conn; 624 if ($conn->conn->{registered} || $allow_disconnected) { 625 return $conn; 626 } 627 die("[@{[$conn->alias]}] Not currently connected."); 625 628 } 626 629 -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
r59425a3 r3713b86 379 379 my $self = shift; 380 380 my $interval = shift || 5; 381 $BarnOwl::Module::IRC::reconnect{$self->alias} = $self; 381 382 382 my $weak = $self; 383 383 weaken($weak); … … 397 397 sub cancel_reconnect { 398 398 my $self = shift; 399 delete $BarnOwl::Module::IRC::reconnect{$self->alias}; 399 400 400 if (defined $self->{reconnect_timer}) { 401 401 $self->{reconnect_timer}->stop;
Note: See TracChangeset
for help on using the changeset viewer.