add tag feeds

This commit is contained in:
Maksim Pechnikov 2019-12-17 22:13:45 +03:00
commit b53573a837
9 changed files with 149 additions and 33 deletions

View file

@ -11,6 +11,8 @@ defmodule Pleroma.Web.Feed.UserController do
alias Pleroma.Web.ActivityPub.ActivityPubController
alias Pleroma.Web.Feed.FeedView
import Pleroma.Web.ControllerHelper, only: [put_in_if_exist: 3]
plug(Pleroma.Plugs.SetFormatPlug when action in [:feed_redirect])
action_fallback(:errors)
@ -35,12 +37,8 @@ defmodule Pleroma.Web.Feed.UserController do
def feed(conn, %{"nickname" => nickname} = params) do
with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname(nickname)} do
activities =
%{
"type" => ["Create"],
"whole_db" => true,
"actor_id" => user.ap_id
}
|> Map.merge(Map.take(params, ["max_id"]))
%{"type" => ["Create"], "whole_db" => true, "actor_id" => user.ap_id}
|> put_in_if_exist("max_id", params["max_id"])
|> ActivityPub.fetch_public_activities()
conn