From d1ba797c93f080545713d03f3b9e37bffc3be9d5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 9 Jun 2024 19:22:11 -0500 Subject: [PATCH] Add revoke_name admin action --- src/controllers/api/admin.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/admin.ts b/src/controllers/api/admin.ts index f61b389..bcc40ce 100644 --- a/src/controllers/api/admin.ts +++ b/src/controllers/api/admin.ts @@ -109,7 +109,7 @@ const adminAccountsController: AppController = async (c) => { }; const adminAccountActionSchema = z.object({ - type: z.enum(['none', 'sensitive', 'disable', 'silence', 'suspend']), + type: z.enum(['none', 'sensitive', 'disable', 'silence', 'suspend', 'revoke_name']), }); const adminActionController: AppController = async (c) => { @@ -139,6 +139,10 @@ const adminActionController: AppController = async (c) => { n.suspended = true; store.remove([{ authors: [authorId] }]).catch(console.warn); } + if (data.type === 'revoke_name') { + n.revoke_name = true; + store.remove([{ kinds: [30360], authors: [Conf.pubkey], '#p': [authorId] }]).catch(console.warn); + } await updateUser(authorId, n, c);