Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions .github/changelog/1515-from-description
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Incoming comments create an Announce activity so other instances get notified about it.
4 changes: 4 additions & 0 deletions includes/handler/class-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Activitypub\Collection\Interactions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use Activitypub\Collection\Interactions;
use Activitypub\Collection\Actors;
use Activitypub\Collection\Interactions;


use function Activitypub\add_to_outbox;
use function Activitypub\is_self_ping;
use function Activitypub\is_activity_reply;
use function Activitypub\is_activity_public;
Expand Down Expand Up @@ -79,6 +80,9 @@ public static function handle_create( $activity, $user_id, $activity_object = nu
$reaction = \get_comment( $state );
}

/* @ticket https://github.com/Automattic/wordpress-activitypub/issues/1001 */
add_to_outbox( $activity, 'Announce', $user_id, ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC );

Comment on lines +83 to +85
Copy link
Member

@pfefferle pfefferle Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes only sense if you use the ACTIVITYPUB_ACTOR_AND_BLOG_MODE and the Announce should always done by the Blog-User.

Suggested change
/* @ticket https://github.com/Automattic/wordpress-activitypub/issues/1001 */
add_to_outbox( $activity, 'Announce', $user_id, ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC );
/* @ticket https://github.com/Automattic/wordpress-activitypub/issues/1001 */
if ( ACTIVITYPUB_ACTOR_AND_BLOG_MODE === \get_option( 'activitypub_actor_mode' ) ) {
add_to_outbox( $activity, 'Announce', Actors::BLOG_USER_ID, ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC );
}

I would also recommend to only boost the Object-ID URL instead of the complete Activity. Not sure though if that is enough information.

/**
* Fires after a Create activity has been handled.
*
Expand Down
Loading