aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/Differences-in-MastodonAPI-Responses.md6
-rw-r--r--lib/pleroma/user.ex5
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md
index 621de6603..5e89cde5e 100644
--- a/docs/Differences-in-MastodonAPI-Responses.md
+++ b/docs/Differences-in-MastodonAPI-Responses.md
@@ -29,3 +29,9 @@ Has these additional fields under the `pleroma` object:
## Accounts
- `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc.
+
+## Notifications
+
+Has these additional fields under the `pleroma` object:
+
+- `is_seen`: true if the notification was read by the user
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