Ignore:
Timestamp:
Dec 22, 2009, 6:37:38 PM (10 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
a2a5236
Parents:
6396c1e
git-author:
Alejandro R. Sedeño <asedeno@mit.edu> (12/22/09 01:15:39)
git-committer:
Alejandro R. Sedeño <asedeno@mit.edu> (12/22/09 18:37:38)
Message:
Factor out some common jabber connect-time code

Call it upon successful connection and reconnection.
File:
1 edited

Legend:

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

    rf1a2736 r0dbb7d2  
    8585    $self->{$jidStr}->{ReconnectAt} = time + $self->{$jidStr}->{ReconnectBackoff};
    8686
    87     my $status = $self->{$jidStr}->{Client}->Connect;
     87    my $client = $self->{$jidStr}->{Client};
     88    my $status = $client->Connect;
    8889    return 0 unless $status;
    8990
    90     my @result = $self->{$jidStr}->{Client}->AuthSend( %{ $self->{$jidStr}->{Auth} } );
     91    my @result = $client->AuthSend( %{ $self->{$jidStr}->{Auth} } );
    9192    if ( !@result || $result[0] ne 'ok' ) {
    9293        $self->removeConnection($jidStr);
     
    9495        return 0;
    9596    }
    96 
    97     BarnOwl::admin_message(Jabber => "Reconnected to jabber as $jidStr");
    98     $self->{$jidStr}{Status} = "available";
    99 
    100     foreach my $muc ($self->{$jidStr}->{Client}->MUCs()) {
     97    $self->{$jidStr}->{Status} = "available";
     98    $client->onConnect($self, $jidStr);
     99    foreach my $muc ($client->MUCs()) {
    101100        $muc->Join($muc->{ARGS});
    102101    }
Note: See TracChangeset for help on using the changeset viewer.