Add revoke_name admin action

This commit is contained in:
Alex Gleason 2024-06-09 19:22:11 -05:00
parent 229975a752
commit d1ba797c93
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 5 additions and 1 deletions

View File

@ -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);