summary refs log tree commit diff
path: root/util/src/entities
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities')
-rw-r--r--util/src/entities/Channel.ts5
-rw-r--r--util/src/entities/Config.ts36
-rw-r--r--util/src/entities/Guild.ts6
-rw-r--r--util/src/entities/Message.ts2
-rw-r--r--util/src/entities/User.ts21
5 files changed, 27 insertions, 43 deletions
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts

index 3e8cd5ef..10fa03ff 100644 --- a/util/src/entities/Channel.ts +++ b/util/src/entities/Channel.ts
@@ -108,8 +108,8 @@ export class Channel extends BaseClass { @Column({ nullable: true }) user_limit?: number; - @Column({ nullable: true }) - nsfw?: boolean; + @Column() + nsfw: boolean = false; @Column({ nullable: true }) rate_limit_per_user?: number; @@ -291,6 +291,7 @@ export class Channel extends BaseClass { (x) => new Recipient({ user_id: x, closed: !(type === ChannelType.GROUP_DM || x === creator_user_id) }) ), + nsfw: false, }).save(); } diff --git a/util/src/entities/Config.ts b/util/src/entities/Config.ts
index a1fef058..ac1af7f3 100644 --- a/util/src/entities/Config.ts +++ b/util/src/entities/Config.ts
@@ -444,38 +444,4 @@ export const DefaultConfigOptions: ConfigValue = { traceSampleRate: 1.0, environment: hostname() } -}; - - -console.log(( - Rights.FLAGS.MANAGE_GUILDS + - Rights.FLAGS.MANAGE_MESSAGES + - Rights.FLAGS.MANAGE_TICKETS + - Rights.FLAGS.MANAGE_USERS + - Rights.FLAGS.CREATE_CHANNELS + - Rights.FLAGS.CREATE_DMS + - Rights.FLAGS.CREATE_DM_GROUPS + - Rights.FLAGS.CREATE_GUILDS + - Rights.FLAGS.CREATE_INVITES + - Rights.FLAGS.CREATE_ROLES + - Rights.FLAGS.CREATE_TEMPLATES + - Rights.FLAGS.CREATE_WEBHOOKS + - Rights.FLAGS.JOIN_GUILDS + - Rights.FLAGS.PIN_MESSAGES + - Rights.FLAGS.SELF_ADD_REACTIONS + - Rights.FLAGS.SELF_DELETE_MESSAGES + - Rights.FLAGS.SELF_EDIT_MESSAGES + - Rights.FLAGS.SELF_EDIT_NAME + - Rights.FLAGS.SEND_MESSAGES + - Rights.FLAGS.USE_ACTIVITIES + - Rights.FLAGS.USE_VIDEO + - Rights.FLAGS.USE_VOICE + - Rights.FLAGS.INVITE_USERS + - Rights.FLAGS.SELF_DELETE_DISABLE + - Rights.FLAGS.DEBTABLE + - Rights.FLAGS.KICK_BAN_MEMBERS + - Rights.FLAGS.SELF_LEAVE_GROUPS + - Rights.FLAGS.SELF_ADD_DISCOVERABLE + - Rights.FLAGS.USE_ACHIEVEMENTS + - Rights.FLAGS.USE_MASS_INVITES -).toString()) \ No newline at end of file +}; \ No newline at end of file diff --git a/util/src/entities/Guild.ts b/util/src/entities/Guild.ts
index a5b732e8..143cb542 100644 --- a/util/src/entities/Guild.ts +++ b/util/src/entities/Guild.ts
@@ -267,8 +267,8 @@ export class Guild extends BaseClass { @Column({ nullable: true }) nsfw_level?: number; - @Column({ nullable: true }) - nsfw?: boolean; + @Column() + nsfw: boolean; // TODO: nested guilds @Column({ nullable: true }) @@ -335,7 +335,7 @@ export class Guild extends BaseClass { unicode_emoji: null }).save(); - if (!body.channels || !body.channels.length) body.channels = [{ id: "01", type: 0, name: "general" }]; + if (!body.channels || !body.channels.length) body.channels = [{ id: "01", type: 0, name: "general", nsfw: false }]; const ids = new Map(); diff --git a/util/src/entities/Message.ts b/util/src/entities/Message.ts
index 013e92a9..83607ed4 100644 --- a/util/src/entities/Message.ts +++ b/util/src/entities/Message.ts
@@ -122,7 +122,7 @@ export class Message extends BaseClass { timestamp: Date; @Column({ nullable: true }) - edited_timestamp?: Date; + edited_timestamp: Date; @Column({ nullable: true }) tts?: boolean; diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts
index a8f7f0c3..cac2784a 100644 --- a/util/src/entities/User.ts +++ b/util/src/entities/User.ts
@@ -30,6 +30,8 @@ export enum PrivateUserEnum { nsfw_allowed, premium, premium_type, + purchased_flags, + premium_usage_flags, disabled, settings, // locale @@ -53,8 +55,6 @@ export interface UserPrivate extends Pick<User, PrivateUserKeys> { locale: string; } -// TODO: add purchased_flags, premium_usage_flags - @Entity("users") export class User extends BaseClass { @Column() @@ -139,6 +139,12 @@ export class User extends BaseClass { @Column() public_flags: number; + @Column() + purchased_flags: number; + + @Column() + premium_usage_flags: number; + @Column({ type: "bigint" }) rights: string; // Rights @@ -281,6 +287,8 @@ export class User extends BaseClass { valid_tokens_since: new Date(), }, settings: { ...defaultSettings, locale: language }, + purchased_flags: 5, // TODO: idk what the values for this are + premium_usage_flags: 2, // TODO: idk what the values for this are extended_settings: {}, fingerprints: [], notes: {}, @@ -332,6 +340,11 @@ export const defaultSettings: UserSettings = { stream_notifications_enabled: false, theme: "dark", timezone_offset: 0, // TODO: timezone from request + + banner_color: null, + friend_discovery_flags: 0, + view_nsfw_guilds: true, + passwordless: false, }; export interface UserSettings { @@ -377,6 +390,10 @@ export interface UserSettings { stream_notifications_enabled: boolean; theme: "dark" | "white"; // dark timezone_offset: number; // e.g -60 + banner_color: string | null; + friend_discovery_flags: number; + view_nsfw_guilds: boolean; + passwordless: boolean; } export const CUSTOM_USER_FLAG_OFFSET = BigInt(1) << BigInt(32);