From ecc157360639b157dca50cf8ce3802acba9126b3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Apr 2026 21:36:23 +0000 Subject: [PATCH] fix(nests): broadcast presence/chat to the linked room's full relay list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../com/vitorpamplona/amethyst/model/Account.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 981a776fa..fa65a3aa9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -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()) + } } } }