Merge branch 'notification-view-deduplicate' into 'develop'

remove duplicated code from notificationview

See merge request pleroma/pleroma!4356
This commit is contained in:
nicole mikołajczyk 2025-11-29 17:21:44 +01:00
commit 428e038c58
2 changed files with 3 additions and 14 deletions

View file

@ -0,0 +1 @@
remove duplicated code from notificationview

View file

@ -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)