From ddd57c8a0faa7cf0c4b240ade5d951820e480fec Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 18 Feb 2019 21:28:48 +0100 Subject: [PATCH] Web.MastodonAPI.MastodonAPIController: Use variable+pipe rather than nesting function calls --- lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index d54b447c6..01a698fd7 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -482,9 +482,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do end def notifications(%{assigns: %{user: user}} = conn, params) do + exclude_types = + params["exclude_types"] + |> Notification.masto_to_ap() + params = params - |> Map.put("exclude_types", Notification.masto_to_ap(params["exclude_types"])) + |> Map.put("exclude_types", exclude_types) notifications = Notification.for_user(user, params)