1
0
Fork 0
mirror of https://git.pleroma.social/pleroma/pleroma.git synced 2026-02-15 17:16:57 +00:00

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 case notification.type do
"mention" -> type when type in ["mention", "status", "poll"] ->
put_status(response, activity, reading_user, status_render_opts) put_status(response, activity, reading_user, status_render_opts)
"status" -> type when type in ["favourite", "reblog", "update"] ->
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" ->
put_status(response, parent_activity_fn.(), reading_user, status_render_opts) put_status(response, parent_activity_fn.(), reading_user, status_render_opts)
"move" -> "move" ->
put_target(response, activity, reading_user, %{}) put_target(response, activity, reading_user, %{})
"poll" ->
put_status(response, activity, reading_user, status_render_opts)
"pleroma:emoji_reaction" -> "pleroma:emoji_reaction" ->
response response
|> put_status(parent_activity_fn.(), reading_user, status_render_opts) |> put_status(parent_activity_fn.(), reading_user, status_render_opts)