Skip to content

Conversation

pfefferle
Copy link
Member

@pfefferle pfefferle commented Oct 17, 2025

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:

  • 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

Other information:

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

Testing instructions:

  • Go to '..'

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

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.
Copy link

@Copilot 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 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.

pfefferle and others added 4 commits October 17, 2025 15:17
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.
@Jiwoon-Kim
Copy link
Contributor

Jiwoon-Kim commented Oct 17, 2025

What do you think of this idea?

When a QuoteRequest activity is received, it’s stored in the wp_comment table with comment_type=QuoteRequest and comment_status=moderated.
When the comment is approved, an Accept activity is triggered.
This method is also used to display the quote count.

In the case of Misskey quotes, when the quoteUri property exists, it indicates that the post has been quoted — however, it isn’t reflected in the quote count.

https://docs.akkoma.dev/stable/development/ap_extensions/#quote-posts

Old Misskey only understood and modern Misskey still prefers the _misskey_quote property for this. Similar some other older software used quoteUrl or quoteURL.
All current implementations with quote support understand quoteUri.

To quote a Misskey note in WordPress, the quoteUri property must be supported.
Since FEP-044f has been implemented, notifications can be received when detected, but quoting is not possible.

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.

2 participants