logo

pleroma

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

constants.ex (2853B)


  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.Constants do
  5. use Const
  6. const(as_public, do: "https://www.w3.org/ns/activitystreams#Public")
  7. const(object_internal_fields,
  8. do: [
  9. "reactions",
  10. "reaction_count",
  11. "likes",
  12. "like_count",
  13. "announcements",
  14. "announcement_count",
  15. "emoji",
  16. "context_id",
  17. "deleted_activity_id",
  18. "pleroma_internal",
  19. "generator",
  20. "rules",
  21. "language"
  22. ]
  23. )
  24. const(static_only_files,
  25. do:
  26. ~w(index.html robots.txt static static-fe finmoji emoji packs sounds images instance sw.js sw-pleroma.js favicon.png schemas doc embed.js embed.css)
  27. )
  28. const(status_updatable_fields,
  29. do: [
  30. "source",
  31. "tag",
  32. "updated",
  33. "emoji",
  34. "content",
  35. "contentMap",
  36. "summary",
  37. "sensitive",
  38. "attachment",
  39. "generator",
  40. "language"
  41. ]
  42. )
  43. const(status_object_types,
  44. do: [
  45. "Note",
  46. "Question",
  47. "Audio",
  48. "Video",
  49. "Event",
  50. "Article",
  51. "Page"
  52. ]
  53. )
  54. const(updatable_object_types,
  55. do: [
  56. "Note",
  57. "Question",
  58. "Audio",
  59. "Video",
  60. "Event",
  61. "Article",
  62. "Page"
  63. ]
  64. )
  65. const(actor_types,
  66. do: [
  67. "Application",
  68. "Group",
  69. "Organization",
  70. "Person",
  71. "Service"
  72. ]
  73. )
  74. const(allowed_user_actor_types,
  75. do: [
  76. "Person",
  77. "Service",
  78. "Group"
  79. ]
  80. )
  81. const(activity_types,
  82. do: [
  83. "Block",
  84. "Create",
  85. "Update",
  86. "Delete",
  87. "Follow",
  88. "Accept",
  89. "Reject",
  90. "Add",
  91. "Remove",
  92. "Like",
  93. "Announce",
  94. "Undo",
  95. "Flag",
  96. "EmojiReact",
  97. "Listen"
  98. ]
  99. )
  100. const(allowed_activity_types_from_strangers,
  101. do: [
  102. "Block",
  103. "Create",
  104. "Flag",
  105. "Follow",
  106. "Like",
  107. "EmojiReact",
  108. "Announce"
  109. ]
  110. )
  111. const(object_types,
  112. do: ~w[Event Question Answer Audio Video Image Article Note Page ChatMessage]
  113. )
  114. # basic regex, just there to weed out potential mistakes
  115. # https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
  116. const(mime_regex,
  117. do: ~r/^[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+\/[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+(; .*)?$/
  118. )
  119. const(upload_object_types, do: ["Document", "Image"])
  120. const(activity_json_canonical_mime_type,
  121. do: "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
  122. )
  123. const(activity_json_mime_types,
  124. do: [
  125. "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
  126. "application/activity+json"
  127. ]
  128. )
  129. const(public_streams,
  130. do: ["public", "public:local", "public:media", "public:local:media"]
  131. )
  132. end