Commit de114ffb authored by kaniini's avatar kaniini
Browse files

activitypub: remove contain_timeline()

parent 0387f521
...@@ -980,12 +980,4 @@ def contain_broken_threads(%Activity{} = activity, %User{} = user) do ...@@ -980,12 +980,4 @@ def contain_broken_threads(%Activity{} = activity, %User{} = user) do
def contain_activity(%Activity{} = activity, %User{} = user) do def contain_activity(%Activity{} = activity, %User{} = user) do
contain_broken_threads(activity, user) contain_broken_threads(activity, user)
end end
# do post-processing on a timeline
def contain_timeline(timeline, user) do
timeline
|> Enum.filter(fn activity ->
contain_activity(activity, user)
end)
end
end end
...@@ -303,7 +303,6 @@ def home_timeline(%{assigns: %{user: user}} = conn, params) do ...@@ -303,7 +303,6 @@ def home_timeline(%{assigns: %{user: user}} = conn, params) do
activities = activities =
[user.ap_id | user.following] [user.ap_id | user.following]
|> ActivityPub.fetch_activities(params) |> ActivityPub.fetch_activities(params)
|> ActivityPub.contain_timeline(user)
|> Enum.reverse() |> Enum.reverse()
conn conn
......
...@@ -101,9 +101,7 @@ def friends_timeline(%{assigns: %{user: user}} = conn, params) do ...@@ -101,9 +101,7 @@ def friends_timeline(%{assigns: %{user: user}} = conn, params) do
|> Map.put("blocking_user", user) |> Map.put("blocking_user", user)
|> Map.put("user", user) |> Map.put("user", user)
activities = activities = ActivityPub.fetch_activities([user.ap_id | user.following], params)
ActivityPub.fetch_activities([user.ap_id | user.following], params)
|> ActivityPub.contain_timeline(user)
conn conn
|> put_view(ActivityView) |> put_view(ActivityView)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment