logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

chat.ex (2493B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
  5. alias OpenApiSpex.Schema
  6. alias Pleroma.Web.ApiSpec.Schemas.ChatMessage
  7. require OpenApiSpex
  8. OpenApiSpex.schema(%{
  9. title: "Chat",
  10. description: "Response schema for a Chat",
  11. type: :object,
  12. properties: %{
  13. id: %Schema{type: :string},
  14. account: %Schema{type: :object},
  15. unread: %Schema{type: :integer},
  16. last_message: ChatMessage,
  17. updated_at: %Schema{type: :string, format: :"date-time"}
  18. },
  19. example: %{
  20. "account" => %{
  21. "pleroma" => %{
  22. "is_admin" => false,
  23. "is_confirmed" => true,
  24. "hide_followers_count" => false,
  25. "is_moderator" => false,
  26. "hide_favorites" => true,
  27. "ap_id" => "https://dontbulling.me/users/lain",
  28. "hide_follows_count" => false,
  29. "hide_follows" => false,
  30. "background_image" => nil,
  31. "skip_thread_containment" => false,
  32. "hide_followers" => false,
  33. "relationship" => %{},
  34. "tags" => []
  35. },
  36. "avatar" =>
  37. "https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
  38. "following_count" => 0,
  39. "header_static" => "https://originalpatchou.li/images/banner.png",
  40. "source" => %{
  41. "sensitive" => false,
  42. "note" => "lain",
  43. "pleroma" => %{
  44. "discoverable" => false,
  45. "actor_type" => "Person"
  46. },
  47. "fields" => []
  48. },
  49. "statuses_count" => 1,
  50. "is_locked" => false,
  51. "created_at" => "2020-04-16T13:40:15.000Z",
  52. "display_name" => "lain",
  53. "fields" => [],
  54. "acct" => "lain@dontbulling.me",
  55. "id" => "9u6Qw6TAZANpqokMkK",
  56. "emojis" => [],
  57. "avatar_static" =>
  58. "https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
  59. "username" => "lain",
  60. "followers_count" => 0,
  61. "header" => "https://originalpatchou.li/images/banner.png",
  62. "bot" => false,
  63. "note" => "lain",
  64. "url" => "https://dontbulling.me/users/lain"
  65. },
  66. "id" => "1",
  67. "unread" => 2,
  68. "last_message" => ChatMessage.schema().example(),
  69. "updated_at" => "2020-04-21T15:06:45.000Z"
  70. }
  71. })
  72. end