feat: add ApVisibility (Public/FollowersOnly/Private) to broadcast_create_note and broadcast_update_note

This commit is contained in:
2026-05-29 01:15:26 +02:00
parent 4ef1315671
commit e11b0a6609
3 changed files with 51 additions and 5 deletions

View File

@@ -8,6 +8,22 @@ pub struct ApProfileField {
pub value: String,
}
/// Visibility of a federated post.
///
/// Controls the `to`/`cc` addressing fields of outbound Create/Update activities
/// and whether the library fans the activity out to followers at all.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ApVisibility {
/// `to: [AS_PUBLIC], cc: [followers]` — fully public, indexable by search engines.
#[default]
Public,
/// `to: [followers], cc: []` — only followers receive it, not indexed publicly.
FollowersOnly,
/// No federation delivery. The library returns immediately without sending anything.
/// Use when the post should exist only on the local instance.
Private,
}
/// Actor type for AP serialization. Defaults to `Person`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ApActorType {