Commit f9a96390 authored by kaniini's avatar kaniini
Browse files

Merge branch 'add-activity-id-to-push-messages' into 'develop'

WebPush: Add activity id to the push messages.

See merge request !925
parents 9ce97d45 07277879
Pipeline #8884 passed with stages
in 4 minutes and 31 seconds
......@@ -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} =
when activity_type in @types do
actor = User.get_cached_by_ap_id(["actor"])
......@@ -37,7 +40,10 @@ def perform_send(%{activity: %{data: %{"type" => activity_type}}, user_id: user_
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