|
|
@ -148,6 +148,7 @@ export const subProfile = (
|
|
|
|
pubkey: string,
|
|
|
|
pubkey: string,
|
|
|
|
onEvent: SubCallback,
|
|
|
|
onEvent: SubCallback,
|
|
|
|
) => {
|
|
|
|
) => {
|
|
|
|
|
|
|
|
console.info(`subscribe to profile ${pubkey}`);
|
|
|
|
unsubAll();
|
|
|
|
unsubAll();
|
|
|
|
sub({
|
|
|
|
sub({
|
|
|
|
cb: onEvent,
|
|
|
|
cb: onEvent,
|
|
|
@ -155,13 +156,17 @@ export const subProfile = (
|
|
|
|
authors: [pubkey],
|
|
|
|
authors: [pubkey],
|
|
|
|
kinds: [0],
|
|
|
|
kinds: [0],
|
|
|
|
limit: 1,
|
|
|
|
limit: 1,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const repliesTo = new Set<string>();
|
|
|
|
// get notes for profile
|
|
|
|
// get notes for profile
|
|
|
|
sub({
|
|
|
|
sub({
|
|
|
|
cb: (evt, relay) => {
|
|
|
|
cb: (evt, relay) => {
|
|
|
|
const repliesTo = new Set<string>();
|
|
|
|
if (
|
|
|
|
if (evt.tags.some(hasEventTag) && !evt.tags.some(isMention)) {
|
|
|
|
evt.tags.some(hasEventTag)
|
|
|
|
|
|
|
|
&& !evt.tags.some(isMention)
|
|
|
|
|
|
|
|
) {
|
|
|
|
const note = getReplyTo(evt);
|
|
|
|
const note = getReplyTo(evt);
|
|
|
|
if (note && !repliesTo.has(note)) {
|
|
|
|
if (note && !repliesTo.has(note)) {
|
|
|
|
repliesTo.add(note);
|
|
|
|
repliesTo.add(note);
|
|
|
@ -173,7 +178,7 @@ export const subProfile = (
|
|
|
|
kinds: [1],
|
|
|
|
kinds: [1],
|
|
|
|
limit: 1,
|
|
|
|
limit: 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onEvent(evt, relay);
|
|
|
|
onEvent(evt, relay);
|
|
|
|