Generates contexts and ids on insertion time.
This commit is contained in:
parent
a4db3a732f
commit
bc31bee7c4
3 changed files with 42 additions and 4 deletions
|
|
@ -32,13 +32,14 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
|||
end)
|
||||
end
|
||||
|
||||
defp get_context_id(%{data: %{"context" => nil}}), do: nil
|
||||
defp get_context_id(%{data: %{"context" => nil}}, _), do: nil
|
||||
defp get_context_id(%{data: %{"context" => context}}, options) do
|
||||
cond do
|
||||
id = options[:context_ids][context] -> id
|
||||
true -> TwitterAPI.context_to_conversation_id(context)
|
||||
end
|
||||
end
|
||||
defp get_context_id(_, _), do: nil
|
||||
|
||||
def render("index.json", opts) do
|
||||
context_ids = collect_context_ids(opts.activities)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue