Merge branch 'feature/emoji-in-local-users' into 'develop'
[akkoma] / lib / pleroma / web / twitter_api / representers / activity_representer.ex
index bb77e61f3ac854cde0e5604d0cdceca121340c2d..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,
@@ -191,7 +200,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "tags" => tags,
       "activity_type" => "post",
       "possibly_sensitive" => possibly_sensitive,
-      "visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object)
+      "visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
+      "summary" => object["summary"]
     }
   end