SubscriptionOperation: Let chat mentions through.
authorlain <lain@soykaf.club>
Thu, 4 Jun 2020 18:28:33 +0000 (20:28 +0200)
committerlain <lain@soykaf.club>
Thu, 4 Jun 2020 18:28:33 +0000 (20:28 +0200)
lib/pleroma/web/api_spec/operations/subscription_operation.ex
test/web/mastodon_api/controllers/subscription_controller_test.exs

index c575a87e622e78fc0125956d0abbba29cbc22d15..775dd795de3a05cfac95b927232145f4dbe87c71 100644 (file)
@@ -141,6 +141,11 @@ defmodule Pleroma.Web.ApiSpec.SubscriptionOperation do
                   allOf: [BooleanLike],
                   nullable: true,
                   description: "Receive poll notifications?"
+                },
+                "pleroma:chat_mention": %Schema{
+                  allOf: [BooleanLike],
+                  nullable: true,
+                  description: "Receive chat notifications?"
                 }
               }
             }
index 4aa260663d364ccf7586daded8cbc29df86213b4..d36bb1ae8f75beb1202d820eab5c97afcc1f1760 100644 (file)
@@ -58,7 +58,9 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do
       result =
         conn
         |> post("/api/v1/push/subscription", %{
-          "data" => %{"alerts" => %{"mention" => true, "test" => true}},
+          "data" => %{
+            "alerts" => %{"mention" => true, "test" => true, "pleroma:chat_mention" => true}
+          },
           "subscription" => @sub
         })
         |> json_response_and_validate_schema(200)
@@ -66,7 +68,7 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do
       [subscription] = Pleroma.Repo.all(Subscription)
 
       assert %{
-               "alerts" => %{"mention" => true},
+               "alerts" => %{"mention" => true, "pleroma:chat_mention" => true},
                "endpoint" => subscription.endpoint,
                "id" => to_string(subscription.id),
                "server_key" => @server_key