diff options
author | Mark Felder <feld@feld.me> | 2024-06-11 18:14:07 -0400 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-06-11 18:14:07 -0400 |
commit | 603a57576638c9732fe873db3c2b8d56d0a413a5 (patch) | |
tree | 82548060161fce7efa00dceb549e4c0ba6e1caab | |
parent | 568819c08afee68636a4871e78838db1ac1f590c (diff) | |
download | pleroma-603a57576638c9732fe873db3c2b8d56d0a413a5.tar.gz pleroma-603a57576638c9732fe873db3c2b8d56d0a413a5.zip |
The user is not always preloaded into the notification
-rw-r--r-- | lib/pleroma/web/push/impl.ex | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex index c5ba7ca65..65801922d 100644 --- a/lib/pleroma/web/push/impl.ex +++ b/lib/pleroma/web/push/impl.ex @@ -27,7 +27,7 @@ defmodule Pleroma.Web.Push.Impl do def build( %{ activity: %{data: %{"type" => activity_type}} = activity, - user: user + user_id: user_id } = notification ) when activity_type in @types do @@ -35,9 +35,10 @@ defmodule Pleroma.Web.Push.Impl do avatar_url = User.avatar_url(notification_actor) object = Object.normalize(activity, fetch: false) + user = User.get_cached_by_id(user_id) direct_conversation_id = Activity.direct_conversation_id(activity, user) - subscriptions = fetch_subscriptions(user.id) + subscriptions = fetch_subscriptions(user_id) subscriptions |> Enum.filter(&Subscription.enabled?(&1, notification.type)) |