fix most tests
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 25 Nov 2018 20:56:12 +0000 (20:56 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Tue, 4 Dec 2018 04:52:09 +0000 (04:52 +0000)
lib/pleroma/web/mastodon_api/views/status_view.ex
lib/pleroma/web/twitter_api/representers/activity_representer.ex
lib/pleroma/web/twitter_api/views/activity_view.ex

index 3b4911d531e0861b3b2295c03a5dc53cc68258d8..31f4675c3a86faca85e857ec0b308fbdc2498f52 100644 (file)
@@ -134,7 +134,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     %{
       id: to_string(activity.id),
       uri: object.data["id"],
-      url: object.data["external_url"] || object["id"],
+      url: object.data["external_url"] || object.data["id"],
       account: AccountView.render("account.json", %{user: user}),
       in_reply_to_id: reply_to && to_string(reply_to.id),
       in_reply_to_account_id: reply_to_user && to_string(reply_to_user.id),
@@ -149,7 +149,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       muted: false,
       sensitive: sensitive,
       spoiler_text: object.data["summary"] || "",
-      visibility: get_visibility(object),
+      visibility: get_visibility(object.data),
       media_attachments: attachments |> Enum.take(4),
       mentions: mentions,
       # fix,
index 4b4e202b32d42f6fdf3790d5a85b78676f30ec20..436f9bf92b307d2db9e3f6637939b4083a4bed7e 100644 (file)
@@ -167,14 +167,14 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
 
     tags = if possibly_sensitive, do: Enum.uniq(["nsfw" | tags]), else: tags
 
-    {summary, content} = ActivityView.render_content(object)
+    {summary, content} = ActivityView.render_content(object.data)
 
     html =
       HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
       |> Formatter.emojify(object.data["emoji"])
 
     video =
-      if object["type"] == "Video" do
+      if object.data["type"] == "Video" do
         vid = [object.data]
       else
         []
index 7839fe878f0985c093429c2924a63b08ad706620..f202b6e9742c72a6504fd0981a73dee70ea53c8b 100644 (file)
@@ -265,7 +265,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView 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.data),
       "summary" => summary
     }
   end