Add external links to twapi.
[akkoma] / lib / pleroma / web / twitter_api / representers / activity_representer.ex
index 9be7338c71178a52d79234bf2707f3294555e10c..a03b34ffb9a29b70c37f226cc59dd93908e44ee9 100644 (file)
@@ -23,7 +23,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
       "statusnet_html" => text,
       "text" => text,
-      "is_local" => true,
+      "is_local" => activity.local,
       "is_post_verb" => false,
       "uri" => "tag:#{activity.data["id"]}:objectType=note",
       "created_at" => created_at,
@@ -44,7 +44,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
       "statusnet_html" => text,
       "text" => text,
-      "is_local" => true,
+      "is_local" => activity.local,
       "is_post_verb" => false,
       "uri" => "tag:#{activity.data["id"]}:objectType=Favourite",
       "created_at" => created_at,
@@ -64,7 +64,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "attentions" => [],
       "statusnet_html" => text,
       "text" => text,
-      "is_local" => true,
+      "is_local" => activity.local,
       "is_post_verb" => false,
       "created_at" => created_at,
       "in_reply_to_status_id" => nil,
@@ -93,7 +93,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
       "statusnet_html" => HtmlSanitizeEx.basic_html(content) |> Formatter.finmojifiy,
       "text" => HtmlSanitizeEx.strip_tags(content),
-      "is_local" => true,
+      "is_local" => activity.local,
       "is_post_verb" => true,
       "created_at" => created_at,
       "in_reply_to_status_id" => object["inReplyToStatusId"],
@@ -104,7 +104,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
       "repeat_num" => announcement_count,
       "favorited" => to_boolean(favorited),
       "repeated" => to_boolean(repeated),
-      "external_url" => activity.data["id"],
+      "external_url" => object["external_url"],
       "tags" => activity.data["object"]["tag"] || []
     }
   end