Commit eb1a18d2 authored by kaniini's avatar kaniini

user: check that the follow request actually has an active account associated with it

because of user refetch, accounts can stop existing (get_from_ap_id() can fail), accordingly
filter the follow requests for these failures.
parent d1983ed0
Pipeline #5942 passed with stages
in 5 minutes and 35 seconds
......@@ -495,6 +495,7 @@ def get_follow_requests(%User{} = user) do
Enum.map(reqs, fn req -> req.actor end)
|> Enum.uniq()
|> Enum.map(fn ap_id -> get_by_ap_id(ap_id) end)
|> Enum.filter(fn u -> !is_nil(u) end)
|> Enum.filter(fn u -> !following?(u, user) end)
{:ok, users}
......
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