From 5289fa3398da91e35f2e176ebf41eec7cca12752 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 22:04:30 +0000 Subject: [PATCH] style(cli): import NormalizedRelayUrl + Amethyst defaults instead of inlining FQNs --- .../main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt | 6 ++++-- .../amethyst/cli/commands/GroupAddMemberCommand.kt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt index 24e6c9dd0..b08b3236a 100644 --- a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt +++ b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt @@ -23,6 +23,8 @@ package com.vitorpamplona.amethyst.cli import com.vitorpamplona.amethyst.cli.stores.FileKeyPackageBundleStore import com.vitorpamplona.amethyst.cli.stores.FileMarmotMessageStore import com.vitorpamplona.amethyst.cli.stores.FileMlsGroupStateStore +import com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList +import com.vitorpamplona.amethyst.commons.defaults.DefaultNIP65RelaySet import com.vitorpamplona.amethyst.commons.marmot.MarmotManager import com.vitorpamplona.amethyst.commons.marmot.ingest import com.vitorpamplona.quartz.marmot.MarmotFilters @@ -139,8 +141,8 @@ class Context( fun bootstrapRelays(): Set = buildSet { addAll(anyRelays()) - addAll(com.vitorpamplona.amethyst.commons.defaults.DefaultNIP65RelaySet) - addAll(com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList) + addAll(DefaultNIP65RelaySet) + addAll(DefaultDMRelayList) } /** diff --git a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/GroupAddMemberCommand.kt b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/GroupAddMemberCommand.kt index effd7c9c7..ab18c5556 100644 --- a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/GroupAddMemberCommand.kt +++ b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/GroupAddMemberCommand.kt @@ -23,8 +23,10 @@ package com.vitorpamplona.amethyst.cli.commands import com.vitorpamplona.amethyst.cli.Context import com.vitorpamplona.amethyst.cli.DataDir import com.vitorpamplona.amethyst.cli.Json +import com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList import com.vitorpamplona.quartz.marmot.RecipientRelayFetcher import com.vitorpamplona.quartz.marmot.mip00KeyPackages.KeyPackageFetcher +import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl /** * `group add [ ...]` — fetch each invitee's @@ -108,7 +110,7 @@ object GroupAddMemberCommand { // Order matters: commit first (so invitee doesn't join at a future epoch), // then welcome. val commitAck = ctx.publish(commitEvent.signedEvent, groupRelays) - val welcomeTargets: Set = + val welcomeTargets: Set = if (welcomeDelivery != null) { // Welcome gift wrap (kind:1059 wrapping kind:444) must // land on a relay the invitee actually polls for their @@ -124,7 +126,7 @@ object GroupAddMemberCommand { buildSet { addAll(recipient.dmInboxOrFallback()) if (isEmpty()) { - addAll(com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList) + addAll(DefaultDMRelayList) } addAll(ctx.outboxRelays()) }