style(cli): import NormalizedRelayUrl + Amethyst defaults instead of inlining FQNs
This commit is contained in:
@@ -23,6 +23,8 @@ package com.vitorpamplona.amethyst.cli
|
|||||||
import com.vitorpamplona.amethyst.cli.stores.FileKeyPackageBundleStore
|
import com.vitorpamplona.amethyst.cli.stores.FileKeyPackageBundleStore
|
||||||
import com.vitorpamplona.amethyst.cli.stores.FileMarmotMessageStore
|
import com.vitorpamplona.amethyst.cli.stores.FileMarmotMessageStore
|
||||||
import com.vitorpamplona.amethyst.cli.stores.FileMlsGroupStateStore
|
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.MarmotManager
|
||||||
import com.vitorpamplona.amethyst.commons.marmot.ingest
|
import com.vitorpamplona.amethyst.commons.marmot.ingest
|
||||||
import com.vitorpamplona.quartz.marmot.MarmotFilters
|
import com.vitorpamplona.quartz.marmot.MarmotFilters
|
||||||
@@ -139,8 +141,8 @@ class Context(
|
|||||||
fun bootstrapRelays(): Set<NormalizedRelayUrl> =
|
fun bootstrapRelays(): Set<NormalizedRelayUrl> =
|
||||||
buildSet {
|
buildSet {
|
||||||
addAll(anyRelays())
|
addAll(anyRelays())
|
||||||
addAll(com.vitorpamplona.amethyst.commons.defaults.DefaultNIP65RelaySet)
|
addAll(DefaultNIP65RelaySet)
|
||||||
addAll(com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList)
|
addAll(DefaultDMRelayList)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+4
-2
@@ -23,8 +23,10 @@ package com.vitorpamplona.amethyst.cli.commands
|
|||||||
import com.vitorpamplona.amethyst.cli.Context
|
import com.vitorpamplona.amethyst.cli.Context
|
||||||
import com.vitorpamplona.amethyst.cli.DataDir
|
import com.vitorpamplona.amethyst.cli.DataDir
|
||||||
import com.vitorpamplona.amethyst.cli.Json
|
import com.vitorpamplona.amethyst.cli.Json
|
||||||
|
import com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList
|
||||||
import com.vitorpamplona.quartz.marmot.RecipientRelayFetcher
|
import com.vitorpamplona.quartz.marmot.RecipientRelayFetcher
|
||||||
import com.vitorpamplona.quartz.marmot.mip00KeyPackages.KeyPackageFetcher
|
import com.vitorpamplona.quartz.marmot.mip00KeyPackages.KeyPackageFetcher
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `group add <group_id> <npub> [<npub> ...]` — fetch each invitee's
|
* `group add <group_id> <npub> [<npub> ...]` — fetch each invitee's
|
||||||
@@ -108,7 +110,7 @@ object GroupAddMemberCommand {
|
|||||||
// Order matters: commit first (so invitee doesn't join at a future epoch),
|
// Order matters: commit first (so invitee doesn't join at a future epoch),
|
||||||
// then welcome.
|
// then welcome.
|
||||||
val commitAck = ctx.publish(commitEvent.signedEvent, groupRelays)
|
val commitAck = ctx.publish(commitEvent.signedEvent, groupRelays)
|
||||||
val welcomeTargets: Set<com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl> =
|
val welcomeTargets: Set<NormalizedRelayUrl> =
|
||||||
if (welcomeDelivery != null) {
|
if (welcomeDelivery != null) {
|
||||||
// Welcome gift wrap (kind:1059 wrapping kind:444) must
|
// Welcome gift wrap (kind:1059 wrapping kind:444) must
|
||||||
// land on a relay the invitee actually polls for their
|
// land on a relay the invitee actually polls for their
|
||||||
@@ -124,7 +126,7 @@ object GroupAddMemberCommand {
|
|||||||
buildSet {
|
buildSet {
|
||||||
addAll(recipient.dmInboxOrFallback())
|
addAll(recipient.dmInboxOrFallback())
|
||||||
if (isEmpty()) {
|
if (isEmpty()) {
|
||||||
addAll(com.vitorpamplona.amethyst.commons.defaults.DefaultDMRelayList)
|
addAll(DefaultDMRelayList)
|
||||||
}
|
}
|
||||||
addAll(ctx.outboxRelays())
|
addAll(ctx.outboxRelays())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user