Changeset 814aca1 for perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
- Timestamp:
- Dec 30, 2009, 2:12:15 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 901b931
- Parents:
- 85fa6e4 (diff), d41f773 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
r618a980 r416241f 23 23 24 24 use BarnOwl; 25 use Scalar::Util qw(weaken); 25 26 26 27 BEGIN { … … 315 316 my $interval = shift || 5; 316 317 delete $BarnOwl::Module::IRC::ircnets{$self->alias}; 317 $BarnOwl::Module::IRC::reconnect{$self->alias} = 318 $BarnOwl::Module::IRC::reconnect{$self->alias} = $self; 319 my $weak = $self; 320 weaken($weak); 321 $self->{reconnect_timer} = 318 322 BarnOwl::Timer->new( { 319 323 after => $interval, 320 324 cb => sub { 321 $ self->reconnect( $interval );325 $weak->reconnect( $interval ) if $weak; 322 326 }, 323 327 } ); 324 $BarnOwl::Module::IRC::reconnect{$self->alias}{conn} = $self; 328 } 329 330 sub cancel_reconnect { 331 my $self = shift; 332 delete $BarnOwl::Module::IRC::reconnect{$self->alias}; 333 delete $self->{reconnect_timer}; 325 334 } 326 335 … … 329 338 my $msg = shift; 330 339 BarnOwl::admin_message("IRC", $msg); 331 delete $BarnOwl::Module::IRC::reconnect{$self->alias};340 $self->cancel_reconnect; 332 341 $BarnOwl::Module::IRC::ircnets{$self->alias} = $self; 333 342 my $fd = $self->getSocket()->fileno();
Note: See TracChangeset
for help on using the changeset viewer.