diff options
author | tusooa <tusooa@kazv.moe> | 2022-10-27 12:51:29 +0000 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2022-10-27 12:51:29 +0000 |
commit | 9fbf01f7a928465406335034b23c10605aa2189a (patch) | |
tree | 034e21be089d0bc44f714f79b37ed63e5a711b95 /lib | |
parent | 7a519b6a6607bc1dd22e6a3450aebf0f1ff11fb8 (diff) | |
parent | 1b238a4fadd50811b1cce64812858c101e790c60 (diff) | |
download | pleroma-9fbf01f7a928465406335034b23c10605aa2189a.tar.gz pleroma-9fbf01f7a928465406335034b23c10605aa2189a.zip |
Merge branch 'push-updates' into 'develop'
Push.Impl: support edits
See merge request pleroma/pleroma!3760
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/push/impl.ex | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex index daf3eeb9e..3c5f00764 100644 --- a/lib/pleroma/web/push/impl.ex +++ b/lib/pleroma/web/push/impl.ex @@ -16,7 +16,7 @@ defmodule Pleroma.Web.Push.Impl do require Logger 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" @spec perform(Notification.t()) :: list(any) | :error | {:error, :unknown_type} @@ -174,6 +174,15 @@ defmodule Pleroma.Web.Push.Impl do 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: %{data: %{"directMessage" => true}}}, _mastodon_type) do @@ -187,6 +196,7 @@ defmodule Pleroma.Web.Push.Impl do "follow_request" -> "New Follow Request" "reblog" -> "New Repeat" "favourite" -> "New Favorite" + "update" -> "New Update" "pleroma:chat_mention" -> "New Chat Message" "pleroma:emoji_reaction" -> "New Reaction" type -> "New #{String.capitalize(type || "event")}" |