mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fetch profiles separately from notes
This commit is contained in:
parent
a00db2f4c1
commit
5f0b1ffe79
1 changed files with 5 additions and 3 deletions
|
|
@ -32,9 +32,11 @@ const importUsers = async (
|
||||||
await Promise.all(relays.map(async (relay) => {
|
await Promise.all(relays.map(async (relay) => {
|
||||||
if (!relay.startsWith('wss://')) console.error(`Invalid relay url ${relay}`);
|
if (!relay.startsWith('wss://')) console.error(`Invalid relay url ${relay}`);
|
||||||
const conn = new NRelay1(relay);
|
const conn = new NRelay1(relay);
|
||||||
const kinds = [0, 3];
|
|
||||||
if (!profilesOnly) kinds.push(1);
|
const matched = [
|
||||||
const matched = await conn.query([{ kinds, authors, limit: 1000 }]);
|
...await conn.query([{ kinds: [0, 3], authors, limit: 1000 }]),
|
||||||
|
...(!profilesOnly ? [] : await conn.query([{ kinds: [1], authors, limit: 1000 }])),
|
||||||
|
];
|
||||||
await conn.close();
|
await conn.close();
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
matched.map(async (event) => {
|
matched.map(async (event) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue