Mastodon makes this field null when posting with MastoFE or if you choose to not...
authorMark Felder <feld@feld.me>
Thu, 18 Feb 2021 22:35:03 +0000 (16:35 -0600)
committerMark Felder <feld@feld.me>
Thu, 18 Feb 2021 22:35:03 +0000 (16:35 -0600)
lib/pleroma/web/api_spec/schemas/status.ex
lib/pleroma/web/mastodon_api/controllers/status_controller.ex
lib/pleroma/web/mastodon_api/views/status_view.ex
test/pleroma/web/mastodon_api/views/status_view_test.exs

index 61ebd8089c7a6256cf4df7ffb7823108b3e888cf..42fa987181946851bedc22c9546da5807faf8471 100644 (file)
@@ -23,9 +23,10 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
       application: %Schema{
         description: "The application used to post this status",
         type: :object,
+        nullable: true,
         properties: %{
           name: %Schema{type: :string},
-          website: %Schema{type: :string, nullable: true, format: :uri}
+          website: %Schema{type: :string, format: :uri}
         }
       },
       bookmarked: %Schema{type: :boolean, description: "Have you bookmarked this status?"},
@@ -291,7 +292,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
         "url" => "http://localhost:4001/users/nick6",
         "username" => "nick6"
       },
-      "application" => %{"name" => "Web", "website" => nil},
+      "application" => nil,
       "bookmarked" => false,
       "card" => nil,
       "content" => "foobar",
index db3f248e51acf6cc53722b825ffec95a542ad220..2e63c88695e9e609ab58b354d9d71cf9156540dc 100644 (file)
@@ -425,5 +425,5 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
     Map.put(params, :application, %{name: client_name, website: website})
   end
 
-  defp put_application(params, _), do: Map.put(params, :application, %{name: "Web", website: nil})
+  defp put_application(params, _), do: Map.put(params, :application, nil)
 end
index 38960c25616a481ebb7babfc7d52091c0c47b5da..a456509883273b8f5e2729316dcc8a0e2c83a65b 100644 (file)
@@ -180,7 +180,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       media_attachments: reblogged[:media_attachments] || [],
       mentions: mentions,
       tags: reblogged[:tags] || [],
-      application: activity_object.data["application"] || %{name: "Web", website: nil},
+      application: activity_object.data["application"] || nil,
       language: nil,
       emojis: [],
       pleroma: %{
@@ -345,7 +345,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       poll: render(PollView, "show.json", object: object, for: opts[:for]),
       mentions: mentions,
       tags: build_tags(tags),
-      application: object.data["application"] || %{name: "Web", website: nil},
+      application: object.data["application"] || nil,
       language: nil,
       emojis: build_emojis(object.data["emoji"]),
       pleroma: %{
index ed59cf285652cab805ea999b225c8d672cc26975..2de3afc4fb15f59dfb3f2b58ba584409fd09f678 100644 (file)
@@ -266,10 +266,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
           url: "http://localhost:4001/tag/#{object_data["tag"]}"
         }
       ],
-      application: %{
-        name: "Web",
-        website: nil
-      },
+      application: nil,
       language: nil,
       emojis: [
         %{