Verified Commit b7bbf42a authored by Alex Gleason's avatar Alex Gleason
Browse files

Streamer: fix crash in MastodonAPI.StatusView

parent dc63aaf8
Pipeline #37115 passed with stages
in 7 minutes and 3 seconds
......@@ -65,11 +65,19 @@ defp get_context_id(%{data: %{"context" => context}}) when is_binary(context),
defp get_context_id(_), do: nil
defp reblogged?(activity, user) do
object = Object.normalize(activity, fetch: false) || %{}
present?(user && user.ap_id in (["announcements"] || []))
# Check if the user reblogged this status
defp reblogged?(activity, %User{ap_id: ap_id}) do
with %Object{data: %{"announcements" => announcements}} when is_list(announcements) <-
Object.normalize(activity, fetch: false) do
ap_id in announcements
_ -> false
# False if the user is logged out
defp reblogged?(_activity, _user), do: false
def render("index.json", opts) do
reading_user = opts[:for]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment