mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-07 16:24:29 +01:00
only submit follow "pubkeys" that are pubkeys
This commit is contained in:
@@ -143,12 +143,16 @@ async function fetchFollows(npub: string): Promise<string[]> {
|
||||
const data = await response.json();
|
||||
|
||||
const follows: string[] = [];
|
||||
const pubkeyRegex = new RegExp(/[0-9a-fA-F]{64}/);
|
||||
|
||||
for (const event of data) {
|
||||
if (event.kind === 3) {
|
||||
for (const tag of event.tags) {
|
||||
if (tag[0] === "p") {
|
||||
follows.push(tag[1]);
|
||||
// make sure it's actually a pubkey
|
||||
if (pubkeyRegex.test(tag[1])) {
|
||||
follows.push(tag[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user