From: kaniini Date: Wed, 10 Apr 2019 02:10:31 +0000 (+0000) Subject: Merge branch 'notification-pleroma-settings' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=97395e013e5dac84399769438f8b90cffa38afd5;p=akkoma Merge branch 'notification-pleroma-settings' into 'develop' Notification controls Closes #738 See merge request pleroma/pleroma!988 --- 97395e013e5dac84399769438f8b90cffa38afd5 diff --cc lib/pleroma/web/twitter_api/controllers/util_controller.ex index 26407aebd,2708299cb..bb71742ec --- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex +++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex @@@ -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