Merge branch 'notification-pleroma-settings' into 'develop'
authorkaniini <nenolod@gmail.com>
Wed, 10 Apr 2019 02:10:31 +0000 (02:10 +0000)
committerkaniini <nenolod@gmail.com>
Wed, 10 Apr 2019 02:10:31 +0000 (02:10 +0000)
Notification controls

Closes #738

See merge request pleroma/pleroma!988

1  2 
docs/api/pleroma_api.md
lib/pleroma/user.ex
lib/pleroma/web/router.ex
lib/pleroma/web/twitter_api/controllers/util_controller.ex
test/web/twitter_api/util_controller_test.exs

Simple merge
Simple merge
Simple merge
index 26407aebdca359ff4be0faf07ecd63f8fdc87f65,2708299cb3ada01f5189ef9ee3455030efaade13..bb71742ec48c79f20398fc7d8b647318cb5b53de
@@@ -283,15 -266,15 +283,21 @@@ defmodule Pleroma.Web.TwitterAPI.UtilCo
    end
  
    def emoji(conn, _params) do
 -    json(conn, Enum.into(Emoji.get_all(), %{}))
 +    emoji =
 +      Emoji.get_all()
 +      |> Enum.map(fn {short_code, path, tags} ->
 +        %{short_code => %{image_url: path, tags: String.split(tags, ",")}}
 +      end)
 +
 +    json(conn, emoji)
    end
  
+   def update_notificaton_settings(%{assigns: %{user: user}} = conn, params) do
+     with {:ok, _} <- User.update_notification_settings(user, params) do
+       json(conn, %{status: "success"})
+     end
+   end
    def follow_import(conn, %{"list" => %Plug.Upload{} = listfile}) do
      follow_import(conn, %{"list" => File.read!(listfile.path)})
    end