aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-11-13 17:01:53 -0600
committerMark Felder <feld@FreeBSD.org>2020-11-17 20:20:00 +0000
commit3ce11b830ee69d8557146fce6d3507337298259d (patch)
tree69cb77bd03a3ac7f9b0dc7cd2d0c27a67b0439eb /lib
parentd33b9e7b335edc3d719063972ab8b3f650971a21 (diff)
downloadpleroma-3ce11b830ee69d8557146fce6d3507337298259d.tar.gz
Add capability for emoji reaction push notifications
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/push/impl.ex12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex
index da535aa68..f91cb1d40 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"]
+ @types ["Create", "Follow", "Announce", "Like", "Move", "EmojiReact"]
@doc "Performs sending notifications for user subscriptions"
@spec perform(Notification.t()) :: list(any) | :error | {:error, :unknown_type}
@@ -150,6 +150,15 @@ defmodule Pleroma.Web.Push.Impl do
end
def format_body(
+ %{activity: %{data: %{"type" => "EmojiReact", "content" => content}}},
+ actor,
+ _object,
+ _mastodon_type
+ ) do
+ "@#{actor.nickname} has reacted with #{content}"
+ end
+
+ def format_body(
%{activity: %{data: %{"type" => type}}} = notification,
actor,
_object,
@@ -179,6 +188,7 @@ defmodule Pleroma.Web.Push.Impl do
"reblog" -> "New Repeat"
"favourite" -> "New Favorite"
"pleroma:chat_mention" -> "New Chat Message"
+ "pleroma:emoji_reaction" -> "New Reaction"
type -> "New #{String.capitalize(type || "event")}"
end
end