|
|
@ -16,7 +16,7 @@ defmodule Pleroma.Web.Push.Impl do
|
|
|
|
require Logger
|
|
|
|
require Logger
|
|
|
|
import Ecto.Query
|
|
|
|
import Ecto.Query
|
|
|
|
|
|
|
|
|
|
|
|
@types ["Create", "Follow", "Announce", "Like", "Move", "EmojiReact"]
|
|
|
|
@types ["Create", "Follow", "Announce", "Like", "Move", "EmojiReact", "Update"]
|
|
|
|
|
|
|
|
|
|
|
|
@doc "Performs sending notifications for user subscriptions"
|
|
|
|
@doc "Performs sending notifications for user subscriptions"
|
|
|
|
@spec perform(Notification.t()) :: list(any) | :error | {:error, :unknown_type}
|
|
|
|
@spec perform(Notification.t()) :: list(any) | :error | {:error, :unknown_type}
|
|
|
@ -167,6 +167,15 @@ defmodule Pleroma.Web.Push.Impl do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def format_body(
|
|
|
|
|
|
|
|
%{activity: %{data: %{"type" => "Update"}}},
|
|
|
|
|
|
|
|
actor,
|
|
|
|
|
|
|
|
_object,
|
|
|
|
|
|
|
|
_mastodon_type
|
|
|
|
|
|
|
|
) do
|
|
|
|
|
|
|
|
"@#{actor.nickname} edited a status"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def format_title(activity, mastodon_type \\ nil)
|
|
|
|
def format_title(activity, mastodon_type \\ nil)
|
|
|
|
|
|
|
|
|
|
|
|
def format_title(%{activity: %{data: %{"directMessage" => true}}}, _mastodon_type) do
|
|
|
|
def format_title(%{activity: %{data: %{"directMessage" => true}}}, _mastodon_type) do
|
|
|
@ -180,6 +189,7 @@ defmodule Pleroma.Web.Push.Impl do
|
|
|
|
"follow_request" -> "New Follow Request"
|
|
|
|
"follow_request" -> "New Follow Request"
|
|
|
|
"reblog" -> "New Repeat"
|
|
|
|
"reblog" -> "New Repeat"
|
|
|
|
"favourite" -> "New Favorite"
|
|
|
|
"favourite" -> "New Favorite"
|
|
|
|
|
|
|
|
"update" -> "New Update"
|
|
|
|
"pleroma:emoji_reaction" -> "New Reaction"
|
|
|
|
"pleroma:emoji_reaction" -> "New Reaction"
|
|
|
|
type -> "New #{String.capitalize(type || "event")}"
|
|
|
|
type -> "New #{String.capitalize(type || "event")}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|