Merge branch 'rework-emoji-management' into 'develop'
authorkaniini <nenolod@gmail.com>
Mon, 22 Apr 2019 02:07:19 +0000 (02:07 +0000)
committerkaniini <nenolod@gmail.com>
Mon, 22 Apr 2019 02:07:19 +0000 (02:07 +0000)
Remove finmoji and add a way to download emojis in packs

Closes #817 and #821

See merge request pleroma/pleroma!1073

1  2 
CHANGELOG.md
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

diff --combined CHANGELOG.md
index ca056fc7144bc1e5a187b2c49a3dffe7fabf3c2f,c778e02340554ead809290b0ca4cf0fc795b83f6..ed078bc6966f457ccd6898302164410ed00b94b9
@@@ -24,6 -24,7 +24,7 @@@ The format is based on [Keep a Changelo
  - Mastodon API: [Reports](https://docs.joinmastodon.org/api/rest/reports/)
  - ActivityPub C2S: OAuth endpoints
  - Metadata RelMe provider
+ - Emoji packs and emoji pack manager
  
  ### Changed
  - **Breaking:** Configuration: move from Pleroma.Mailer to Pleroma.Emails.Mailer
@@@ -50,6 -51,7 +51,7 @@@
  - Mastodon API: Remove attachment limit in the Status entity
  - Deps: Updated Cowboy to 2.6
  - Deps: Updated Ecto to 3.0.7
+ - Don't ship finmoji by default, they can be installed as an emoji pack
  
  ### Fixed
  - Followers counter not being updated when a follower is blocked
  - MediaProxy: Parse name from content disposition headers even for non-whitelisted types
  - MediaProxy: S3 link encoding
  - Rich Media: Reject any data which cannot be explicitly encoded into JSON
 +- Pleroma API: Importing follows from Mastodon 2.8+
  - Mastodon API: `/api/v1/favourites` serving only public activities
  - Mastodon API: Reblogs having `in_reply_to_id` - `null` even when they are replies
  - Mastodon API: Streaming API broadcasting wrong activity id
  - Mastodon API: 500 errors when requesting a card for a private conversation
 +- Mastodon API: Handling of `reblogs` in `/api/v1/accounts/:id/follow`
 +- Mastodon API: Correct `reblogged`, `favourited`, and `bookmarked` values in the reblog status JSON
  
  ## [0.9.9999] - 2019-04-05
  ### Security
index 485e79a0dec2ef812892465b2013f7ad4a23ee67,2a81dcc674e98df6db136b3aea5803c075cd1a87..d271d3786b1322f88538dfb568eeb79e73581867
@@@ -190,7 -190,7 +190,7 @@@ defmodule Pleroma.Web.MastodonAPI.Masto
          "static_url" => url,
          "visible_in_picker" => true,
          "url" => url,
-         "tags" => String.split(tags, ",")
+         "tags" => tags
        }
      end)
    end
    end
  
    def get_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do
 -    with %Activity{} = activity <- Activity.get_by_id(id),
 +    with %Activity{} = activity <- Activity.get_by_id_with_object(id),
           true <- Visibility.visible_for_user?(activity, user) do
        conn
        |> put_view(StatusView)
    end
  
    def reblog_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do
 -    with {:ok, announce, _activity} <- CommonAPI.repeat(ap_id_or_id, user) do
 +    with {:ok, announce, _activity} <- CommonAPI.repeat(ap_id_or_id, user),
 +         %Activity{} = announce <- Activity.normalize(announce.data) do
        conn
        |> put_view(StatusView)
        |> try_render("status.json", %{activity: announce, for: user, as: :activity})
  
    def unreblog_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do
      with {:ok, _unannounce, %{data: %{"id" => id}}} <- CommonAPI.unrepeat(ap_id_or_id, user),
 -         %Activity{} = activity <- Activity.get_create_by_object_ap_id(id) do
 +         %Activity{} = activity <- Activity.get_create_by_object_ap_id_with_object(id) do
        conn
        |> put_view(StatusView)
        |> try_render("status.json", %{activity: activity, for: user, as: :activity})
    def follow(%{assigns: %{user: follower}} = conn, %{"id" => id}) do
      with {_, %User{} = followed} <- {:followed, User.get_cached_by_id(id)},
           {_, true} <- {:followed, follower.id != followed.id},
 -         false <- User.following?(follower, followed),
 -         {:ok, follower, followed, _} <- CommonAPI.follow(follower, followed) do
 +         {:ok, follower} <- MastodonAPI.follow(follower, followed, conn.params) do
        conn
        |> put_view(AccountView)
        |> render("relationship.json", %{user: follower, target: followed})
        {:followed, _} ->
          {:error, :not_found}
  
 -      true ->
 -        followed = User.get_cached_by_id(id)
 -
 -        {:ok, follower} =
 -          case conn.params["reblogs"] do
 -            true -> CommonAPI.show_reblogs(follower, followed)
 -            false -> CommonAPI.hide_reblogs(follower, followed)
 -          end
 -
 -        conn
 -        |> put_view(AccountView)
 -        |> render("relationship.json", %{user: follower, target: followed})
 -
        {:error, message} ->
          conn
          |> put_resp_content_type("application/json")