Skip to content

Conversation

obenland
Copy link
Member

Fixes #1001.

Proposed changes:

  • Creates an Announce outbox item for every incoming comment.

Testing instructions:

  • Apply this change to a WP test site that's accessible online.
  • Comment on a post from a fediverse instance of your choice.
  • Check the Outbox and make sure it created an Announce activity.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Incoming comments create an Announce activity so other instances get notified about it.

@obenland obenland requested a review from a team March 27, 2025 16:52
@obenland obenland self-assigned this Mar 27, 2025
@obenland
Copy link
Member Author

I guess this could create quite a bit of load on sites with lots of followers that comment a lot. Is that something we need to be concerned about?

@db0
Copy link

db0 commented Mar 28, 2025

If @obenland comment is a concern, maybe a switch to turn it off.

Comment on lines +83 to +85
/* @ticket https://github.com/Automattic/wordpress-activitypub/issues/1001 */
add_to_outbox( $activity, 'Announce', $user_id, ACTIVITYPUB_CONTENT_VISIBILITY_PUBLIC );

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.


namespace Activitypub\Handler;

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;

@obenland
Copy link
Member Author

Closing for now until we have a better understanding what's needed here. See #1001 (comment)

@obenland obenland closed this Mar 28, 2025
@pfefferle pfefferle reopened this Mar 28, 2025
@pfefferle
Copy link
Member

Let's keep it open and set to WIP instead!

@pfefferle pfefferle marked this pull request as draft March 28, 2025 15:19
@pfefferle
Copy link
Member

@obenland have you tested it with the changes I suggested?

@pfefferle
Copy link
Member

We would also need to respect the moderation queue and only announce reactions that are published on the blog.

pfefferle added a commit that referenced this pull request Apr 10, 2025
@pfefferle
Copy link
Member

closed in favour of #1562

@pfefferle pfefferle closed this Apr 10, 2025
@obenland obenland deleted the add/comment-announce branch April 11, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comments left by mastodon do not get pushed to lemmy
4 participants