Skip to content
Snippets Groups Projects
Commit 64bc38e0 authored by Roger Braun's avatar Roger Braun
Browse files

MastoAPI: Add emoji output.

parent 38f3908c
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
reply_to = Activity.get_create_activity_by_object_ap_id(object["inReplyTo"])
reply_to_user = reply_to && User.get_cached_by_ap_id(reply_to.data["actor"])
emojis = (activity.data["object"]["emoji"] || [])
|> Enum.map(fn {name, url} -> %{ shortcode: name, url: url, static_url: url } end)
%{
id: activity.id,
uri: object["id"],
......@@ -99,7 +102,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
name: "Web",
website: nil
},
language: nil
language: nil,
emojis: emojis
}
end
......
......@@ -26,7 +26,10 @@ defmodule Pleroma.Factory do
"likes" => [],
"like_count" => 0,
"context" => "2hu",
"tag" => ["2hu"]
"tag" => ["2hu"],
"emoji" => %{
"2hu" => "corndog.png"
}
}
%Pleroma.Object{
......
......@@ -41,7 +41,14 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
name: "Web",
website: nil
},
language: nil
language: nil,
emojis: [
%{
shortcode: "2hu",
url: "corndog.png",
static_url: "corndog.png"
}
]
}
assert status == expected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment