소스 검색

Mastodon makes this field null when posting with MastoFE or if you choose to not disclose it, so it's safe to be null by default

feature/2515-admin-statuses
Mark Felder 3 년 전
부모
커밋
d5ef02c7a7
4개의 변경된 파일7개의 추가작업 그리고 9개의 파일을 삭제
  1. +3
    -2
      lib/pleroma/web/api_spec/schemas/status.ex
  2. +1
    -1
      lib/pleroma/web/mastodon_api/controllers/status_controller.ex
  3. +2
    -2
      lib/pleroma/web/mastodon_api/views/status_view.ex
  4. +1
    -4
      test/pleroma/web/mastodon_api/views/status_view_test.exs

+ 3
- 2
lib/pleroma/web/api_spec/schemas/status.ex 파일 보기

@@ -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",


+ 1
- 1
lib/pleroma/web/mastodon_api/controllers/status_controller.ex 파일 보기

@@ -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

+ 2
- 2
lib/pleroma/web/mastodon_api/views/status_view.ex 파일 보기

@@ -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: %{


+ 1
- 4
test/pleroma/web/mastodon_api/views/status_view_test.exs 파일 보기

@@ -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: [
%{


불러오는 중...
취소
저장