end
def notifications(%{assigns: %{user: user}} = conn, params) do
- notifications = Notification.for_user(user, params)
+ notifications = MastodonAPI.get_notifications(user, params)
conn
|> add_link_headers(:notifications, notifications)
|> render("relationship.json", %{user: follower, target: followed})
else
true ->
- case conn.params["reblogs"] do
- true -> CommonAPI.show_reblogs(follower, id)
- false -> CommonAPI.hide_reblogs(follower, id)
- end
+ followed = User.get_cached_by_id(id)
- followed = Repo.get(User, id)
+ {:ok, follower} =
+ case conn.params["reblogs"] do
+ true -> CommonAPI.show_reblogs(follower, followed)
+ false -> CommonAPI.hide_reblogs(follower, followed)
+ end
conn
|> put_view(AccountView)
end
def favourites(%{assigns: %{user: user}} = conn, params) do
- activities =
+ params =
params
|> Map.put("type", "Create")
|> Map.put("favorited_by", user.ap_id)
|> Map.put("blocking_user", user)
- |> ActivityPub.fetch_public_activities()
+
+ activities =
+ ActivityPub.fetch_activities([], params)
|> Enum.reverse()
conn