diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-31 17:25:28 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-31 17:51:57 +1100 |
commit | 0fe03771ce2a03915c266a0d4d34f2c11b229123 (patch) | |
tree | 54d54db84fc0ebd6c992b13dbd36ddb05b009eb4 /src/util | |
parent | Merge branch 'maddy/refactor' into maddy/bodyParserPatch (diff) | |
download | server-0fe03771ce2a03915c266a0d4d34f2c11b229123.tar.xz |
Profile themes and pronouns
Diffstat (limited to '')
-rw-r--r-- | src/util/config/types/subconfigurations/defaults/UserDefaults.ts | 4 | ||||
-rw-r--r-- | src/util/entities/Member.ts | 6 | ||||
-rw-r--r-- | src/util/entities/User.ts | 11 | ||||
-rw-r--r-- | src/util/schemas/MemberChangeProfileSchema.ts | 6 | ||||
-rw-r--r-- | src/util/schemas/UserProfileModifySchema.ts | 6 |
5 files changed, 30 insertions, 3 deletions
diff --git a/src/util/config/types/subconfigurations/defaults/UserDefaults.ts b/src/util/config/types/subconfigurations/defaults/UserDefaults.ts index 4481c011..f20a14b6 100644 --- a/src/util/config/types/subconfigurations/defaults/UserDefaults.ts +++ b/src/util/config/types/subconfigurations/defaults/UserDefaults.ts @@ -1,5 +1,5 @@ export class UserDefaults { - premium: boolean = false; - premium_type: number = 2; + premium: boolean = true; + premiumType: number = 2; verified: boolean = true; } \ No newline at end of file diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts index bffec326..eeae181e 100644 --- a/src/util/entities/Member.ts +++ b/src/util/entities/Member.ts @@ -125,6 +125,12 @@ export class Member extends BaseClassWithoutId { @Column() bio: string; + + @Column({ nullable: true, type: "simple-array" }) + theme_colors?: number[]; // TODO: Separate `User` and `UserProfile` models + + @Column({ nullable: true }) + pronouns?: string; @Column({ nullable: true }) communication_disabled_until: Date; diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index eeffab5b..e039eb17 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -34,6 +34,9 @@ export enum PublicUserEnum { bio, bot, premium_since, + premium_type, + theme_colors, + pronouns, } export type PublicUserKeys = keyof typeof PublicUserEnum; @@ -88,6 +91,12 @@ export class User extends BaseClass { @Column({ nullable: true }) banner?: string; // hash of the user banner + @Column({ nullable: true, type: "simple-array" }) + theme_colors?: number[]; // TODO: Separate `User` and `UserProfile` models + + @Column({ nullable: true }) + pronouns?: string; + @Column({ nullable: true, select: false }) phone?: string; // phone number of the user @@ -351,7 +360,7 @@ export class User extends BaseClass { valid_tokens_since: new Date(), }, extended_settings: "{}", - premium_type: Config.get().defaults.user.premium_type, + premium_type: Config.get().defaults.user.premiumType, premium: Config.get().defaults.user.premium, verified: Config.get().defaults.user.verified, settings: settings, diff --git a/src/util/schemas/MemberChangeProfileSchema.ts b/src/util/schemas/MemberChangeProfileSchema.ts index 3e85174d..73c852f3 100644 --- a/src/util/schemas/MemberChangeProfileSchema.ts +++ b/src/util/schemas/MemberChangeProfileSchema.ts @@ -2,4 +2,10 @@ export interface MemberChangeProfileSchema { banner?: string | null; nick?: string; bio?: string; + pronouns?: string; + + /* + * @items.type integer + */ + theme_colors?: [number, number]; } diff --git a/src/util/schemas/UserProfileModifySchema.ts b/src/util/schemas/UserProfileModifySchema.ts index 33a372c9..1e53d9e4 100644 --- a/src/util/schemas/UserProfileModifySchema.ts +++ b/src/util/schemas/UserProfileModifySchema.ts @@ -2,4 +2,10 @@ export interface UserProfileModifySchema { bio?: string; accent_color?: number | null; banner?: string | null; + pronouns?: string; + + /* + * @items.type integer + */ + theme_colors?: [number, number] } |