From e1ad51c8a903c394c91bac59e84275f69b838ee3 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 11 Nov 2024 10:25:54 -0800 Subject: [PATCH] Expand number of relays used to request messages --- src/engine/requests.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/engine/requests.ts b/src/engine/requests.ts index 271e7284..7b9a90cf 100644 --- a/src/engine/requests.ts +++ b/src/engine/requests.ts @@ -287,7 +287,10 @@ export const loadFeedsAndLists = () => export const loadMessages = () => pullConservatively({ - relays: ctx.app.router.UserInbox().getUrls(), + // TODO, stop using non-inbox relays + relays: ctx.app.router + .merge([ctx.app.router.ForUser(), ctx.app.router.FromUser(), ctx.app.router.UserInbox()]) + .getUrls(), filters: [ {kinds: [DEPRECATED_DIRECT_MESSAGE], authors: [pubkey.get()]}, {kinds: [DEPRECATED_DIRECT_MESSAGE, WRAP], "#p": [pubkey.get()]}, @@ -300,7 +303,14 @@ export const listenForMessages = (pubkeys: string[]) => { return subscribePersistent({ skipCache: true, forcePlatform: false, - relays: ctx.app.router.PubkeyInboxes(pubkeys).getUrls(), + // TODO, stop using non-inbox relays + relays: ctx.app.router + .merge([ + ctx.app.router.ForPubkeys(pubkeys), + ctx.app.router.FromPubkeys(pubkeys), + ctx.app.router.PubkeyInboxes(pubkeys), + ]) + .getUrls(), filters: [ {kinds: [DEPRECATED_DIRECT_MESSAGE], authors: allPubkeys, "#p": allPubkeys}, {kinds: [WRAP], "#p": [pubkey.get()]},