| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mastodon::Entity::Status; |
|
2
|
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
2817
|
use strict; |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
80
|
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
107
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.012'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
497
|
use Moo; |
|
|
3
|
|
|
|
|
5535
|
|
|
|
3
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
|
|
with 'Mastodon::Role::Entity'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
1909
|
use Types::Standard qw( Maybe Int Str Bool ArrayRef Enum ); |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
40
|
|
|
12
|
3
|
|
|
|
|
19
|
use Mastodon::Types qw( |
|
13
|
|
|
|
|
|
|
URI Account Status DateTime Attachment Mention Tag Application |
|
14
|
3
|
|
|
3
|
|
4246
|
); |
|
|
3
|
|
|
|
|
7
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
3
|
|
|
3
|
|
4297
|
use Log::Any; |
|
|
3
|
|
|
|
|
6301
|
|
|
|
3
|
|
|
|
|
30
|
|
|
17
|
|
|
|
|
|
|
my $log = Log::Any->get_logger( category => 'Mastodon' ); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has account => ( |
|
20
|
|
|
|
|
|
|
is => 'ro', isa => Account, coerce => 1, required => 1, |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has application => ( |
|
24
|
|
|
|
|
|
|
is => 'ro', isa => Maybe [Application], coerce => 1, |
|
25
|
|
|
|
|
|
|
); |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has content => ( |
|
28
|
|
|
|
|
|
|
is => 'ro', isa => Str, |
|
29
|
|
|
|
|
|
|
); |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has created_at => ( |
|
32
|
|
|
|
|
|
|
is => 'ro', isa => DateTime, coerce => 1, |
|
33
|
|
|
|
|
|
|
); |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has favourited => ( |
|
36
|
|
|
|
|
|
|
is => 'ro', isa => Bool, |
|
37
|
|
|
|
|
|
|
); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has favourites_count => ( |
|
40
|
|
|
|
|
|
|
is => 'ro', isa => Int, required => 1, |
|
41
|
|
|
|
|
|
|
); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has id => ( |
|
44
|
|
|
|
|
|
|
is => 'ro', isa => Int, |
|
45
|
|
|
|
|
|
|
); |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has in_reply_to_account_id => ( |
|
48
|
|
|
|
|
|
|
is => 'ro', isa => Maybe [Int], |
|
49
|
|
|
|
|
|
|
); |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has in_reply_to_id => ( |
|
52
|
|
|
|
|
|
|
is => 'ro', isa => Maybe [Int], |
|
53
|
|
|
|
|
|
|
); |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has media_attachments => ( |
|
56
|
|
|
|
|
|
|
is => 'ro', isa => ArrayRef [Attachment], coerce => 1, |
|
57
|
|
|
|
|
|
|
); |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
has mentions => ( |
|
60
|
|
|
|
|
|
|
is => 'ro', isa => ArrayRef [Mention], coerce => 1, |
|
61
|
|
|
|
|
|
|
); |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
has reblog => ( |
|
64
|
|
|
|
|
|
|
is => 'ro', isa => Maybe [Status], coerce => 1, |
|
65
|
|
|
|
|
|
|
); |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
has reblogged => ( |
|
68
|
|
|
|
|
|
|
is => 'ro', isa => Bool, |
|
69
|
|
|
|
|
|
|
); |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
has reblogs_count => ( |
|
72
|
|
|
|
|
|
|
is => 'ro', isa => Int, |
|
73
|
|
|
|
|
|
|
); |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
has sensitive => ( |
|
76
|
|
|
|
|
|
|
is => 'ro', isa => Bool, |
|
77
|
|
|
|
|
|
|
); |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
has spoiler_text => ( |
|
80
|
|
|
|
|
|
|
is => 'ro', isa => Str, |
|
81
|
|
|
|
|
|
|
); |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
has tags => ( |
|
84
|
|
|
|
|
|
|
is => 'ro', isa => ArrayRef [Tag], coerce => 1, |
|
85
|
|
|
|
|
|
|
); |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
has uri => ( |
|
88
|
|
|
|
|
|
|
is => 'ro', isa => Str, |
|
89
|
|
|
|
|
|
|
); |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
has url => ( |
|
92
|
|
|
|
|
|
|
is => 'ro', isa => URI, coerce => 1, |
|
93
|
|
|
|
|
|
|
); |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
has visibility => ( |
|
96
|
|
|
|
|
|
|
is => 'ro', isa => Enum[qw( |
|
97
|
|
|
|
|
|
|
public unlisted private direct |
|
98
|
|
|
|
|
|
|
)], |
|
99
|
|
|
|
|
|
|
required => 1, |
|
100
|
|
|
|
|
|
|
); |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
foreach my $pair ( |
|
103
|
|
|
|
|
|
|
[ fetch => 'get_status' ], |
|
104
|
|
|
|
|
|
|
[ fetch_context => 'get_status_context' ], |
|
105
|
|
|
|
|
|
|
[ fetch_card => 'get_status_card' ], |
|
106
|
|
|
|
|
|
|
[ fetch_reblogs => 'get_status_reblogs' ], |
|
107
|
|
|
|
|
|
|
[ fetch_favourites => 'get_status_favourites' ], |
|
108
|
|
|
|
|
|
|
[ delete => 'delete_status' ], |
|
109
|
|
|
|
|
|
|
[ boost => 'reblog' ], |
|
110
|
|
|
|
|
|
|
[ unboost => 'unreblog' ], |
|
111
|
|
|
|
|
|
|
[ favourite => undef ], |
|
112
|
|
|
|
|
|
|
[ unfavourite => undef ], |
|
113
|
|
|
|
|
|
|
) { |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
my ($name, $method) = @{$pair}; |
|
116
|
|
|
|
|
|
|
$method //= $name; |
|
117
|
|
|
|
|
|
|
|
|
118
|
3
|
|
|
3
|
|
949
|
no strict 'refs'; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
475
|
|
|
119
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $name } = sub { |
|
120
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
121
|
0
|
0
|
|
|
|
|
croak $log->fatal(qq{Cannot call '$name' without client}) |
|
122
|
|
|
|
|
|
|
unless $self->_client; |
|
123
|
0
|
|
|
|
|
|
$self->_client->$method($self->id, @_); |
|
124
|
|
|
|
|
|
|
}; |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=encoding utf8 |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 NAME |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Mastodon::Entity::Status - A Mastodon status |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
This object should not be manually created. It is intended to be generated |
|
138
|
|
|
|
|
|
|
from the data received from a Mastodon server using the coercions in |
|
139
|
|
|
|
|
|
|
L<Mastodon::Types>. |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
For current information, see the |
|
142
|
|
|
|
|
|
|
L<Mastodon API documentation|https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#status> |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=over 4 |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item B<id> |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
The ID of the status. |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item B<uri> |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
A Fediverse-unique resource ID. |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=item B<url> |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
URL to the status page (can be remote). |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item B<account> |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
The L<Mastodon::Entity::Account> which posted the status. |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item B<in_reply_to_id> |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
C<undef> or the ID of the status it replies to. |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item B<in_reply_to_account_id> |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
C<undef> or the ID of the account it replies to. |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=item B<reblog> |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
C<undef> or the reblogged L<Mastodon::Entity::Status>. |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item B<content> |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Body of the status; this will contain HTML (remote HTML already sanitized). |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item B<created_at> |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
The time the status was created as a L<DateTime> object. |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item B<reblogs_count> |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
The number of reblogs for the status. |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=item B<favourites_count> |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
The number of favourites for the status. |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=item B<reblogged> |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Whether the authenticated user has reblogged the status. |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=item B<favourited> |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Whether the authenticated user has favourited the status. |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=item B<sensitive> |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Whether media attachments should be hidden by default. |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=item B<spoiler_text> |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
If not empty, warning text that should be displayed before the actual content. |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item B<visibility> |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
One of: C<public>, C<unlisted>, C<private>, C<direct>. |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=item B<media_attachments> |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
An array of L<Mastodon::Entity::Attachment> objects. |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=item B<mentions> |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
An array of L<Mastodon::Entity::Mention> objects. |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=item B<tags> |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
An array of L<Mastodon::Entity::Tag> objects. |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=item B<application> |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
Application from which the status was posted, as a |
|
227
|
|
|
|
|
|
|
L<Mastodon::Entity::Application> object. |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=back |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head1 METHODS |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
This class provides the following convenience methods. They act as a shortcut, |
|
234
|
|
|
|
|
|
|
passing the appropriate identifier of the current object as the first argument |
|
235
|
|
|
|
|
|
|
to the corresponding methods in L<Mastodon::Client>. |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=over 4 |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=item B<fetch> |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
A shortcut to C<get_status>. |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=item B<fetch_context> |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
A shortcut to C<get_status_context>. |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=item B<fetch_card> |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
A shortcut to C<get_status_card>. |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=item B<fetch_reblogs> |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
A shortcut to C<get_status_reblogs>. |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=item B<fetch_favourites> |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
A shortcut to C<get_status_favourites>. |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=item B<delete> |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
A shortcut to C<delete_status>. |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=item B<boost> |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
A shortcut to C<reblog>. |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=item B<unboost> |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
A shortcut to C<unreblog>. |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=item B<favourite> |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
A shortcut to C<favourite>. |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=item B<unfavourite> |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
A shortcut to C<unfavourite>. |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=back |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=head1 AUTHOR |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=over 4 |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
=item * |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
José JoaquÃn Atria <jjatria@cpan.org> |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=back |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
This software is copyright (c) 2017 by José JoaquÃn Atria. |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
296
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
=cut |