notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit a7acfa3191ce8c6e6368f8e3b5b26f1fdcfa783c
parent 22d9b2bc48b6b8264abdb1ee8e8bc6f92a1baa9e
Author: kernelkind <kernelkind@gmail.com>
Date:   Thu, 19 Feb 2026 20:55:00 -0500

feat(scoped-sub): add scoped sub owner keys

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck_columns/src/lib.rs | 1+
Acrates/notedeck_columns/src/scoped_sub_owner_keys.rs | 41+++++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/crates/notedeck_columns/src/lib.rs b/crates/notedeck_columns/src/lib.rs @@ -23,6 +23,7 @@ mod post; mod profile; mod repost; mod route; +mod scoped_sub_owner_keys; mod search; mod subscriptions; mod support; diff --git a/crates/notedeck_columns/src/scoped_sub_owner_keys.rs b/crates/notedeck_columns/src/scoped_sub_owner_keys.rs @@ -0,0 +1,41 @@ +use enostr::{NoteId, Pubkey}; +use notedeck::SubOwnerKey; + +use crate::timeline::TimelineKind; + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +enum ColumnsOwner { + OnboardingFollowPacks, + ThreadScope, + TimelineRemote, +} + +/// Stable owner key for onboarding follow-pack scoped subscriptions. +pub fn onboarding_owner_key(col: usize) -> SubOwnerKey { + SubOwnerKey::builder(ColumnsOwner::OnboardingFollowPacks) + .with(col) + .finish() +} + +/// Stable owner key for one thread scope within one column and account. +pub fn thread_scope_owner_key( + account_pk: Pubkey, + col: usize, + root_id: &NoteId, + scope_depth: usize, +) -> SubOwnerKey { + SubOwnerKey::builder(ColumnsOwner::ThreadScope) + .with(account_pk) + .with(col) + .with(*root_id.bytes()) + .with(scope_depth) + .finish() +} + +/// Stable owner key for timeline remote subscriptions per account/kind pair. +pub fn timeline_remote_owner_key(account_pk: Pubkey, kind: &TimelineKind) -> SubOwnerKey { + SubOwnerKey::builder(ColumnsOwner::TimelineRemote) + .with(account_pk) + .with(kind) + .finish() +}