aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/streamer.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/streamer.ex')
-rw-r--r--lib/pleroma/web/streamer.ex14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/pleroma/web/streamer.ex b/lib/pleroma/web/streamer.ex
index 587c43f40..42d95e33a 100644
--- a/lib/pleroma/web/streamer.ex
+++ b/lib/pleroma/web/streamer.ex
@@ -10,6 +10,7 @@ defmodule Pleroma.Web.Streamer do
alias Pleroma.Conversation.Participation
alias Pleroma.Notification
alias Pleroma.Object
+ alias Pleroma.SubscriptionNotification
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Visibility
@@ -208,10 +209,17 @@ defmodule Pleroma.Web.Streamer do
|> Jason.encode!()
end
- @spec represent_notification(User.t(), Notification.t()) :: binary()
- defp represent_notification(%User{} = user, %Notification{} = notify) do
+ @spec represent_notification(User.t(), Notification.t() | %SubscriptionNotification{}) ::
+ binary()
+ defp represent_notification(%User{} = user, notify) do
+ event =
+ case notify do
+ %Notification{} -> "notification"
+ %SubscriptionNotification{} -> "subscription_norification"
+ end
+
%{
- event: "notification",
+ event: event,
payload:
NotificationView.render(
"show.json",