diff --git a/changelog.d/notification-view-deduplicate.skip b/changelog.d/notification-view-deduplicate.skip new file mode 100644 index 000000000..769352692 --- /dev/null +++ b/changelog.d/notification-view-deduplicate.skip @@ -0,0 +1 @@ +remove duplicated code from notificationview diff --git a/lib/pleroma/web/mastodon_api/views/notification_view.ex b/lib/pleroma/web/mastodon_api/views/notification_view.ex index c277af98b..27532c42a 100644 --- a/lib/pleroma/web/mastodon_api/views/notification_view.ex +++ b/lib/pleroma/web/mastodon_api/views/notification_view.ex @@ -106,27 +106,15 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do } case notification.type do - "mention" -> + type when type in ["mention", "status", "poll"] -> put_status(response, activity, reading_user, status_render_opts) - "status" -> - put_status(response, activity, reading_user, status_render_opts) - - "favourite" -> - put_status(response, parent_activity_fn.(), reading_user, status_render_opts) - - "reblog" -> - put_status(response, parent_activity_fn.(), reading_user, status_render_opts) - - "update" -> + type when type in ["favourite", "reblog", "update"] -> put_status(response, parent_activity_fn.(), reading_user, status_render_opts) "move" -> put_target(response, activity, reading_user, %{}) - "poll" -> - put_status(response, activity, reading_user, status_render_opts) - "pleroma:emoji_reaction" -> response |> put_status(parent_activity_fn.(), reading_user, status_render_opts)