Skip to content

Commit db698ad

Browse files
authored
Application Actor: Set manuallyApprovesFollowers property to true (#2113)
1 parent 5ff39c4 commit db698ad

File tree

3 files changed

+50
-30
lines changed

3 files changed

+50
-30
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Improved ActivityPub compatibility by aligning with Mastodon’s Application Actor.

includes/activity/class-actor.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Actor extends Base_Object {
2727
'schema' => 'http://schema.org#',
2828
'toot' => 'http://joinmastodon.org/ns#',
2929
'lemmy' => 'https://join-lemmy.org/ns#',
30+
'litepub' => 'http://litepub.social/ns#',
3031
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
3132
'PropertyValue' => 'schema:PropertyValue',
3233
'value' => 'schema:value',
@@ -63,6 +64,7 @@ class Actor extends Base_Object {
6364
'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods',
6465
'discoverable' => 'toot:discoverable',
6566
'indexable' => 'toot:indexable',
67+
'invisible' => 'litepub:invisible',
6668
),
6769
);
6870

@@ -312,4 +314,13 @@ class Actor extends Base_Object {
312314
* @var array
313315
*/
314316
protected $implements;
317+
318+
/**
319+
* Whether the User is invisible.
320+
*
321+
* @see https://litepub.social/
322+
*
323+
* @var boolean
324+
*/
325+
protected $invisible = null;
315326
}

includes/model/class-application.php

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Application extends Actor {
3333
*
3434
* @context http://joinmastodon.org/ns#discoverable
3535
*
36-
* @var boolean
36+
* @var bool
3737
*/
3838
protected $discoverable = false;
3939

@@ -42,10 +42,21 @@ class Application extends Actor {
4242
*
4343
* @context http://joinmastodon.org/ns#indexable
4444
*
45-
* @var boolean
45+
* @var bool
4646
*/
4747
protected $indexable = false;
4848

49+
/**
50+
* Whether the Application manually approves followers.
51+
*
52+
* @see https://docs.joinmastodon.org/spec/activitypub/#as
53+
*
54+
* @context as:manuallyApprovesFollowers
55+
*
56+
* @var bool
57+
*/
58+
protected $manually_approves_followers = true;
59+
4960
/**
5061
* List of software capabilities implemented by the Application.
5162
*
@@ -61,22 +72,34 @@ class Application extends Actor {
6172
);
6273

6374
/**
64-
* Returns the type of the object.
75+
* Set Application as invisible.
76+
*
77+
* @see https://litepub.social/
78+
*
79+
* @var bool
80+
*/
81+
protected $invisible = true;
82+
83+
/**
84+
* The type of the Actor.
6585
*
66-
* @return string The type of the object.
86+
* @var string
6787
*/
68-
public function get_type() {
69-
return 'Application';
70-
}
88+
protected $type = 'Application';
7189

7290
/**
73-
* Returns whether the Application manually approves followers.
91+
* The Username.
7492
*
75-
* @return true Whether the Application manually approves followers.
93+
* @var string
7694
*/
77-
public function get_manually_approves_followers() {
78-
return true;
79-
}
95+
protected $name = 'application';
96+
97+
/**
98+
* The preferred username.
99+
*
100+
* @var string
101+
*/
102+
protected $preferred_username = 'application';
80103

81104
/**
82105
* Returns the ID of the Application.
@@ -105,24 +128,6 @@ public function get_alternate_url() {
105128
return $this->get_id();
106129
}
107130

108-
/**
109-
* Get the Username.
110-
*
111-
* @return string The Username.
112-
*/
113-
public function get_name() {
114-
return 'application';
115-
}
116-
117-
/**
118-
* Get the preferred username.
119-
*
120-
* @return string The preferred username.
121-
*/
122-
public function get_preferred_username() {
123-
return $this->get_name();
124-
}
125-
126131
/**
127132
* Get the User-Icon.
128133
*

0 commit comments

Comments
 (0)