fix: track KeyPackage published status and subscribe to own key packages

The publish KeyPackage button was always active because the app didn't
track whether a key package had already been published. This adds:

- hasActiveKeyPackages() to KeyPackageRotationManager and MarmotManager
- hasPublishedKeyPackage() to Account, checking both in-memory bundles
  and the local cache for existing kind:30443 events
- Own key package filter in MarmotSubscriptionManager and the EOSE
  manager so previously published key packages are downloaded from
  relays on app restart
- UI feedback: primary-colored key icon when published, contextual
  empty-state message, and a spinner during publishing

https://claude.ai/code/session_01BVe7aSEWd2KLi5Ks6RZkcc
This commit is contained in:
Claude
2026-04-06 14:43:06 +00:00
parent b1f54a5c07
commit 66e6b0b726
7 changed files with 92 additions and 23 deletions
@@ -248,6 +248,12 @@ class MarmotManager(
*/
fun needsKeyPackageRotation(): Boolean = keyPackageRotationManager.needsRotation()
/**
* Check if there are active (locally generated) KeyPackages.
* Returns true if at least one KeyPackage has been generated and not yet consumed.
*/
fun hasActiveKeyPackages(): Boolean = keyPackageRotationManager.hasActiveKeyPackages()
/**
* Check if a specific group membership exists.
*/