- def get_visibility(object) do
- public = "https://www.w3.org/ns/activitystreams#Public"
- to = object["to"] || []
- cc = object["cc"] || []
-
- cond do
- public in to ->
- "public"
-
- public in cc ->
- "unlisted"
-
- # this should use the sql for the object's activity
- Enum.any?(to, &String.contains?(&1, "/followers")) ->
- "private"
-
- length(cc) > 0 ->
- "private"
-
- true ->
- "direct"
- end
- end
-
- def render_content(%{"type" => "Video"} = object) do
- with name when not is_nil(name) and name != "" <- object["name"] do
- "<p><a href=\"#{object["id"]}\">#{name}</a></p>#{object["content"]}"
+ def render_content(%{data: %{"type" => "Video"}} = object) do
+ with name when not is_nil(name) and name != "" <- object.data["name"] do
+ "<p><a href=\"#{object.data["id"]}\">#{name}</a></p>#{object.data["content"]}"