MastoAPI: Add categories to custom emojis

Note: This isn’t in a release yet, can be seen in mastofe on the
rebase/glitch-soc branch.
This commit is contained in:
Haelwenn (lanodan) Monnier 2019-06-30 01:05:28 +02:00
parent b972b972e0
commit 252e129b1e
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
3 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,7 @@ Configuration: `federation_incoming_replies_max_depth` option
- Admin API: Allow querying user by ID
- Added synchronization of following/followers counters for external users
- Configuration: `enabled` option for `Pleroma.Emails.Mailer`, defaulting to `false`.
- Mastodon API: Add support for categories for custom emojis by reusing the group feature. <https://github.com/tootsuite/mastodon/pull/11196>
## [1.0.0] - 2019-06-29
### Security

View File

@ -299,7 +299,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
"static_url" => url,
"visible_in_picker" => true,
"url" => url,
"tags" => tags
"tags" => tags,
# Assuming that a comma is authorized in the category name
"category" => (tags -- ["Custom"]) |> Enum.join(",")
}
end)
end

View File

@ -2958,6 +2958,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert Map.has_key?(emoji, "static_url")
assert Map.has_key?(emoji, "tags")
assert is_list(emoji["tags"])
assert Map.has_key?(emoji, "category")
assert Map.has_key?(emoji, "url")
assert Map.has_key?(emoji, "visible_in_picker")
end