mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-29 10:04:23 +01:00
Add revoke_name admin action
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user