PluginProbe
ActivityPub / 5.3.1
ActivityPub v5.3.1
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/activity/class-actor.php +76 -5 2.0.05.3.1 View file →
@@ -2,8 +2,10 @@
2 2 /**
3 3 * Inspired by the PHP ActivityPub Library by @Landrok
4 4 *
5 5 * @link https://github.com/landrok/activitypub
6 + *
7 + * @package Activitypub
6 8 */
7 9
8 10 namespace Activitypub\Activity;
9 11
@@ -15,12 +17,57 @@
15 17 *
16 18 * @see https://www.w3.org/TR/activitystreams-vocabulary/#actor-types
17 19 */
18 20 class Actor extends Base_Object {
21 + // Reduced context for actors. TODO: still unused.
22 + const JSON_LD_CONTEXT = array(
23 + 'https://www.w3.org/ns/activitystreams',
24 + 'https://w3id.org/security/v1',
25 + 'https://purl.archive.org/socialweb/webfinger',
26 + array(
27 + 'schema' => 'http://schema.org#',
28 + 'toot' => 'http://joinmastodon.org/ns#',
29 + 'lemmy' => 'https://join-lemmy.org/ns#',
30 + 'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
31 + 'PropertyValue' => 'schema:PropertyValue',
32 + 'value' => 'schema:value',
33 + 'Hashtag' => 'as:Hashtag',
34 + 'featured' => array(
35 + '@id' => 'toot:featured',
36 + '@type' => '@id',
37 + ),
38 + 'featuredTags' => array(
39 + '@id' => 'toot:featuredTags',
40 + '@type' => '@id',
41 + ),
42 + 'moderators' => array(
43 + '@id' => 'lemmy:moderators',
44 + '@type' => '@id',
45 + ),
46 + 'attributionDomains' => array(
47 + '@id' => 'toot:attributionDomains',
48 + '@type' => '@id',
49 + ),
50 + 'alsoKnownAs' => array(
51 + '@id' => 'as:alsoKnownAs',
52 + '@type' => '@id',
53 + ),
54 + 'movedTo' => array(
55 + '@id' => 'as:movedTo',
56 + '@type' => '@id',
57 + ),
58 + 'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods',
59 + 'discoverable' => 'toot:discoverable',
60 + 'indexable' => 'toot:indexable',
61 + ),
62 + );
63 +
19 64 /**
65 + * The type of the object.
66 + *
20 67 * @var string
21 68 */
22 - protected $type = 'Person';
69 + protected $type;
23 70
24 71 /**
25 72 * A reference to an ActivityStreams OrderedCollection comprised of
26 73 * all the messages received by the actor.
@@ -26,10 +73,9 @@
26 73 * all the messages received by the actor.
27 74 *
28 75 * @see https://www.w3.org/TR/activitypub/#inbox
29 76 *
30 - * @var string
31 - * | null
77 + * @var string|null
32 78 */
33 79 protected $inbox;
34 80
35 81 /**
@@ -37,10 +83,9 @@
37 83 * all the messages produced by the actor.
38 84 *
39 85 * @see https://www.w3.org/TR/activitypub/#outbox
40 86 *
41 - * @var string
42 - * | null
87 + * @var string|null
43 88 */
44 89 protected $outbox;
45 90
46 91 /**
@@ -132,8 +177,34 @@
132 177 * WordPress does only support 'false' at the moment.
133 178 *
134 179 * @see https://docs.joinmastodon.org/spec/activitypub/#as
135 180 *
181 + * @context as:manuallyApprovesFollowers
182 + *
136 183 * @var boolean
137 184 */
138 185 protected $manually_approves_followers = false;
186 +
187 + /**
188 + * Domains allowed to use `fediverse:creator` for this actor in
189 + * published articles.
190 + *
191 + * @see https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/
192 + *
193 + * @var array
194 + */
195 + protected $attribution_domains = null;
196 +
197 + /**
198 + * The target of the actor.
199 + *
200 + * @var string|null
201 + */
202 + protected $moved_to;
203 +
204 + /**
205 + * The alsoKnownAs of the actor.
206 + *
207 + * @var array
208 + */
209 + protected $also_known_as;
139 210 }