diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2022-10-01 23:28:02 +0200 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2022-10-01 23:28:02 +0200 |
commit | 1b238a4fadd50811b1cce64812858c101e790c60 (patch) | |
tree | c266ef7b2edbf7fc2d5c1b94a11d263826404213 /lib | |
parent | 3f1c31b7cd07a4d07e3ec407534c80a14f02294a (diff) | |
download | pleroma-1b238a4fadd50811b1cce64812858c101e790c60.tar.gz pleroma-1b238a4fadd50811b1cce64812858c101e790c60.zip |
Push.Impl: support edits
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
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")}" |