line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Snoo::User; |
2
|
1
|
|
|
1
|
|
4
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
extends 'Mojo::Snoo::Base'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
246
|
use Mojo::Collection; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use constant FIELD => 'name'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
200
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has name => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => sub { |
13
|
|
|
|
|
|
|
die "User needs a name!" unless $_[0]; |
14
|
|
|
|
|
|
|
}, |
15
|
|
|
|
|
|
|
required => 1 |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
1
|
50
|
|
1
|
0
|
1182
|
sub BUILDARGS { shift->SUPER::BUILDARGS(@_ == 1 ? (name => shift) : @_) } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub send_message { |
21
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# make sure we're clear of any captcha if required |
24
|
0
|
|
|
|
|
|
my ($captcha_id, $captcha_text) = $self->_solve_captcha(); |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my %form = ( |
27
|
|
|
|
|
|
|
api_type => 'json', |
28
|
|
|
|
|
|
|
captcha => $captcha_text, |
29
|
|
|
|
|
|
|
iden => $captcha_id, |
30
|
|
|
|
|
|
|
subject => 'subject goes here', |
31
|
|
|
|
|
|
|
text => 'body goes here', |
32
|
|
|
|
|
|
|
to => $self->name, |
33
|
|
|
|
|
|
|
); |
34
|
0
|
|
|
|
|
|
$self->_do_request('POST', '/api/compose', %form); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |