diff options
author | kaniini <nenolod@gmail.com> | 2019-03-11 21:43:06 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-03-11 21:43:06 +0000 |
commit | f9a9639015b1ca50096bd7f7cedea3c77bd6ffe2 (patch) | |
tree | 73485982b68a638ed5282b79a158b79197845c68 | |
parent | 9ce97d454c488747cd83cc5a452d474de617de50 (diff) | |
parent | 07277879e595e803f903ac88d66f4b4eb98cc263 (diff) | |
download | pleroma-f9a9639015b1ca50096bd7f7cedea3c77bd6ffe2.tar.gz |
Merge branch 'add-activity-id-to-push-messages' into 'develop'
WebPush: Add activity id to the push messages.
See merge request pleroma/pleroma!925
-rw-r--r-- | lib/pleroma/web/push/impl.ex | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex index 33f912d34..0437ffd00 100644 --- a/lib/pleroma/web/push/impl.ex +++ b/lib/pleroma/web/push/impl.ex @@ -20,7 +20,10 @@ defmodule Pleroma.Web.Push.Impl do @doc "Performs sending notifications for user subscriptions" @spec perform_send(Notification.t()) :: list(any) - def perform_send(%{activity: %{data: %{"type" => activity_type}}, user_id: user_id} = notif) + def perform_send( + %{activity: %{data: %{"type" => activity_type}, id: activity_id}, user_id: user_id} = + notif + ) when activity_type in @types do actor = User.get_cached_by_ap_id(notif.activity.data["actor"]) @@ -37,7 +40,10 @@ defmodule Pleroma.Web.Push.Impl do notification_id: notif.id, notification_type: type, icon: avatar_url, - preferred_locale: "en" + preferred_locale: "en", + pleroma: %{ + activity_id: activity_id + } } |> Jason.encode!() |> push_message(build_sub(subscription), gcm_api_key, subscription) |