line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JLogger::Handler::Message; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
537
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
14
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
27
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use base 'JLogger::Handler'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
306
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub handle { |
9
|
0
|
|
|
0
|
0
|
|
my ($self, $node) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
0
|
0
|
|
|
|
if (my $body_node = |
12
|
|
|
|
|
|
|
($node->find_all(['component' => 'body']))[0] |
13
|
|
|
|
|
|
|
|| ($node->find_all(['client' => 'body']))[0] |
14
|
|
|
|
|
|
|
) { |
15
|
0
|
|
|
|
|
|
my $message = { |
16
|
|
|
|
|
|
|
from => $node->attr('from'), |
17
|
|
|
|
|
|
|
to => $node->attr('to'), |
18
|
|
|
|
|
|
|
type => 'message', |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
id => $node->attr('id'), |
21
|
|
|
|
|
|
|
message_type => $node->attr('type'), |
22
|
|
|
|
|
|
|
body => $body_node->text, |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if (my $thread_node = ($node->find_all(['component' => 'thread']))[0]) |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
|
|
|
$message->{thread} = $thread_node->text; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $message; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Ignore empty messages |
34
|
0
|
|
|
|
|
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |