line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::EDITADDR; |
2
|
40
|
|
|
40
|
|
202
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
75
|
|
|
40
|
|
|
|
|
206
|
|
3
|
40
|
|
|
40
|
|
2072
|
use strictures; |
|
40
|
|
|
|
|
73
|
|
|
40
|
|
|
|
|
206
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
8704
|
$Net::Gnats::Command::EDITADDR::VERSION = '0.22'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
221
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
63
|
|
|
40
|
|
|
|
|
1572
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
198
|
use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR); |
|
40
|
|
|
|
|
82
|
|
|
40
|
|
|
|
|
9851
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::EDITADDR |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Sets the e-mail address of the person communicating with gnatsd. The |
18
|
|
|
|
|
|
|
command requires at least the edit access level. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 PROTOCOL |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
EDITADDR [address] |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 RESPONSES |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
The possible responses are: |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
200 (CODE_OK) |
29
|
|
|
|
|
|
|
The address was successfully set. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) |
32
|
|
|
|
|
|
|
Invalid number of arguments were supplied. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $c = 'EDITADDR'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new { |
40
|
4
|
|
|
4
|
1
|
12
|
my ( $class, %options ) = @_; |
41
|
|
|
|
|
|
|
|
42
|
4
|
|
|
|
|
10
|
my $self = bless \%options, $class; |
43
|
4
|
|
|
|
|
20
|
return $self; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub as_string { |
47
|
7
|
|
|
7
|
1
|
10
|
my ($self) = @_; |
48
|
7
|
100
|
|
|
|
38
|
return undef if not defined $self->{address}; |
49
|
6
|
|
|
|
|
29
|
return $c . ' ' . $self->{address}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub is_ok { |
53
|
4
|
|
|
4
|
0
|
9
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
# command not issued |
55
|
4
|
100
|
|
|
|
15
|
return 0 if not defined $self->response; |
56
|
|
|
|
|
|
|
# malformed command |
57
|
3
|
50
|
|
|
|
12
|
return 0 if not defined $self->response->code; |
58
|
3
|
50
|
|
|
|
12
|
return 1 if $self->response->code == CODE_OK; |
59
|
0
|
|
|
|
|
|
return 0; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |