Commit 600f428d authored by lain's avatar lain
Browse files

WebPush: Add activity id to the push messages.

Makes it easier to relate the push to a given status.
parent 2c8deecd
Pipeline #8869 failed with stages
in 2 minutes and 33 seconds
......@@ -20,7 +20,7 @@ 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 +37,10 @@ def perform_send(%{activity: %{data: %{"type" => activity_type}}, user_id: user_
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment