Skip to content

feat: broadcast notes to inbox relays of mentioned pubkeys#481

Merged
barrydeen merged 1 commit intomainfrom
feat/broadcast-mentions-to-inbox
Apr 21, 2026
Merged

feat: broadcast notes to inbox relays of mentioned pubkeys#481
barrydeen merged 1 commit intomainfrom
feat/broadcast-mentions-to-inbox

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • When publishing a kind-1 note (root or reply) that mentions pubkeys via nostr: references, also deliver the event to each mentioned pubkey's read (inbox) relays per NIP-65.
  • Inbox URLs are deduplicated across all mentioned pubkeys (and against our own write relays) so shared inboxes only receive the event once.
  • Works for both the standard publish path (ComposeViewModel) and the background PoW mining path (PowManager).

Changes

  • OutboxRouter.publishToInbox gains a Collection<String> overload that unions the read relays of every target pubkey and dedupes URLs before sending.
  • ComposeViewModel.publishNote builds inboxPubkeys = replyTo.pubkey + extractedMentions and uses it for both direct publish and PoW handoff.
  • PowManager.submitNote accepts an inboxPubkeys collection (defaulting to replyToPubkey for backwards compatibility).

Test plan

  • Publish a root note mentioning two users whose inbox relays overlap — verify the note reaches each distinct inbox relay exactly once.
  • Publish a reply that also mentions a third party — verify reply target and mentioned user both receive via their inbox relays.
  • Publish a note with PoW enabled — same checks apply after mining completes.
  • Publish a note with no mentions or reply target — behaviour unchanged (write-relays only).

When publishing a kind-1 note (root or reply) that mentions pubkeys via
nostr: references, also deliver the event to each mentioned pubkey's
read (inbox) relays per NIP-65. Inbox URLs are deduplicated across
targets and against our own write relays, so shared inboxes only
receive the event once.
@barrydeen barrydeen merged commit 499af91 into main Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant