projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update dependencies
[akkoma]
/
lib
/
pleroma
/
web
/
static_fe
/
static_fe_controller.ex
diff --git
a/lib/pleroma/web/static_fe/static_fe_controller.ex
b/lib/pleroma/web/static_fe/static_fe_controller.ex
index 5027d5c233158c115519fae03e57864896fb2d8e..687b17df6c18e67fa5441c031e6f4df71d1e0edf 100644
(file)
--- a/
lib/pleroma/web/static_fe/static_fe_controller.ex
+++ b/
lib/pleroma/web/static_fe/static_fe_controller.ex
@@
-17,8
+17,8
@@
defmodule Pleroma.Web.StaticFE.StaticFEController do
plug(:put_view, Pleroma.Web.StaticFE.StaticFEView)
plug(:assign_id)
plug(:put_view, Pleroma.Web.StaticFE.StaticFEView)
plug(:assign_id)
- plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
- unless_func: &Pleroma.Web.
FederatingPlug.federating?/0
+ plug(Pleroma.
Web.
Plugs.EnsureAuthenticatedPlug,
+ unless_func: &Pleroma.Web.
Plugs.FederatingPlug.federating?/1
)
@page_keys ["max_id", "min_id", "limit", "since_id", "order"]
)
@page_keys ["max_id", "min_id", "limit", "since_id", "order"]
@@
-58,10
+58,19
@@
defmodule Pleroma.Web.StaticFE.StaticFEController do
_ -> data["url"] || data["external_url"] || data["id"]
end
_ -> data["url"] || data["external_url"] || data["id"]
end
+ content =
+ if data["content"] do
+ data["content"]
+ |> Pleroma.HTML.filter_tags()
+ |> Pleroma.Emoji.Formatter.emojify(Map.get(data, "emoji", %{}))
+ else
+ nil
+ end
+
%{
%{
- user:
user
,
+ user:
User.sanitize_html(user)
,
title: get_title(activity.object),
title: get_title(activity.object),
- content:
data["content"] || nil
,
+ content:
content
,
attachment: data["attachment"],
link: link,
published: data["published"],
attachment: data["attachment"],
link: link,
published: data["published"],
@@
-102,8
+111,14
@@
defmodule Pleroma.Web.StaticFE.StaticFEController do
%User{} = user ->
meta = Metadata.build_tags(%{user: user})
%User{} = user ->
meta = Metadata.build_tags(%{user: user})
+ params =
+ params
+ |> Map.take(@page_keys)
+ |> Map.new(fn {k, v} -> {String.to_existing_atom(k), v} end)
+
timeline =
timeline =
- ActivityPub.fetch_user_activities(user, nil, Map.take(params, @page_keys))
+ user
+ |> ActivityPub.fetch_user_activities(nil, params)
|> Enum.map(&represent/1)
prev_page_id =
|> Enum.map(&represent/1)
prev_page_id =
@@
-113,7
+128,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEController do
next_page_id = List.last(timeline) && List.last(timeline).id
render(conn, "profile.html", %{
next_page_id = List.last(timeline) && List.last(timeline).id
render(conn, "profile.html", %{
- user:
user
,
+ user:
User.sanitize_html(user)
,
timeline: timeline,
prev_page_id: prev_page_id,
next_page_id: next_page_id,
timeline: timeline,
prev_page_id: prev_page_id,
next_page_id: next_page_id,