Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions crates/buzz-core/src/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ pub const KIND_WINDOW_BOUNDS: u32 = 39006;
/// NIP-CW thread-mode query-time bounds, bound to a normalized newest-first thread request.
pub const KIND_THREAD_WINDOW_BOUNDS: u32 = 39007;

/// NIP-CL: request-bound compact viewer membership overlay; query-time only, never stored.
pub const KIND_MEMBERSHIP_SNAPSHOT: u32 = 39008;

/// NIP-CL: request-bound public membership overlay; query-time only, never stored.
pub const KIND_MEMBERSHIP_PUBLIC: u32 = 39009;

/// Workflow definition (parameterized replaceable, d=workflow_uuid).
pub const KIND_WORKFLOW_DEF: u32 = 30620;

Expand Down Expand Up @@ -747,6 +753,8 @@ pub const ALL_KINDS: &[u32] = &[
KIND_THREAD_SUMMARY,
KIND_WINDOW_BOUNDS,
KIND_THREAD_WINDOW_BOUNDS,
KIND_MEMBERSHIP_SNAPSHOT,
KIND_MEMBERSHIP_PUBLIC,
KIND_PRESENCE_UPDATE,
KIND_TYPING_INDICATOR,
KIND_AGENT_PRESENCE,
Expand Down Expand Up @@ -902,6 +910,8 @@ pub const fn is_relay_only_kind(kind: u32) -> bool {
| KIND_THREAD_SUMMARY
| KIND_WINDOW_BOUNDS
| KIND_THREAD_WINDOW_BOUNDS
| KIND_MEMBERSHIP_SNAPSHOT
| KIND_MEMBERSHIP_PUBLIC
)
}

Expand Down Expand Up @@ -985,6 +995,15 @@ mod tests {
assert!(is_relay_only_kind(KIND_THREAD_WINDOW_BOUNDS));
}

#[test]
fn compact_membership_snapshot_is_relay_only() {
assert_eq!(KIND_MEMBERSHIP_SNAPSHOT, 39008);
assert!(is_relay_only_kind(KIND_MEMBERSHIP_SNAPSHOT));
assert_eq!(KIND_MEMBERSHIP_PUBLIC, 39009);
assert!(is_relay_only_kind(KIND_MEMBERSHIP_PUBLIC));
assert!(ALL_KINDS.contains(&KIND_MEMBERSHIP_PUBLIC));
}

#[test]
fn parameterized_replaceable_range() {
assert!(!is_parameterized_replaceable(29999));
Expand Down
Loading
Loading