feature: require invites

This commit is contained in:
Andy Burke 2025-10-08 14:42:01 -07:00
parent 8b70172493
commit a3302d2eff
22 changed files with 385 additions and 482 deletions

View file

@ -41,12 +41,7 @@ type TOPIC_EVENT_CACHE_ENTRY = {
export function VALIDATE_EVENT(event: EVENT) {
const errors: any[] = [];
const {
groups: {
type,
id
}
} = /^(?<type>\w+)\:(?<id>[A-Za-z-]+)$/.exec(event.id ?? '') ?? { groups: {} };
const [type, id] = (event.id ?? '').split(':', 2);
if (typeof type !== 'string' || type.length === 0) {
errors.push({