@@ -13,6 +13,7 @@ use Mozilla::CA;
1313
1414my $PosInt = Type::Tiny-> new( name => ' PosInt' , parent => Int, constraint => sub { $_ > 0 } );
1515my $PosNum = Type::Tiny-> new( name => ' PosNum' , parent => Num, constraint => sub { $_ > 0 } );
16+ my $NonNegNum = Type::Tiny-> new( name => ' NonNegNum' , parent => Num, constraint => sub { $_ >= 0 } );
1617my $HundredInt = Type::Tiny-> new( name => ' HundredInt' , parent => Num, constraint => sub { $_ > 100 } );
1718
1819my $CoercedBool = Bool-> plus_coercions( Str, sub { ( $_ =~ m / (^on$ )|(^true$ )/ i ) + 0 } );
@@ -25,21 +26,21 @@ has jabber_client => (
2526
2627# my %connection_hash : ATTR; # Keep track of connection options fed to client.
2728
28- has ' client_session_id' => ( isa => Str, is => ' rw' );
29- has ' connect_time' => ( isa => $PosInt , is => ' rw' , default => 9_999_999_999 );
30- has ' forum_join_grace' => ( isa => $PosNum , is => ' rw' , default => 10 );
31- has ' server_host' => ( isa => Str, is => ' rw' , lazy => 1, default => sub { shift -> server } );
32- has ' server' => ( isa => Str, is => ' rw' );
33- has ' port' => ( isa => $PosInt , is => ' rw' , default => 5222 );
34- has ' gtalk' => ( isa => Bool, is => ' rw' , default => ' 0' );
35- has ' tls' => ( isa => Bool, is => ' rw' , default => ' 0' );
36- has ' ssl_ca_path' => ( isa => Str, is => ' rw' , default => Mozilla::CA::SSL_ca_file() );
37- has ' ssl_verify' => ( isa => Bool, is => ' rw' , default => ' 1' );
38- has ' connection_type' => ( isa => Str, is => ' rw' , default => ' tcpip' );
39- has ' conference_server' => ( isa => Str, is => ' rw' );
40- has ' username' => ( isa => Str, is => ' rw' );
41- has ' password' => ( isa => Str, is => ' rw' );
42- has ' alias' => ( isa => Str, lazy => 1, is => ' rw' , default => ' net_jabber_bot' );
29+ has ' client_session_id' => ( isa => Str, is => ' rw' );
30+ has ' connect_time' => ( isa => $PosInt , is => ' rw' , default => 9_999_999_999 );
31+ has ' forum_join_grace' => ( isa => $NonNegNum , is => ' rw' , default => 10 );
32+ has ' server_host' => ( isa => Str, is => ' rw' , lazy => 1, default => sub { shift -> server } );
33+ has ' server' => ( isa => Str, is => ' rw' );
34+ has ' port' => ( isa => $PosInt , is => ' rw' , default => 5222 );
35+ has ' gtalk' => ( isa => Bool, is => ' rw' , default => ' 0' );
36+ has ' tls' => ( isa => Bool, is => ' rw' , default => ' 0' );
37+ has ' ssl_ca_path' => ( isa => Str, is => ' rw' , default => Mozilla::CA::SSL_ca_file() );
38+ has ' ssl_verify' => ( isa => Bool, is => ' rw' , default => ' 1' );
39+ has ' connection_type' => ( isa => Str, is => ' rw' , default => ' tcpip' );
40+ has ' conference_server' => ( isa => Str, is => ' rw' );
41+ has ' username' => ( isa => Str, is => ' rw' );
42+ has ' password' => ( isa => Str, is => ' rw' );
43+ has ' alias' => ( isa => Str, lazy => 1, is => ' rw' , default => ' net_jabber_bot' );
4344
4445# Resource defaults to alias_hostname_pid
4546has ' resource' => ( isa => Str, lazy => 1, is => ' rw' , default => sub { shift -> alias . " _" . hostname . " _" . $$ } );
0 commit comments