Merge branch 'feature/emoji-in-local-users' into 'develop'
[akkoma] / lib / pleroma / web / twitter_api / representers / activity_representer.ex
index 26bfb79af16d5e5b0d90cda5c9f69f3137d9db9a..9abea59a7a470cc6dc9232d04ccfe9f49bca407c 100644 (file)
@@ -170,6 +170,15 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       HtmlSanitizeEx.basic_html(content)
       |> Formatter.emojify(object["emoji"])
 
+    video =
+      if object["type"] == "Video" do
+        vid = [object]
+      else
+        []
+      end
+
+    attachments = (object["attachment"] || []) ++ video
+
     %{
       "id" => activity.id,
       "uri" => activity.data["object"]["id"],
@@ -181,7 +190,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "created_at" => created_at,
       "in_reply_to_status_id" => object["inReplyToStatusId"],
       "statusnet_conversation_id" => conversation_id,
-      "attachments" => (object["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts),
+      "attachments" => attachments |> ObjectRepresenter.enum_to_list(opts),
       "attentions" => attentions,
       "fave_num" => like_count,
       "repeat_num" => announcement_count,