feat: default to publishing posts only to outbox/inbox relays

This commit is contained in:
codytseng
2025-08-30 13:06:41 +08:00
parent 489ce67343
commit 9759e3e750
4 changed files with 6 additions and 30 deletions

View File

@@ -35,7 +35,6 @@ class ClientService extends EventTarget {
signer?: ISigner
pubkey?: string
private currentRelayUrls: string[] = []
private pool: SimplePool
private timelines: Record<
@@ -81,14 +80,6 @@ class ClientService extends EventTarget {
await indexedDb.iterateProfileEvents((profileEvent) => this.addUsernameToIndex(profileEvent))
}
setCurrentRelayUrls(urls: string[]) {
this.currentRelayUrls = urls
}
getCurrentRelayUrls() {
return this.currentRelayUrls
}
async publishEvent(relayUrls: string[], event: NEvent) {
try {
const uniqueRelayUrls = Array.from(new Set(relayUrls))
@@ -626,11 +617,7 @@ class ClientService extends EventTarget {
} = {}
) {
const relays = Array.from(new Set(urls))
const events = await this.query(
relays.length > 0 ? relays : this.currentRelayUrls.concat(BIG_RELAY_URLS),
filter,
onevent
)
const events = await this.query(relays.length > 0 ? relays : BIG_RELAY_URLS, filter, onevent)
if (cache) {
events.forEach((evt) => {
this.addEventToCache(evt)