logo

pleroma

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

constants.ex (2781B)


  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. ]
  22. )
  23. const(static_only_files,
  24. do:
  25. ~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)
  26. )
  27. const(status_updatable_fields,
  28. do: [
  29. "source",
  30. "tag",
  31. "updated",
  32. "emoji",
  33. "content",
  34. "summary",
  35. "sensitive",
  36. "attachment",
  37. "generator"
  38. ]
  39. )
  40. const(status_object_types,
  41. do: [
  42. "Note",
  43. "Question",
  44. "Audio",
  45. "Video",
  46. "Event",
  47. "Article",
  48. "Page"
  49. ]
  50. )
  51. const(updatable_object_types,
  52. do: [
  53. "Note",
  54. "Question",
  55. "Audio",
  56. "Video",
  57. "Event",
  58. "Article",
  59. "Page"
  60. ]
  61. )
  62. const(actor_types,
  63. do: [
  64. "Application",
  65. "Group",
  66. "Organization",
  67. "Person",
  68. "Service"
  69. ]
  70. )
  71. const(allowed_user_actor_types,
  72. do: [
  73. "Person",
  74. "Service",
  75. "Group"
  76. ]
  77. )
  78. const(activity_types,
  79. do: [
  80. "Block",
  81. "Create",
  82. "Update",
  83. "Delete",
  84. "Follow",
  85. "Accept",
  86. "Reject",
  87. "Add",
  88. "Remove",
  89. "Like",
  90. "Announce",
  91. "Undo",
  92. "Flag",
  93. "EmojiReact"
  94. ]
  95. )
  96. const(allowed_activity_types_from_strangers,
  97. do: [
  98. "Block",
  99. "Create",
  100. "Flag",
  101. "Follow",
  102. "Like",
  103. "EmojiReact",
  104. "Announce"
  105. ]
  106. )
  107. const(object_types,
  108. do: ~w[Event Question Answer Audio Video Image Article Note Page ChatMessage]
  109. )
  110. # basic regex, just there to weed out potential mistakes
  111. # https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
  112. const(mime_regex,
  113. do: ~r/^[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+\/[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+(; .*)?$/
  114. )
  115. const(upload_object_types, do: ["Document", "Image"])
  116. const(activity_json_canonical_mime_type,
  117. do: "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
  118. )
  119. const(activity_json_mime_types,
  120. do: [
  121. "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
  122. "application/activity+json"
  123. ]
  124. )
  125. const(public_streams,
  126. do: ["public", "public:local", "public:media", "public:local:media"]
  127. )
  128. end