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
activitypub / includes / activity / class-actor.php

class-actor.php in ActivityPub 5.3.1, at includes/activity/class-actor.php

211 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Inspired by the PHP ActivityPub Library by @Landrok
4 *
5 * @link https://github.com/landrok/activitypub
6 *
7 * @package Activitypub
8 */
9
10 namespace Activitypub\Activity;
11
12 /**
13 * \Activitypub\Activity\Actor is an implementation of
14 * one an Activity Streams Actor.
15 *
16 * Represents an individual actor.
17 *
18 * @see https://www.w3.org/TR/activitystreams-vocabulary/#actor-types
19 */
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
64 /**
65 * The type of the object.
66 *
67 * @var string
68 */
69 protected $type;
70
71 /**
72 * A reference to an ActivityStreams OrderedCollection comprised of
73 * all the messages received by the actor.
74 *
75 * @see https://www.w3.org/TR/activitypub/#inbox
76 *
77 * @var string|null
78 */
79 protected $inbox;
80
81 /**
82 * A reference to an ActivityStreams OrderedCollection comprised of
83 * all the messages produced by the actor.
84 *
85 * @see https://www.w3.org/TR/activitypub/#outbox
86 *
87 * @var string|null
88 */
89 protected $outbox;
90
91 /**
92 * A link to an ActivityStreams collection of the actors that this
93 * actor is following.
94 *
95 * @see https://www.w3.org/TR/activitypub/#following
96 *
97 * @var string
98 */
99 protected $following;
100
101 /**
102 * A link to an ActivityStreams collection of the actors that
103 * follow this actor.
104 *
105 * @see https://www.w3.org/TR/activitypub/#followers
106 *
107 * @var string
108 */
109 protected $followers;
110
111 /**
112 * A link to an ActivityStreams collection of objects this actor has
113 * liked.
114 *
115 * @see https://www.w3.org/TR/activitypub/#liked
116 *
117 * @var string
118 */
119 protected $liked;
120
121 /**
122 * A list of supplementary Collections which may be of interest.
123 *
124 * @see https://www.w3.org/TR/activitypub/#streams-property
125 *
126 * @var array
127 */
128 protected $streams = array();
129
130 /**
131 * A short username which may be used to refer to the actor, with no
132 * uniqueness guarantees.
133 *
134 * @see https://www.w3.org/TR/activitypub/#preferredUsername
135 *
136 * @var string|null
137 */
138 protected $preferred_username;
139
140 /**
141 * A JSON object which maps additional typically server/domain-wide
142 * endpoints which may be useful either for this actor or someone
143 * referencing this actor. This mapping may be nested inside the
144 * actor document as the value or may be a link to a JSON-LD
145 * document with these properties.
146 *
147 * @see https://www.w3.org/TR/activitypub/#endpoints
148 *
149 * @var string|array|null
150 */
151 protected $endpoints;
152
153 /**
154 * It's not part of the ActivityPub protocol but it's a quite common
155 * practice to handle an actor public key with a publicKey array:
156 * [
157 * 'id' => 'https://my-example.com/actor#main-key'
158 * 'owner' => 'https://my-example.com/actor',
159 * 'publicKeyPem' => '-----BEGIN PUBLIC KEY-----
160 * MIIBI [...]
161 * DQIDAQAB
162 * -----END PUBLIC KEY-----'
163 * ]
164 *
165 * @see https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization#Signing_requests_using_HTTP_Signatures
166 *
167 * @var string|array|null
168 */
169 protected $public_key;
170
171 /**
172 * It's not part of the ActivityPub protocol but it's a quite common
173 * practice to lock an account. If anabled, new followers will not be
174 * automatically accepted, but will instead require you to manually
175 * approve them.
176 *
177 * WordPress does only support 'false' at the moment.
178 *
179 * @see https://docs.joinmastodon.org/spec/activitypub/#as
180 *
181 * @context as:manuallyApprovesFollowers
182 *
183 * @var boolean
184 */
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;
210 }
211