Commit d89a7a0b authored by lain's avatar lain
Browse files

TwitterAPI: Add blocking to fetches.

parent 867ac1e4
......@@ -14,17 +14,20 @@ def create_status(%User{} = user, %{"status" => status} = data) do
end
def fetch_friend_statuses(user, opts \\ %{}) do
opts = Map.put(opts, "blocking_user", user)
ActivityPub.fetch_activities([user.ap_id | user.following], opts)
|> activities_to_statuses(%{for: user})
end
def fetch_public_statuses(user, opts \\ %{}) do
opts = Map.put(opts, "local_only", true)
opts = Map.put(opts, "blocking_user", user)
ActivityPub.fetch_public_activities(opts)
|> activities_to_statuses(%{for: user})
end
def fetch_public_and_external_statuses(user, opts \\ %{}) do
opts = Map.put(opts, "blocking_user", user)
ActivityPub.fetch_public_activities(opts)
|> activities_to_statuses(%{for: user})
end
......@@ -41,7 +44,7 @@ def fetch_mentions(user, opts \\ %{}) do
def fetch_conversation(user, id) do
with context when is_binary(context) <- conversation_id_to_context(id),
activities <- ActivityPub.fetch_activities_for_context(context),
activities <- ActivityPub.fetch_activities_for_context(context, %{"blocking_user" => user}),
statuses <- activities |> activities_to_statuses(%{for: user})
do
statuses
......
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