-
Notifications
You must be signed in to change notification settings - Fork 85
Add support for quote comments and improve quote detection #2330
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
base: trunk
Are you sure you want to change the base?
Conversation
Introduces a new 'quote' comment type, updates interaction handling to extract and process quote links from content, and enhances reply detection to recognize quote-inline patterns. Includes comprehensive tests for quote extraction and reply identification.
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 introduces support for quote comments in the ActivityPub plugin by adding detection and handling of quote-inline patterns commonly used by Mastodon and other Fediverse platforms. It enhances the reply detection system to recognize quote patterns and processes them as a new comment type.
- Adds a new 'quote' comment type with appropriate metadata and translations
- Implements quote link extraction from HTML content with regex pattern matching
- Enhances reply detection to recognize quote-inline patterns in addition to standard inReplyTo properties
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/phpunit/tests/includes/collection/class-test-interactions.php | Adds comprehensive tests for quote link extraction and quote comment creation |
tests/phpunit/tests/includes/class-test-functions.php | Adds tests for enhanced reply detection including quote-inline pattern recognition |
includes/functions.php | Updates is_activity_reply function to detect quote-inline patterns |
includes/collection/class-interactions.php | Implements extract_quote_link method and integrates quote handling into comment creation |
includes/class-comment.php | Registers new 'quote' comment type and updates descriptions for existing comment types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Split the validation in add_comment() to separately check for valid comment data and the presence of 'inReplyTo'. This improves code clarity and ensures early return if comment data is invalid.
Introduces a 'display_style' property to comment type definitions, distinguishing between 'facepile' and 'comment' display styles. Adds helper methods to check if a comment type should be shown as a facepile and to retrieve all facepile types, enabling more flexible comment rendering.
What do you think of this idea? When a QuoteRequest activity is received, it’s stored in the In the case of Misskey quotes, when the https://docs.akkoma.dev/stable/development/ap_extensions/#quote-posts
|
Introduces a new 'quote' comment type, updates interaction handling to extract and process quote links from content, and enhances reply detection to recognize quote-inline patterns. Includes comprehensive tests for quote extraction and reply identification.
supersedes #2303
Proposed changes:
Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message