diff options
author | Ekaterina Vaartis <vaartis@cock.li> | 2019-03-18 20:14:49 +0300 |
---|---|---|
committer | Ekaterina Vaartis <vaartis@cock.li> | 2019-03-18 20:16:31 +0300 |
commit | a1aacc08a43b287e0f9b7337da6230cff9e0e5c5 (patch) | |
tree | 45091be3dcaab30a2a6b65f33ff821bd3608f8d5 | |
parent | 9073039d723ab7e245af439ca351ba0f551d722c (diff) | |
download | pleroma-a1aacc08a43b287e0f9b7337da6230cff9e0e5c5.tar.gz |
Check if the user has indeed not been federated with
Just updating the user triggered post fetching too, now it
shouldn't. It only happened in the AP user fetching since that's
what's used to update users
-rw-r--r-- | lib/pleroma/user.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 692ae836c..f72bc4bce 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1159,9 +1159,12 @@ defmodule Pleroma.User do if !is_nil(user) and !User.needs_update?(user) do user 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) - if Pleroma.Config.get([:fetch_initial_posts, :enabled]) do + if should_fetch_initial do with %User{} = user do {:ok, _} = Task.start(__MODULE__, :fetch_initial_posts, [user]) end |