hellthread: only apply to event1
This commit is contained in:
parent
1d3bc34b91
commit
b3c13ca72e
@ -28,21 +28,23 @@ interface Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMessage(msg: InputMessage): OutputMessage {
|
function handleMessage(msg: InputMessage): OutputMessage {
|
||||||
const p = msg.event.tags.filter((tag) => tag[0] === 'p');
|
if (msg.event.kind === 1) {
|
||||||
|
const p = msg.event.tags.filter((tag) => tag[0] === 'p');
|
||||||
|
|
||||||
if (p.length > HELLTHREAD_LIMIT) {
|
if (p.length > HELLTHREAD_LIMIT) {
|
||||||
return {
|
return {
|
||||||
id: msg.event.id,
|
id: msg.event.id,
|
||||||
action: 'reject',
|
action: 'reject',
|
||||||
msg: `Event rejected due to ${p.length} "p" tags (${HELLTHREAD_LIMIT} is the limit).`,
|
msg: `Event rejected due to ${p.length} "p" tags (${HELLTHREAD_LIMIT} is the limit).`,
|
||||||
};
|
};
|
||||||
} else {
|
}
|
||||||
return {
|
|
||||||
id: msg.event.id,
|
|
||||||
action: 'accept',
|
|
||||||
msg: '',
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: msg.event.id,
|
||||||
|
action: 'accept',
|
||||||
|
msg: '',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
for await (const line of readLines(Deno.stdin)) {
|
for await (const line of readLines(Deno.stdin)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user