projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credo fixes: alias grouping/ordering
[akkoma]
/
lib
/
pleroma
/
web
/
twitter_api
/
representers
/
activity_representer.ex
diff --git
a/lib/pleroma/web/twitter_api/representers/activity_representer.ex
b/lib/pleroma/web/twitter_api/representers/activity_representer.ex
index 19b723586bd804f8382156594ad469d2531b6147..a5fec88f7286330f6443b88ea12905c2c864d30a 100644
(file)
--- a/
lib/pleroma/web/twitter_api/representers/activity_representer.ex
+++ b/
lib/pleroma/web/twitter_api/representers/activity_representer.ex
@@
-7,11
+7,10
@@
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
use Pleroma.Web.TwitterAPI.Representers.BaseRepresenter
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
- alias Pleroma.{Activity, User}
- alias Pleroma.Web.TwitterAPI.{
TwitterAPI, UserView, Activity
View}
+ alias Pleroma.{Activity,
Formatter, HTML,
User}
+ alias Pleroma.Web.TwitterAPI.{
ActivityView, TwitterAPI, User
View}
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.CommonAPI.Utils
- alias Pleroma.Formatter
- alias Pleroma.HTML
+ alias Pleroma.Web.MastodonAPI.StatusView
defp user_by_ap_id(user_list, ap_id) do
Enum.find(user_list, fn %{ap_id: user_id} -> ap_id == user_id end)
defp user_by_ap_id(user_list, ap_id) do
Enum.find(user_list, fn %{ap_id: user_id} -> ap_id == user_id end)
@@
-186,6
+185,12
@@
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
summary = HTML.strip_tags(object["summary"])
summary = HTML.strip_tags(object["summary"])
+ card =
+ StatusView.render(
+ "card.json",
+ Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
+ )
+
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
@@
-214,7
+219,8
@@
defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
"summary" => summary,
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
"summary" => summary,
- "summary_html" => summary |> Formatter.emojify(object["emoji"])
+ "summary_html" => summary |> Formatter.emojify(object["emoji"]),
+ "card" => card
}
end
}
end