Skip to content

Conversation

@pfefferle
Copy link
Member

Fixes #2795

Proposed changes:

  • Send Add activity when a post is made sticky (added to featured collection)
  • Send Remove activity when a post is unstickied (removed from featured collection)
  • Keep existing Update activity for backwards compatibility

The activity format matches Mastodon's implementation:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Add",
  "actor": "https://example.com/author/1",
  "target": "https://example.com/wp-json/activitypub/1.0/actors/1/collections/featured",
  "object": "https://example.com/?p=123"
}

This improves interoperability with platforms like Bridgy Fed that expect these specific activities for featured collection changes.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  1. Create a post and publish it
  2. Make the post sticky (from Quick Edit or Post Editor)
  3. Check the outbox - should contain an Add activity with the featured collection as target
  4. Unstick the post
  5. Check the outbox - should contain a Remove activity with the featured collection as target

Changelog entry

Changelog entry already added manually.

When a post's sticky status changes, send Add or Remove activities
targeting the actor's featured collection. This improves interoperability
with platforms that expect these activities instead of (or in addition to)
a generic Update of the actor.

Fixes #2795
Copilot AI review requested due to automatic review settings January 21, 2026 07:48
@pfefferle pfefferle self-assigned this Jan 21, 2026
@pfefferle pfefferle requested a review from a team January 21, 2026 07:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds ActivityPub Add and Remove activities when a post's sticky status changes, improving interoperability with platforms like Bridgy Fed that expect these specific activities for featured collection changes.

Changes:

  • Send Add activity when a post is made sticky (added to featured collection)
  • Send Remove activity when a post is unstickied (removed from featured collection)
  • Maintain backwards compatibility by continuing to send Update activity for profile changes

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
includes/scheduler/class-actor.php Implements the new schedule_featured_add and schedule_featured_remove methods that create Add/Remove activities with the featured collection as target; refactors the sticky post handling to send these specific activities while maintaining backwards compatibility
tests/phpunit/tests/includes/scheduler/class-test-actor.php Adds comprehensive tests verifying that Add activities are created when sticking posts and Remove activities are created when unsticking posts, with proper verification of activity type, actor, object, and target fields
.github/changelog/add-featured-collection-activities Adds changelog entry documenting the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move Add/Remove activities for sticky posts from Actor scheduler to
Post scheduler since the activities are about posts. Keep the Actor
scheduler simple with just a profile update for backwards compatibility.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add WP_IMPORTING check to avoid activities during imports.
- Add is_post_disabled() check to respect federation settings.
- Document dual behavior with Actor scheduler Update activity.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pfefferle pfefferle merged commit 3e9bb55 into trunk Jan 22, 2026
10 checks passed
@pfefferle pfefferle deleted the add/featured-collection-activities branch January 22, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send Add/Remove activities when changing a post's sticky status

2 participants