projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/delete-follow-requests-on-user-deletion' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
notification_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/notification_view.ex
b/lib/pleroma/web/mastodon_api/views/notification_view.ex
index 7001fd7b9f5976640603deec219578ea4b194112..c46ddcf5578f456b30c18cdce99ff3a9b0baccd0 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/notification_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/notification_view.ex
@@
-51,14
+51,13
@@
defmodule Pleroma.Web.MastodonAPI.NotificationView do
|> Enum.filter(& &1)
|> Kernel.++(move_activities_targets)
|> Enum.filter(& &1)
|> Kernel.++(move_activities_targets)
- UserRelationship.view_relationships_option(reading_user, actors)
+ UserRelationship.view_relationships_option(reading_user, actors
, subset: :source_mutes
)
end
end
- opts = %{
- for: reading_user,
- parent_activities: parent_activities,
- relationships: relationships_opt
- }
+ opts =
+ opts
+ |> Map.put(:parent_activities, parent_activities)
+ |> Map.put(:relationships, relationships_opt)
safe_render_many(notifications, NotificationView, "show.json", opts)
end
safe_render_many(notifications, NotificationView, "show.json", opts)
end
@@
-82,12
+81,14
@@
defmodule Pleroma.Web.MastodonAPI.NotificationView do
mastodon_type = Activity.mastodon_notification_type(activity)
mastodon_type = Activity.mastodon_notification_type(activity)
+ # Note: :relationships contain user mutes (needed for :muted flag in :status)
+ status_render_opts = %{relationships: opts[:relationships]}
+
with %{id: _} = account <-
with %{id: _} = account <-
- AccountView.render("show.json", %{
- user: actor,
- for: reading_user,
- relationships: opts[:relationships]
- }) do
+ AccountView.render(
+ "show.json",
+ %{user: actor, for: reading_user}
+ ) do
response = %{
id: to_string(notification.id),
type: mastodon_type,
response = %{
id: to_string(notification.id),
type: mastodon_type,
@@
-98,24
+99,22
@@
defmodule Pleroma.Web.MastodonAPI.NotificationView do
}
}
}
}
- render_opts = %{relationships: opts[:relationships]}
-
case mastodon_type do
"mention" ->
case mastodon_type do
"mention" ->
- put_status(response, activity, reading_user, render_opts)
+ put_status(response, activity, reading_user,
status_
render_opts)
"favourite" ->
"favourite" ->
- put_status(response, parent_activity_fn.(), reading_user, render_opts)
+ put_status(response, parent_activity_fn.(), reading_user,
status_
render_opts)
"reblog" ->
"reblog" ->
- put_status(response, parent_activity_fn.(), reading_user, render_opts)
+ put_status(response, parent_activity_fn.(), reading_user,
status_
render_opts)
"move" ->
"move" ->
- put_target(response, activity, reading_user,
render_opts
)
+ put_target(response, activity, reading_user,
%{}
)
"pleroma:emoji_reaction" ->
response
"pleroma:emoji_reaction" ->
response
- |> put_status(parent_activity_fn.(), reading_user, render_opts)
+ |> put_status(parent_activity_fn.(), reading_user,
status_
render_opts)
|> put_emoji(activity)
type when type in ["follow", "follow_request"] ->
|> put_emoji(activity)
type when type in ["follow", "follow_request"] ->