Support "Public" audience identifier

This commit is contained in:
silverpill 2023-01-17 00:51:17 +00:00
parent 5064afd766
commit 7b8a56dd8f
2 changed files with 6 additions and 2 deletions

View file

@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Added `/api/v1/settings/import_follows` API endpoint.
- Validation of Monero subscription payout address.
- Accept webfinger requests where `resource` is actor ID.
- Adeed support for `as:Public` audience identifier.
- Adeed support for `as:Public` and `Public` audience identifiers.
### Changed

View file

@ -105,7 +105,11 @@ fn get_note_visibility(
) -> Visibility {
let audience = [primary_audience, secondary_audience].concat();
// Some servers (e.g. Takahe) use "as" namespace
const PUBLIC_VARIANTS: [&str; 2] = [AP_PUBLIC, "as:Public"];
const PUBLIC_VARIANTS: [&str; 3] = [
AP_PUBLIC,
"as:Public",
"Public",
];
if audience.iter().any(|item| PUBLIC_VARIANTS.contains(&item.as_str())) {
return Visibility::Public;
};