diff options
author | rinpatch <rinpatch@sdf.org> | 2019-03-14 22:33:20 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-03-14 22:33:20 +0300 |
commit | cbdd11c38111fd7c195983f40265b675e1201d4e (patch) | |
tree | 44c63ed6430a743cfe589fed5213467a0dd6dabb /lib/pleroma/web/push/impl.ex | |
parent | 355f285a8693934fbc8205c2c9ecde0a758fc158 (diff) | |
parent | 34fc0dca2e879bcbb73acc80fdc72678411d0ebf (diff) | |
download | pleroma-cbdd11c38111fd7c195983f40265b675e1201d4e.tar.gz |
Merge develop to bump elixir version in the CI so I don't get failing formatting
Diffstat (limited to 'lib/pleroma/web/push/impl.ex')
-rw-r--r-- | lib/pleroma/web/push/impl.ex | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex index 33f912d34..863573185 100644 --- a/lib/pleroma/web/push/impl.ex +++ b/lib/pleroma/web/push/impl.ex @@ -5,13 +5,13 @@ defmodule Pleroma.Web.Push.Impl do @moduledoc "The module represents implementation push web notification" - alias Pleroma.Repo - alias Pleroma.User alias Pleroma.Activity + alias Pleroma.Notification alias Pleroma.Object - alias Pleroma.Web.Push.Subscription + alias Pleroma.Repo + alias Pleroma.User alias Pleroma.Web.Metadata.Utils - alias Pleroma.Notification + alias Pleroma.Web.Push.Subscription require Logger import Ecto.Query @@ -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) |