X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fviews%2Fnotification_view.ex;h=33145c484d6f74fe03e95a88292ebd9cb58d2bc1;hb=86f2fbc81e5f3df6c16e05127e9e39c8fca0cde9;hp=ddd7f531826d4bb18bc944770abd31b83be66b7a;hpb=3ecf131511afc1fc366be6402ca94cf0e6c30e11;p=akkoma
diff --git a/lib/pleroma/web/mastodon_api/views/notification_view.ex b/lib/pleroma/web/mastodon_api/views/notification_view.ex
index ddd7f5318..33145c484 100644
--- a/lib/pleroma/web/mastodon_api/views/notification_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/notification_view.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.NotificationView do
@@ -37,18 +37,37 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
}
case mastodon_type do
- "mention" -> put_status(response, activity, user)
- "favourite" -> put_status(response, parent_activity, user)
- "reblog" -> put_status(response, parent_activity, user)
- "move" -> put_target(response, activity, user)
- "follow" -> response
- _ -> nil
+ "mention" ->
+ put_status(response, activity, user)
+
+ "favourite" ->
+ put_status(response, parent_activity, user)
+
+ "reblog" ->
+ put_status(response, parent_activity, user)
+
+ "move" ->
+ put_target(response, activity, user)
+
+ "follow" ->
+ response
+
+ "pleroma:emoji_reaction" ->
+ put_status(response, parent_activity, user) |> put_emoji(activity)
+
+ _ ->
+ nil
end
else
_ -> nil
end
end
+ defp put_emoji(response, activity) do
+ response
+ |> Map.put(:emoji, activity.data["content"])
+ end
+
defp put_status(response, activity, user) do
Map.put(response, :status, StatusView.render("show.json", %{activity: activity, for: user}))
end