-
Notifications
You must be signed in to change notification settings - Fork 82
Interactions: Don't show likes and reposts for comments #1735
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
Add failing test
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 PR fixes issue #1498 by preventing the collection of likes and reposts for comments. The changes include updates to the reaction processing logic in the Interactions class and added unit tests to verify that likes and reposts for comments are not collected.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/includes/collection/class-test-interactions.php | Added new test (test_add_like_to_comment) and updated references to the WP_UnitTestCase class |
includes/collection/class-interactions.php | Refactored add_reaction logic to check for valid post IDs and prevent reactions tied to comments |
Comments suppressed due to low confidence (1)
includes/collection/class-interactions.php:95
- [nitpick] The inline comment 'Not a reply to a post.' could be clarified to indicate that reactions to comments are intentionally not processed. Consider updating the comment to explicitly reference that likes and reposts for comments are ignored.
if ( ! $comment_post_id || is_post_disabled( $comment_post_id ) ) {
Why shouldn't we collect them? I think this is more an issue of how we show the reactions for the output as a storing/collecting issue. Even if we merge this PR, I think we also have to improve the output by ignoring all reactions that have a |
Yeah that's a good point, maybe we should start there. We should probably also check wording in the notification email |
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.
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
$parent_comment = \get_comment( $comment->comment_parent ); | ||
$notify_message = \sprintf( | ||
/* translators: 1: Comment type, 2: Post title, 3: Parent comment author */ | ||
\html_entity_decode( esc_html__( 'New %1$s on your post “%2$s” in reply to %3$s’s comment.', 'activitypub' ) ), | ||
\esc_html( $comment_type['singular'] ), | ||
\esc_html( $post->post_title ), | ||
\esc_html( $parent_comment->comment_author ) | ||
) . PHP_EOL . PHP_EOL; | ||
} |
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.
should we simply skip the else mail, because we do not show them yet?
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.
They're no longer shown in the frontend but they still get saved and are visible in the Comments list. They'll probably also require moderation (although I've not tested that). I'm not sure if it would be more or less confusing to notify about them, tbh. What do you think?
Fixes #1498.
Proposed changes:
0
when querying for reactions.Other information:
Testing instructions:
After
Changelog entry
Changelog Entry Details
Significance
Type
Message
Likes and Reposts for comments to a post are no longer attributed to the post itself.