summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/models')
-rw-r--r--src/models/entities/user-profile.ts12
-rw-r--r--src/models/repositories/user.ts4
2 files changed, 15 insertions, 1 deletions
diff --git a/src/models/entities/user-profile.ts b/src/models/entities/user-profile.ts
index 4fab52868f..3a9043fac6 100644
--- a/src/models/entities/user-profile.ts
+++ b/src/models/entities/user-profile.ts
@@ -4,6 +4,8 @@ import { User } from './user';
import { Page } from './page';
import { notificationTypes } from '../../types';
+// TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも
+// ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン
@Entity()
export class UserProfile {
@PrimaryColumn(id())
@@ -42,6 +44,11 @@ export class UserProfile {
}[];
@Column('varchar', {
+ length: 32, nullable: true,
+ })
+ public lang: string | null;
+
+ @Column('varchar', {
length: 512, nullable: true,
comment: 'Remote URL of the user.'
})
@@ -63,6 +70,11 @@ export class UserProfile {
})
public emailVerified: boolean;
+ @Column('jsonb', {
+ default: ['follow', 'receiveFollowRequest', 'groupInvited']
+ })
+ public emailNotificationTypes: string[];
+
@Column('varchar', {
length: 128, nullable: true,
})
diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts
index 88861224a4..a3453b1aa6 100644
--- a/src/models/repositories/user.ts
+++ b/src/models/repositories/user.ts
@@ -213,6 +213,7 @@ export class UserRepository extends Repository<User> {
description: profile!.description,
location: profile!.location,
birthday: profile!.birthday,
+ lang: profile!.lang,
fields: profile!.fields,
followersCount: user.followersCount,
followingCount: user.followingCount,
@@ -258,7 +259,8 @@ export class UserRepository extends Repository<User> {
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
integrations: profile!.integrations,
mutedWords: profile!.mutedWords,
- mutingNotificationTypes: profile?.mutingNotificationTypes,
+ mutingNotificationTypes: profile!.mutingNotificationTypes,
+ emailNotificationTypes: profile!.emailNotificationTypes,
} : {}),
...(opts.includeSecrets ? {