line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package API::Matterbridge::Message; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
497
|
use Moo 2; |
|
1
|
|
|
|
|
2169
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
1786
|
use JSON 'decode_json'; |
|
1
|
|
|
|
|
8243
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
543
|
use Filter::signatures; |
|
1
|
|
|
|
|
14686
|
|
|
1
|
|
|
|
|
22
|
|
8
|
1
|
|
|
1
|
|
37
|
use feature 'signatures'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
9
|
1
|
|
|
1
|
|
5
|
no warnings 'experimental::signatures'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
145
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# This is just a hash-with-(currently no)-methods |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has [ |
16
|
|
|
|
|
|
|
"text", |
17
|
|
|
|
|
|
|
"channel", |
18
|
|
|
|
|
|
|
"username", |
19
|
|
|
|
|
|
|
"userid", |
20
|
|
|
|
|
|
|
"avatar", |
21
|
|
|
|
|
|
|
"account", |
22
|
|
|
|
|
|
|
"event", |
23
|
|
|
|
|
|
|
"protocol", |
24
|
|
|
|
|
|
|
"gateway", |
25
|
|
|
|
|
|
|
"parent_id", |
26
|
|
|
|
|
|
|
"timestamp", |
27
|
|
|
|
|
|
|
"id", |
28
|
|
|
|
|
|
|
"Extra", |
29
|
|
|
|
|
|
|
] => ( |
30
|
|
|
|
|
|
|
is => 'ro', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
0
|
|
sub from_bytes( $class, $bytes ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $class->new( decode_json($bytes)) |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
0
|
|
sub reply( $msg, $text, %options ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my %reply = ( |
39
|
|
|
|
|
|
|
gateway => $msg->gateway, |
40
|
|
|
|
|
|
|
text => $text, |
41
|
|
|
|
|
|
|
%options |
42
|
|
|
|
|
|
|
); |
43
|
0
|
|
|
|
|
|
return (ref $msg)->new(\%reply) |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |