mix format
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index 3012344121240b3737272c3336b159a09b956985..59898457b73aee226df473ccdbeb48961c7d155a 100644 (file)
@@ -125,8 +125,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       uri: object["id"],
       url: object["external_url"] || object["id"],
       account: AccountView.render("account.json", %{user: user}),
-      in_reply_to_id: reply_to && reply_to.id,
-      in_reply_to_account_id: reply_to_user && reply_to_user.id,
+      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),
       reblog: nil,
       content: HtmlSanitizeEx.basic_html(object["content"]),
       created_at: created_at,
@@ -193,11 +193,18 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     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"
-      true -> "direct"
+      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"
+
+      true ->
+        "direct"
     end
   end
 end