PluginProbe
ActivityPub / 4.1.1
ActivityPub v4.1.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 4.1.1, at includes/activity/class-actor.php

202 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 'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods',
51 'discoverable' => 'toot:discoverable',
52 'indexable' => 'toot:indexable',
53 ),
54 );
55
56 /**
57 * The type of the object.
58 *
59 * @var string
60 */
61 protected $type;
62
63 /**
64 * A reference to an ActivityStreams OrderedCollection comprised of
65 * all the messages received by the actor.
66 *
67 * @see https://www.w3.org/TR/activitypub/#inbox
68 *
69 * @var string
70 * | null
71 */
72 protected $inbox;
73
74 /**
75 * A reference to an ActivityStreams OrderedCollection comprised of
76 * all the messages produced by the actor.
77 *
78 * @see https://www.w3.org/TR/activitypub/#outbox
79 *
80 * @var string
81 * | null
82 */
83 protected $outbox;
84
85 /**
86 * A link to an ActivityStreams collection of the actors that this
87 * actor is following.
88 *
89 * @see https://www.w3.org/TR/activitypub/#following
90 *
91 * @var string
92 */
93 protected $following;
94
95 /**
96 * A link to an ActivityStreams collection of the actors that
97 * follow this actor.
98 *
99 * @see https://www.w3.org/TR/activitypub/#followers
100 *
101 * @var string
102 */
103 protected $followers;
104
105 /**
106 * A link to an ActivityStreams collection of objects this actor has
107 * liked.
108 *
109 * @see https://www.w3.org/TR/activitypub/#liked
110 *
111 * @var string
112 */
113 protected $liked;
114
115 /**
116 * A list of supplementary Collections which may be of interest.
117 *
118 * @see https://www.w3.org/TR/activitypub/#streams-property
119 *
120 * @var array
121 */
122 protected $streams = array();
123
124 /**
125 * A short username which may be used to refer to the actor, with no
126 * uniqueness guarantees.
127 *
128 * @see https://www.w3.org/TR/activitypub/#preferredUsername
129 *
130 * @var string|null
131 */
132 protected $preferred_username;
133
134 /**
135 * A JSON object which maps additional typically server/domain-wide
136 * endpoints which may be useful either for this actor or someone
137 * referencing this actor. This mapping may be nested inside the
138 * actor document as the value or may be a link to a JSON-LD
139 * document with these properties.
140 *
141 * @see https://www.w3.org/TR/activitypub/#endpoints
142 *
143 * @var string|array|null
144 */
145 protected $endpoints;
146
147 /**
148 * It's not part of the ActivityPub protocol but it's a quite common
149 * practice to handle an actor public key with a publicKey array:
150 * [
151 * 'id' => 'https://my-example.com/actor#main-key'
152 * 'owner' => 'https://my-example.com/actor',
153 * 'publicKeyPem' => '-----BEGIN PUBLIC KEY-----
154 * MIIBI [...]
155 * DQIDAQAB
156 * -----END PUBLIC KEY-----'
157 * ]
158 *
159 * @see https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization#Signing_requests_using_HTTP_Signatures
160 *
161 * @var string|array|null
162 */
163 protected $public_key;
164
165 /**
166 * It's not part of the ActivityPub protocol but it's a quite common
167 * practice to lock an account. If anabled, new followers will not be
168 * automatically accepted, but will instead require you to manually
169 * approve them.
170 *
171 * WordPress does only support 'false' at the moment.
172 *
173 * @see https://docs.joinmastodon.org/spec/activitypub/#as
174 *
175 * @context as:manuallyApprovesFollowers
176 *
177 * @var boolean
178 */
179 protected $manually_approves_followers = false;
180
181 /**
182 * Used to mark an object as containing sensitive content.
183 * Mastodon displays a content warning, requiring users to click
184 * through to view the content.
185 *
186 * @see https://docs.joinmastodon.org/spec/activitypub/#sensitive
187 *
188 * @var boolean
189 */
190 protected $sensitive = null;
191
192 /**
193 * Domains allowed to use `fediverse:creator` for this actor in
194 * published articles.
195 *
196 * @see https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/
197 *
198 * @var array
199 */
200 protected $attribution_domains = null;
201 }
202