SubscriptionOperation: Let chat mentions through.

This commit is contained in:
lain 2020-06-04 20:28:33 +02:00
parent 74edd4f391
commit d44da91bbf
2 changed files with 9 additions and 2 deletions

View File

@ -141,6 +141,11 @@ defp create_request do
allOf: [BooleanLike], allOf: [BooleanLike],
nullable: true, nullable: true,
description: "Receive poll notifications?" description: "Receive poll notifications?"
},
"pleroma:chat_mention": %Schema{
allOf: [BooleanLike],
nullable: true,
description: "Receive chat notifications?"
} }
} }
} }

View File

@ -58,7 +58,9 @@ test "successful creation", %{conn: conn} do
result = result =
conn conn
|> post("/api/v1/push/subscription", %{ |> post("/api/v1/push/subscription", %{
"data" => %{"alerts" => %{"mention" => true, "test" => true}}, "data" => %{
"alerts" => %{"mention" => true, "test" => true, "pleroma:chat_mention" => true}
},
"subscription" => @sub "subscription" => @sub
}) })
|> json_response_and_validate_schema(200) |> json_response_and_validate_schema(200)
@ -66,7 +68,7 @@ test "successful creation", %{conn: conn} do
[subscription] = Pleroma.Repo.all(Subscription) [subscription] = Pleroma.Repo.all(Subscription)
assert %{ assert %{
"alerts" => %{"mention" => true}, "alerts" => %{"mention" => true, "pleroma:chat_mention" => true},
"endpoint" => subscription.endpoint, "endpoint" => subscription.endpoint,
"id" => to_string(subscription.id), "id" => to_string(subscription.id),
"server_key" => @server_key "server_key" => @server_key