Skip to content

Conversation

pfefferle
Copy link
Member

Fixes #

Proposed changes:

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

Replaces direct metadata fetching with Remote_Actors::fetch_by_uri in Mention class methods. Updates logic for resolving actor URLs and inboxes, and adjusts test mocks and filters to match the new approach. This change improves consistency and leverages the Remote_Actors abstraction for remote actor data handling.
Replaces direct calls to get_remote_metadata_by_actor with Remote_Actors::fetch_by_uri and updates usage throughout Interactions. Updates tests to use the 'activitypub_pre_http_get_remote_object' filter instead of 'pre_get_remote_metadata_by_actor'. Also improves handling of actor data and short ternary usage for compatibility with coding standards.
@pfefferle pfefferle changed the title Replace Replace get_remote_metadata_by_actor with Remote_Actors::fetch_by_uri Sep 23, 2025
@pfefferle pfefferle requested a review from Copilot September 23, 2025 09:33
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 replaces the deprecated get_remote_metadata_by_actor function with the new Remote_Actors::fetch_by_uri method, updating the ActivityPub system to use a more consistent actor fetching mechanism.

  • Updates all filter hooks from pre_get_remote_metadata_by_actor to activitypub_pre_http_get_remote_object
  • Refactors code to use Remote_Actors::fetch_by_uri() instead of the deprecated function
  • Updates test data structures to include required fields like type and inbox

Reviewed Changes

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

Show a summary per file
File Description
tests/includes/collection/class-test-interactions.php Updates test hooks and mock data to use new actor fetching system
tests/includes/class-test-mention.php Updates test setup to use new filter hook
includes/collection/class-remote-actors.php Changes null coalescing operator to short ternary for actor name handling
includes/collection/class-interactions.php Refactors to use Remote_Actors class instead of deprecated function
includes/class-mention.php Updates mention processing to use new actor fetching mechanism

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Simplifies mention link rendering by using the matched username directly. Adds support in Remote_Actors::fetch_by_uri to resolve usernames to actor URIs using Webfinger, improving actor lookup reliability.
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.

1 participant