- activities =
- if params["max_id"] do
- ActivityPub.fetch_user_activities(user, for_user, %{
- max_id: params["max_id"],
- # This is a hack because postgres generates inefficient queries when filtering by
- # 'Answer', poll votes will be hidden by the visibility filter in this case anyway
- include_poll_votes: true,
- limit: 10
- })
- else
- ActivityPub.fetch_user_activities(user, for_user, %{
- limit: 10,
- include_poll_votes: true
- })
- end
+ # "include_poll_votes" is a hack because postgres generates inefficient
+ # queries when filtering by 'Answer', poll votes will be hidden by the
+ # visibility filter in this case anyway
+ params =
+ params
+ |> Map.drop(["nickname", "page"])
+ |> Map.put("include_poll_votes", true)
+ |> Map.new(fn {k, v} -> {String.to_existing_atom(k), v} end)
+
+ activities = ActivityPub.fetch_user_activities(user, for_user, params)