Skip to content

Commit

Permalink
Have better checks if audience should be set or not (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle authored Nov 20, 2024
1 parent 6ec77cc commit ace8e4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public static function register_settings() {
array(
'type' => 'integer',
'description' => \__( 'Choose your preferred Actor-Mode.', 'activitypub' ),
'default' => '1',
'default' => ACTIVITYPUB_ACTOR_MODE,
)
);

Expand Down
8 changes: 5 additions & 3 deletions includes/transformer/class-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,14 @@ protected function get_cc() {
* @return string|null The audience.
*/
public function get_audience() {
if ( is_single_user() ) {
return null;
} else {
$actor_mode = \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE );

if ( ACTIVITYPUB_ACTOR_AND_BLOG_MODE === $actor_mode ) {
$blog = new Blog();
return $blog->get_id();
}

return null;
}

/**
Expand Down

0 comments on commit ace8e4a

Please sign in to comment.