fix(nests): broadcast presence/chat to the linked room's full relay list

Hand-raise toggles in Amethyst weren't appearing in nostrnests's UI.

nostrnests's NestsUI v2 routes reads against a fixed five-relay list
(NestsUI-v2/src/lib/const.ts: relay.snort.social, nos.lol, relay.damus.io,
relay.ditto.pub, relay.primal.net) — no outbox model. Its presence query
is just `kinds:[10312], "#a":[roomATag]` over those five relays.

Commit 637174ef already taught computeRelayListToBroadcast to fan a kind
30312 *room* event out to its `relays` tag. But kind 10312 presence (and
chat / reactions, etc.) is a different event type that *links* to the
room via an `a` tag. For those, broadcast was only reaching:

  - the broadcaster's outbox relays
  - the single firstOrNull() hint baked into the `a` tag
  - the relay we happened to receive the room event from

If none of those overlap with nostrnests's fixed five reads, the
hand-raise update is silently dropped.

Extend the `linkedAddressIds` block in computeRelayListToBroadcast: when
the linked address resolves to a MeetingSpaceEvent / MeetingRoomEvent /
LiveActivitiesEvent, also add that linked event's allRelayUrls(). This
covers presence updates and any other room-scoped event that points at
a Nest via `#a`.

https://claude.ai/code/session_016G7oP5BotPjUBgvMYrrrxh
This commit is contained in:
Claude
2026-04-29 21:36:23 +00:00
parent f63e3b1c67
commit b0e7c62bb5
@@ -195,6 +195,7 @@ import com.vitorpamplona.quartz.nip47WalletConnect.rpc.Request
import com.vitorpamplona.quartz.nip47WalletConnect.rpc.Response
import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent
import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.AddressBookmark
import com.vitorpamplona.quartz.nip53LiveActivities.meetingSpaces.MeetingRoomEvent
import com.vitorpamplona.quartz.nip53LiveActivities.meetingSpaces.MeetingSpaceEvent
import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent
import com.vitorpamplona.quartz.nip56Reports.ReportType
@@ -1002,6 +1003,20 @@ class Account(
linkedNote.event?.let { linkedEvent ->
relayList.addAll(computeRelaysForChannels(linkedEvent))
// Audio rooms / live activities pin their relay set
// on the room event itself. Presence (kind 10312) and
// any other event whose `a` tag points at one of these
// must also fan out to that relay list — otherwise a
// hand-raise / mute / publishing update only reaches
// the broadcaster's outbox + the single firstOrNull()
// hint baked into the `a` tag, and a fixed-relay
// listener like nostrnests never sees it.
when (linkedEvent) {
is MeetingSpaceEvent -> relayList.addAll(linkedEvent.allRelayUrls())
is MeetingRoomEvent -> relayList.addAll(linkedEvent.allRelayUrls())
is LiveActivitiesEvent -> relayList.addAll(linkedEvent.allRelayUrls())
}
}
}
}