Skip to content
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

Emoji: First pass at support in Interactions #1129

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

obenland
Copy link
Member

@obenland obenland commented Jan 7, 2025

Should we sideload emoji images?

Fixes #970.

See https://mastodon.social/@obenland/113788023027390776
See https://obietester.blog/2025/01/06/99/#comment-31

Proposed changes:

  • Adds callback function that replaces custom emoji strings with their image representations when available.
  • Adds unit test to cover the new function.
  • Runs author name and comment content through the new callback on insert and update.

Other information:

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

Testing instructions:

  • Go to Mastodon, for example, and reply to a federated test post with a custom emoji. :yikes:, :AngeryCat:, etc.
  • Go to the comment list in wp-admin and make sure the emoji render as images.

@obenland obenland requested review from jeherve and a team January 7, 2025 17:32
@obenland obenland self-assigned this Jan 7, 2025
@pfefferle
Copy link
Member

I think before allowing images in comments, we have to think about/implement a proper blocking and moderation tooling (even more if it is about side-loading images): https://www.theverge.com/2023/7/24/23806093/mastodon-csam-study-decentralized-network

@obenland
Copy link
Member Author

I just pushed an update that moves the replacement into a filter that runs after comment_content and the author have been sanitized. That way, only custom emoji images will be added to the content.

@jeherve
Copy link
Member

jeherve commented Jan 13, 2025

Heads up: This PR adds img tags to the list of allowed HTML tags for Interactions!

Would sideloading the image onto the site with media_sideload_image be helpful here?

  • It would ensure the images remain available in the future.
  • It would avoid image hotlinking, which can be frowned upon.
  • It would add some validation to the image data before to simply display it on the site.

Of course, we'd need to be okay adding potentially a lot of new media to a site once that's enabled. I'm not sure that's okay.

@obenland
Copy link
Member Author

It would avoid image hotlinking, which can be frowned upon.

With custom emoji being shared tags, is that not kind of expected?

@jeherve
Copy link
Member

jeherve commented Jan 14, 2025

With custom emoji being shared tags, is that not kind of expected?

I'm honestly not sure what the common practice is with other Fediverse software. From what I can tell, on Mastodon and on GoToSocial the images from remote instances seem to be cached on the local server:

GoToSocial:

image

Mastodon

image

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.

Federated comments: Fediverse handles including custom emoticons are displayed in plain text
3 participants