InstanceView: Add pleroma chat messages to nodeinfo
[akkoma] / lib / pleroma / web / mastodon_api / views / notification_view.ex
index 5d231f0c40b84439e822c73bd3e5d336ee447843..2a99518317007c6bd52cc1e5a6dedaf149a8b3b3 100644 (file)
@@ -7,8 +7,8 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
 
   alias Pleroma.Activity
   alias Pleroma.Notification
-  alias Pleroma.User
   alias Pleroma.Object
+  alias Pleroma.User
   alias Pleroma.UserRelationship
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.MastodonAPI.AccountView
@@ -83,7 +83,8 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
       end
     end
 
-    # This returns the notification type by activity, but both chats and statuses are in "Create" activities.
+    # This returns the notification type by activity, but both chats and statuses
+    # are in "Create" activities.
     mastodon_type =
       case Activity.mastodon_notification_type(activity) do
         "mention" ->
@@ -132,9 +133,6 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
           # Note: :skip_relationships option being applied to _account_ rendering (here)
           put_target(response, activity, reading_user, render_opts)
 
-        "follow" ->
-          response
-
         "pleroma:emoji_reaction" ->
           response
           |> put_status(parent_activity_fn.(), reading_user, render_opts)
@@ -143,6 +141,9 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
         "pleroma:chat_mention" ->
           put_chat_message(response, activity, reading_user, render_opts)
 
+        type when type in ["follow", "follow_request"] ->
+          response
+
         _ ->
           nil
       end