Generates contexts and ids on insertion time.

This commit is contained in:
lain 2018-04-02 15:17:09 +02:00
commit bc31bee7c4
3 changed files with 42 additions and 4 deletions

View file

@ -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)