Federate emoji as anonymous objects
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build-amd64 Pipeline was successful
ci/woodpecker/pr/build-arm64 Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful

Usually an id should point to another AP object
and the image file isn’t an AP object. We currently
do not provide standalone AP objects for emoji and
don't keep track of remote emoji at all.
Thus just federate them as anonymous objects,
i.e. objects only existing within a parent context
and using an explicit null id.

IceShrimp.NET previously adopted anonymous objects
for remote emoji without any apparent issues. See:
333611f65e

Fixes: #694
This commit is contained in:
Oneric 2024-06-23 20:46:58 +02:00
parent 4f0cb61782
commit 4ff5293093
4 changed files with 5 additions and 3 deletions

View file

@ -17,6 +17,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Fixed ## Fixed
- Meilisearch: order of results returned from our REST API now actually matches how Meilisearch ranks results - Meilisearch: order of results returned from our REST API now actually matches how Meilisearch ranks results
- Emoji are now federated as anonymous objects, fixing issues with
some strict servers e.g. rejecting e.g. remote emoji reactions
## Changed ## Changed
- Refactored Rich Media to cache the content in the database. Fetching operations that could block status rendering have been eliminated. - Refactored Rich Media to cache the content in the database. Fetching operations that could block status rendering have been eliminated.

View file

@ -951,7 +951,7 @@ defp build_emoji_tag({name, url}) do
"name" => ":" <> name <> ":", "name" => ":" <> name <> ":",
"type" => "Emoji", "type" => "Emoji",
"updated" => "1970-01-01T00:00:00Z", "updated" => "1970-01-01T00:00:00Z",
"id" => url "id" => nil
} }
end end

View file

@ -700,7 +700,7 @@ test "take_emoji_tags/1" do
assert Transmogrifier.take_emoji_tags(user) == [ assert Transmogrifier.take_emoji_tags(user) == [
%{ %{
"icon" => %{"type" => "Image", "url" => "https://example.org/firefox.png"}, "icon" => %{"type" => "Image", "url" => "https://example.org/firefox.png"},
"id" => "https://example.org/firefox.png", "id" => nil,
"name" => ":firefox:", "name" => ":firefox:",
"type" => "Emoji", "type" => "Emoji",
"updated" => "1970-01-01T00:00:00Z" "updated" => "1970-01-01T00:00:00Z"

View file

@ -43,7 +43,7 @@ test "Renders with emoji tags" do
"tag" => [ "tag" => [
%{ %{
"icon" => %{"type" => "Image", "url" => "/test"}, "icon" => %{"type" => "Image", "url" => "/test"},
"id" => "/test", "id" => nil,
"name" => ":bib:", "name" => ":bib:",
"type" => "Emoji", "type" => "Emoji",
"updated" => "1970-01-01T00:00:00Z" "updated" => "1970-01-01T00:00:00Z"