From c3c57ef6c46bb5bd610bfa117445b6ff906fc687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Sun, 7 Sep 2025 23:15:50 +0200 Subject: [PATCH] remove duplicated code from notificationview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- changelog.d/notification-view-deduplicate.skip | 1 + .../web/mastodon_api/views/notification_view.ex | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) create mode 100644 changelog.d/notification-view-deduplicate.skip 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)