Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Jan 22, 2026

Fixes #2816

Screenshot 2026-01-22 at 20 25 56

Proposed changes:

  • Show a warning message instead of the reply link when a logged-in user without ActivityPub capability tries to reply to a fediverse comment.
  • Unify are_comments_allowed() and should_be_federated() to both use user_can( $user_id, 'activitypub' ) instead of the inconsistent publish_posts check.

Other information:

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

Testing instructions:

  • Create a comment from the fediverse (e.g., reply to a post from Mastodon)
  • Log in as a user WITHOUT activitypub capability (e.g., subscriber role)
  • View the fediverse comment - should see warning "Your account is not able to reply to fediverse comments."
  • Log in as a user WITH activitypub capability (e.g., editor role)
  • View the same fediverse comment - should see normal reply link
  • Log out and view the comment - should see remote reply block

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Added - for new features

Message

Show warning instead of reply link when logged-in user cannot federate replies to fediverse comments.

Copilot AI review requested due to automatic review settings January 22, 2026 18:15
@pfefferle pfefferle self-assigned this Jan 22, 2026
@pfefferle pfefferle requested a review from a team January 22, 2026 18:15
Copy link

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 improves the user experience by showing a clear warning message when logged-in users without ActivityPub capability attempt to reply to fediverse comments, preventing confusion where replies would silently fail to federate.

Changes:

  • Added warning message for logged-in users without ActivityPub capability when viewing fediverse comments
  • Updated documentation to clarify the three handling cases for fediverse comment replies
  • Added comprehensive test coverage for local comments, fediverse comments with capable users, fediverse comments with non-capable users, and non-logged-in users

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
includes/class-comment.php Implements the warning message logic for logged-in users without federation capability, with proper escaping and an extensibility filter
tests/phpunit/tests/includes/class-test-comment.php Adds four comprehensive test cases covering all scenarios: local comments, capable users, non-capable users, and non-logged-in users
.github/changelog/2816-from-description Documents the change as a patch-level addition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pfefferle pfefferle force-pushed the add/federation-warning-for-replies branch 3 times, most recently from bfa97e2 to 9f8327c Compare January 22, 2026 19:22
- When a logged-in user without ActivityPub capability tries to reply to a
  fediverse comment, show a warning message instead of the reply link.
- Unify `are_comments_allowed()` and `should_be_federated()` to both use
  `user_can( $user_id, 'activitypub' )` instead of inconsistent `publish_posts`.
- Added tests for all three comment reply link cases.

Fixes #2816
@pfefferle pfefferle force-pushed the add/federation-warning-for-replies branch from 9f8327c to 07c72b0 Compare January 22, 2026 19:23
@pfefferle
Copy link
Member Author

@davemart-in @robertbpugh @jeherve I would love to have your feedback on the message. See screenshot? Can you think of a shorter one? Is it fine like it is?

@davemart-in
Copy link

Thoughts on something like:

This reply won’t be sent to the fediverse.
Enable ActivityPub for your account to reply to fediverse comments.

@pfefferle
Copy link
Member Author

Yes! (Sorry for the missing context)

@jeherve
Copy link
Member

jeherve commented Jan 23, 2026

This reply won’t be sent to the fediverse.
Enable ActivityPub for your account to reply to fediverse comments.

Should we add a mention that the author will consequently not receive a notification of your reply? Since we have $comment available we could even make that message a bit more dynamic. Something like:

Your reply won’t be sent to the fediverse ; $comment_author will not be notified of your reply.
Enable ActivityPub for your account to reply to fediverse comments.

@pfefferle
Copy link
Member Author

@jeherve Ah, I misread the comment of @davemart-in ! The message replaces the link completely, so it is not even possible to send a reply!

I think it makes no sense to have local replies to comments from the fediverse because this would confuse people even more.

@github-actions github-actions bot added the [Focus] Compatibility Ensuring the plugin plays well with other plugins label Jan 23, 2026
@pfefferle pfefferle force-pushed the add/federation-warning-for-replies branch from 3d911e1 to 457edc4 Compare January 23, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Compatibility Ensuring the plugin plays well with other plugins [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show warning when user without ActivityPub capability replies to fediverse comments

4 participants