From 7b8a56dd8fc79a65d7b92b5c89abda8a12010f2c Mon Sep 17 00:00:00 2001 From: silverpill Date: Tue, 17 Jan 2023 00:51:17 +0000 Subject: [PATCH] Support "Public" audience identifier --- CHANGELOG.md | 2 +- src/activitypub/handlers/create.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2066882..b4aecf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/activitypub/handlers/create.rs b/src/activitypub/handlers/create.rs index 9c08c6b..f1c75e4 100644 --- a/src/activitypub/handlers/create.rs +++ b/src/activitypub/handlers/create.rs @@ -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; };