-
Notifications
You must be signed in to change notification settings - Fork 83
Send Add/Remove activities when changing a post's sticky status #2802
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
Conversation
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
There was a problem hiding this 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
Addactivity when a post is made sticky (added to featured collection) - Send
Removeactivity when a post is unstickied (removed from featured collection) - Maintain backwards compatibility by continuing to send
Updateactivity 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.
There was a problem hiding this 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.
f9ba5a4 to
365fad7
Compare
There was a problem hiding this 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.
Fixes #2795
Proposed changes:
Addactivity when a post is made sticky (added to featured collection)Removeactivity when a post is unstickied (removed from featured collection)Updateactivity for backwards compatibilityThe 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:
Testing instructions:
Addactivity with the featured collection as targetRemoveactivity with the featured collection as targetChangelog entry
Changelog entry already added manually.