Merge branch 'fix-initial-posts' into 'develop'
Check if the user has indeed not been federated with before fetching initial posts See merge request pleroma/pleroma!951
This commit is contained in:
commit
d0eb25a3da
@ -1159,9 +1159,12 @@ defmodule Pleroma.User do
|
|||||||
if !is_nil(user) and !User.needs_update?(user) do
|
if !is_nil(user) and !User.needs_update?(user) do
|
||||||
user
|
user
|
||||||
else
|
else
|
||||||
|
# Whether to fetch initial posts for the user (if it's a new user & the fetching is enabled)
|
||||||
|
should_fetch_initial = is_nil(user) and Pleroma.Config.get([:fetch_initial_posts, :enabled])
|
||||||
|
|
||||||
user = fetch_by_ap_id(ap_id)
|
user = fetch_by_ap_id(ap_id)
|
||||||
|
|
||||||
if Pleroma.Config.get([:fetch_initial_posts, :enabled]) do
|
if should_fetch_initial do
|
||||||
with %User{} = user do
|
with %User{} = user do
|
||||||
{:ok, _} = Task.start(__MODULE__, :fetch_initial_posts, [user])
|
{:ok, _} = Task.start(__MODULE__, :fetch_initial_posts, [user])
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user