2019-07-29 02:43:19 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-02 20:38:50 +00:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2019-07-29 02:43:19 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Constants do
|
|
|
|
use Const
|
|
|
|
|
|
|
|
const(as_public, do: "https://www.w3.org/ns/activitystreams#Public")
|
2019-09-18 16:24:20 +00:00
|
|
|
|
|
|
|
const(object_internal_fields,
|
|
|
|
do: [
|
2019-09-30 11:57:54 +00:00
|
|
|
"reactions",
|
2019-09-30 13:13:05 +00:00
|
|
|
"reaction_count",
|
2019-09-18 16:24:20 +00:00
|
|
|
"likes",
|
|
|
|
"like_count",
|
|
|
|
"announcements",
|
|
|
|
"announcement_count",
|
|
|
|
"emoji",
|
|
|
|
"context_id",
|
2020-05-13 21:14:24 +00:00
|
|
|
"deleted_activity_id",
|
2021-02-12 19:05:12 +00:00
|
|
|
"pleroma_internal",
|
2021-03-01 17:29:10 +00:00
|
|
|
"generator"
|
2019-09-18 16:24:20 +00:00
|
|
|
]
|
|
|
|
)
|
2020-05-01 19:15:43 +00:00
|
|
|
|
|
|
|
const(static_only_files,
|
|
|
|
do:
|
2020-06-01 13:38:57 +00:00
|
|
|
~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)
|
2020-05-01 19:15:43 +00:00
|
|
|
)
|
2022-05-31 18:29:12 +00:00
|
|
|
|
|
|
|
const(status_updatable_fields,
|
|
|
|
do: [
|
|
|
|
"source",
|
|
|
|
"tag",
|
|
|
|
"updated",
|
|
|
|
"emoji",
|
|
|
|
"content",
|
|
|
|
"summary",
|
|
|
|
"sensitive",
|
|
|
|
"attachment",
|
|
|
|
"generator"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2023-06-20 14:14:01 +00:00
|
|
|
const(status_object_types,
|
|
|
|
do: [
|
|
|
|
"Note",
|
|
|
|
"Question",
|
|
|
|
"Audio",
|
|
|
|
"Video",
|
|
|
|
"Event",
|
|
|
|
"Article",
|
|
|
|
"Page"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2022-06-25 15:20:46 +00:00
|
|
|
const(updatable_object_types,
|
|
|
|
do: [
|
|
|
|
"Note",
|
|
|
|
"Question",
|
|
|
|
"Audio",
|
|
|
|
"Video",
|
|
|
|
"Event",
|
|
|
|
"Article",
|
|
|
|
"Page"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2022-05-31 18:29:12 +00:00
|
|
|
const(actor_types,
|
|
|
|
do: [
|
|
|
|
"Application",
|
|
|
|
"Group",
|
|
|
|
"Organization",
|
|
|
|
"Person",
|
|
|
|
"Service"
|
|
|
|
]
|
|
|
|
)
|
2022-07-03 22:24:57 +00:00
|
|
|
|
2022-01-09 19:00:12 +00:00
|
|
|
# basic regex, just there to weed out potential mistakes
|
|
|
|
# https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
|
|
|
|
const(mime_regex,
|
|
|
|
do: ~r/^[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+\/[^[:cntrl:] ()<>@,;:\\"\/\[\]?=]+(; .*)?$/
|
|
|
|
)
|
2023-07-18 22:39:59 +00:00
|
|
|
|
|
|
|
const(upload_object_types, do: ["Document", "Image"])
|
2023-07-12 15:09:10 +00:00
|
|
|
|
2023-07-12 18:27:29 +00:00
|
|
|
const(activity_json_canonical_mime_type,
|
|
|
|
do: "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
|
|
|
|
)
|
|
|
|
|
2023-07-12 15:09:10 +00:00
|
|
|
const(activity_json_mime_types,
|
|
|
|
do: [
|
|
|
|
"application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
|
|
|
|
"application/activity+json"
|
|
|
|
]
|
|
|
|
)
|
2019-07-29 02:43:19 +00:00
|
|
|
end
|