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 734ffbf39fd909a1837b93d489088fb2087c8dd1..c46ddcf5578f456b30c18cdce99ff3a9b0baccd0 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/notification_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/notification_view.ex
@@
-51,9
+51,7
@@
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,
- source_mutes_only: opts[:skip_relationships]
- )
+ UserRelationship.view_relationships_option(reading_user, actors, subset: :source_mutes)
end
opts =
end
opts =
@@
-83,15
+81,13
@@
defmodule Pleroma.Web.MastodonAPI.NotificationView do
mastodon_type = Activity.mastodon_notification_type(activity)
mastodon_type = Activity.mastodon_notification_type(activity)
- render_opts = %{
- relationships: opts[:relationships],
- skip_relationships: opts[:skip_relationships]
- }
+ # Note: :relationships contain user mutes (needed for :muted flag in :status)
+ status_render_opts = %{relationships: opts[:relationships]}
with %{id: _} = account <-
AccountView.render(
"show.json",
with %{id: _} = account <-
AccountView.render(
"show.json",
- Map.merge(render_opts, %{user: actor, for: reading_user})
+ %{user: actor, for: reading_user}
) do
response = %{
id: to_string(notification.id),
) do
response = %{
id: to_string(notification.id),
@@
-105,26
+101,25
@@
defmodule Pleroma.Web.MastodonAPI.NotificationView do
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" ->
- # Note: :skip_relationships option being applied to _account_ rendering (here)
- put_target(response, activity, reading_user, render_opts)
-
- "follow" ->
- response
+ 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)
|> put_emoji(activity)
+ type when type in ["follow", "follow_request"] ->
+ response
+
_ ->
nil
end
_ ->
nil
end