Changeset ac374fc


Ignore:
Timestamp:
Dec 24, 2009, 10:37:22 PM (10 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1dc839b
Parents:
0572abcf
git-author:
Nelson Elhage <nelhage@mit.edu> (12/24/09 22:34:47)
git-committer:
Nelson Elhage <nelhage@mit.edu> (12/24/09 22:37:22)
Message:
Revert "irc-disconnect on a pending reconnect should cancel the reconnect"

This reverts commit 618a9803a0d96a593db35163d5f984957a0b7316.

This commit was an ugly hack intended to get a minimall invasive fix
into 1.5. I will be pushing a better fix to master shortly.
Location:
perl/modules/IRC/lib/BarnOwl/Module
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r618a980 rac374fc  
    167167
    168168    BarnOwl::new_command(
    169         'irc-disconnect' => \&cmd_disconnect,
     169        'irc-disconnect' => mk_irc_command( \&cmd_disconnect ),
    170170        {
    171171            summary => 'Disconnect from an IRC server',
     
    391391
    392392sub cmd_disconnect {
    393     # Such a hack
    394     local *get_connection_by_alias = sub {
    395         my $key = shift;
    396         return $ircnets{$key} if exists $ircnets{$key};
    397         return $reconnect{$key}{conn} if exists $reconnect{$key};
    398         die("No such ircnet: $key\n");
    399     };
    400 
    401     mk_irc_command(
    402         sub {
    403             my $cmd = shift;
    404             my $conn = shift;
    405             if ($conn->conn->connected) {
    406                 $conn->conn->disconnect;
    407             } elsif ($reconnect{$conn->alias}) {
    408                 BarnOwl::admin_message('IRC',
    409                                        "[" . $conn->alias . "] Reconnect cancelled");
    410                 delete $reconnect{$conn->alias};
    411             }
    412         }
    413     )->(@_);
     393    my $cmd = shift;
     394    my $conn = shift;
     395    $conn->conn->disconnect;
     396    return;
    414397}
    415398
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r618a980 rac374fc  
    322322            },
    323323        } );
    324     $BarnOwl::Module::IRC::reconnect{$self->alias}{conn} = $self;
    325324}
    326325
Note: See TracChangeset for help on using the changeset viewer.