mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Move finmojis to representation.
This commit is contained in:
parent
66b4fee80e
commit
45c751985e
2 changed files with 2 additions and 2 deletions
|
@ -4,6 +4,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
||||||
alias Pleroma.{Activity, User}
|
alias Pleroma.{Activity, User}
|
||||||
alias Calendar.Strftime
|
alias Calendar.Strftime
|
||||||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||||
|
alias Pleroma.Formatter
|
||||||
|
|
||||||
defp user_by_ap_id(user_list, ap_id) do
|
defp user_by_ap_id(user_list, ap_id) do
|
||||||
Enum.find(user_list, fn (%{ap_id: user_id}) -> ap_id == user_id end)
|
Enum.find(user_list, fn (%{ap_id: user_id}) -> ap_id == user_id end)
|
||||||
|
@ -92,7 +93,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
||||||
"id" => activity.id,
|
"id" => activity.id,
|
||||||
"user" => UserRepresenter.to_map(user, opts),
|
"user" => UserRepresenter.to_map(user, opts),
|
||||||
"attentions" => [],
|
"attentions" => [],
|
||||||
"statusnet_html" => HtmlSanitizeEx.basic_html(content),
|
"statusnet_html" => HtmlSanitizeEx.basic_html(content) |> Formatter.finmojifiy,
|
||||||
"text" => HtmlSanitizeEx.strip_tags(content),
|
"text" => HtmlSanitizeEx.strip_tags(content),
|
||||||
"is_local" => true,
|
"is_local" => true,
|
||||||
"is_post_verb" => true,
|
"is_post_verb" => true,
|
||||||
|
|
|
@ -22,7 +22,6 @@ defmodule Pleroma.Web.TwitterAPI.Utils do
|
||||||
|> Formatter.linkify
|
|> Formatter.linkify
|
||||||
|> String.replace("\n", "<br>\n")
|
|> String.replace("\n", "<br>\n")
|
||||||
|> add_user_links(mentions)
|
|> add_user_links(mentions)
|
||||||
|> Formatter.finmojifiy
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_user_links(text, mentions) do
|
def add_user_links(text, mentions) do
|
||||||
|
|
Loading…
Reference in a new issue