@@ -83,7 +83,10 @@ public function get_content_visibility() {
83
83
*/
84
84
public function get_interaction_policy () {
85
85
return array (
86
- 'canQuote ' => $ this ->get_quote_policy (),
86
+ 'canAnnounce ' => $ this ->get_public_interaction_policy (),
87
+ 'canLike ' => $ this ->get_public_interaction_policy (),
88
+ 'canQuote ' => $ this ->get_quote_policy (),
89
+ 'canReply ' => $ this ->get_public_interaction_policy (),
87
90
);
88
91
}
89
92
@@ -975,22 +978,31 @@ private function get_quote_policy() {
975
978
return array ( 'automaticApproval ' => get_rest_url_by_path ( sprintf ( 'actors/%d/followers ' , $ this ->item ->post_author ) ) );
976
979
977
980
case ACTIVITYPUB_INTERACTION_POLICY_ME :
978
- return array ( 'automaticApproval ' => $ this ->get_me_actors () );
981
+ return array ( 'automaticApproval ' => $ this ->get_self_interaction_policy () );
979
982
980
983
default :
981
- return array (
982
- 'automaticApproval ' => 'https://www.w3.org/ns/activitystreams#Public ' ,
983
- 'always ' => 'https://www.w3.org/ns/activitystreams#Public ' ,
984
- );
984
+ return $ this ->get_public_interaction_policy ();
985
985
}
986
986
}
987
987
988
988
/**
989
- * Get the actor ID(s) for the `me` audience in the Quote interaction policy.
989
+ * Get the public interaction policy.
990
+ *
991
+ * @return array The public interaction policy.
992
+ */
993
+ private function get_public_interaction_policy () {
994
+ return array (
995
+ 'automaticApproval ' => 'https://www.w3.org/ns/activitystreams#Public ' ,
996
+ 'always ' => 'https://www.w3.org/ns/activitystreams#Public ' ,
997
+ );
998
+ }
999
+
1000
+ /**
1001
+ * Get the actor ID(s) for the `me` audience for use in interaction policies.
990
1002
*
991
1003
* @return string|array The actor ID(s).
992
1004
*/
993
- private function get_me_actors () {
1005
+ private function get_self_interaction_policy () {
994
1006
switch ( \get_option ( 'activitypub_actor_mode ' , ACTIVITYPUB_ACTOR_MODE ) ) {
995
1007
case ACTIVITYPUB_BLOG_MODE :
996
1008
return ( new Blog () )->get_id ();
0 commit comments