projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'bugfix/sensitive_object' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
status_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/status_view.ex
b/lib/pleroma/web/mastodon_api/views/status_view.ex
index ba40fd63ee646b1a0eafd03bebfa8fab6ee676ce..24167f66f76f4f8a614b8dbc6439ee2456692b4e 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/status_view.ex
@@
-45,7
+45,7
@@
defmodule Pleroma.Web.MastodonAPI.StatusView do
end)
end
end)
end
- def
p get_user(ap_id
) do
+ def
get_user(ap_id, fake_record_fallback \\ true
) do
cond do
user = User.get_cached_by_ap_id(ap_id) ->
user
cond do
user = User.get_cached_by_ap_id(ap_id) ->
user
@@
-53,8
+53,12
@@
defmodule Pleroma.Web.MastodonAPI.StatusView do
user = User.get_by_guessed_nickname(ap_id) ->
user
user = User.get_by_guessed_nickname(ap_id) ->
user
- true ->
+ fake_record_fallback ->
+ # TODO: refactor (fake records is never a good idea)
User.error_user(ap_id)
User.error_user(ap_id)
+
+ true ->
+ nil
end
end
end
end
@@
-97,7
+101,11
@@
defmodule Pleroma.Web.MastodonAPI.StatusView do
UserRelationship.view_relationships_option(nil, [])
true ->
UserRelationship.view_relationships_option(nil, [])
true ->
- actors = Enum.map(activities ++ parent_activities, &get_user(&1.data["actor"]))
+ # Note: unresolved users are filtered out
+ actors =
+ (activities ++ parent_activities)
+ |> Enum.map(&get_user(&1.data["actor"], false))
+ |> Enum.filter(& &1)
UserRelationship.view_relationships_option(reading_user, actors,
source_mutes_only: opts[:skip_relationships]
UserRelationship.view_relationships_option(reading_user, actors,
source_mutes_only: opts[:skip_relationships]