Skip to content

Commit

Permalink
Expand number of relays used to request messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Staab committed Nov 11, 2024
1 parent ce467fc commit e1ad51c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/engine/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()]},
Expand All @@ -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()]},
Expand Down

0 comments on commit e1ad51c

Please sign in to comment.