feat: auto note removal
This commit is contained in:
parent
ee6d918d99
commit
82a7cdb204
10 changed files with 166 additions and 14 deletions
|
@ -13,6 +13,7 @@ import { DI } from '@/di-symbols.js';
|
|||
import type Logger from '@/logger.js';
|
||||
import generateUserToken from '@/misc/generate-native-user-token.js';
|
||||
import type { UsedUsernamesRepository, UsersRepository } from '@/models/_.js';
|
||||
import { MiAutoRemovalCondition } from '@/models/AutoRemovalCondition.js';
|
||||
import { MiUser } from '@/models/User.js';
|
||||
import { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import { MiUserKeypair } from '@/models/UserKeypair.js';
|
||||
|
@ -137,12 +138,20 @@ export class SignupService {
|
|||
|
||||
if (exist) throw new Error(' the username is already used');
|
||||
|
||||
const condition = await transactionalEntityManager.save(new MiAutoRemovalCondition({
|
||||
id: this.idService.gen(),
|
||||
deleteAfter: 7,
|
||||
noPiningNotes: false,
|
||||
noSpecifiedNotes: false,
|
||||
}));
|
||||
|
||||
account = await transactionalEntityManager.save(new MiUser({
|
||||
id: this.idService.gen(),
|
||||
username: username,
|
||||
usernameLower: username.toLowerCase(),
|
||||
host: this.utilityService.toPunyNullable(host),
|
||||
token: secret,
|
||||
autoRemovalConditionId: condition.id,
|
||||
isRoot: isTheFirstUser,
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue