line |
l |
!l&&r |
!l&&!r |
condition |
93
|
0 |
5 |
0 |
$ENV{'LOGNAME'} || getpwuid $> |
204
|
1 |
3 |
0 |
$$self{'connect_f'} ||= 'Future'->new->done($self) |
234
|
0 |
1 |
0 |
$$self{'connect_f'} ||= $self->SUPER::connect(%args, 'on_resolve_error', sub {
my($msg) = @_;
chomp $msg;
if ($args{'on_resolve_error'}) {
$args{'on_resolve_error'}($msg);
}
elsif ($on_error) {
&$on_error("Cannot resolve - $msg");
};
}
, 'on_connect_error', sub {
if ($args{'on_connect_error'}) {
$args{'on_connect_error'}(@_);
}
elsif ($on_error) {
&$on_error('Cannot connect');
};
}
)->on_fail(sub {
undef $$self{'connect_f'};
}
) |
285
|
3 |
1 |
0 |
delete $args{'nick'} || $$self{'nick'} |
286
|
2 |
2 |
0 |
delete $args{'user'} || $$self{'user'} |
287
|
2 |
2 |
0 |
delete $args{'realname'} || $$self{'realname'} |
295
|
3 |
1 |
0 |
not defined $on_login or ref $on_login eq 'CODE' |
311
|
0 |
4 |
0 |
$$self{'login_f'} ||= $self->connect(%args)->then(sub {
$self->send_message('CAP', undef, 'LS') if $$self{'use_caps'};
$self->send_message('PASS', undef, $pass) if defined $pass;
$self->send_message('USER', undef, $user, '0', '*', $realname);
$self->send_message('NICK', undef, $nick);
my $f = $self->loop->new_future;
push @{$$self{'on_login_f'};}, $f;
$f->on_done($on_login) if $on_login;
return $f;
}
)->on_fail(sub {
undef $$self{'login_f'};
}
) |