Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have better checks if audience should be set or not #1002

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
have better checks if audience should be set or not
pfefferle committed Nov 18, 2024
commit 576303adb32a26796ae35d1bce1924395dabd5a8
2 changes: 1 addition & 1 deletion includes/class-admin.php
Original file line number Diff line number Diff line change
@@ -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,
)
);

8 changes: 5 additions & 3 deletions includes/transformer/class-post.php
Original file line number Diff line number Diff line change
@@ -783,12 +783,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;
}

/**