summary refs log tree commit diff
path: root/src/models/User.ts
diff options
context:
space:
mode:
authornotsapinho <52896767+notsapinho@users.noreply.github.com>2021-04-08 11:43:26 -0300
committernotsapinho <52896767+notsapinho@users.noreply.github.com>2021-04-08 11:43:26 -0300
commite8c097ef273100c6200c8e814965f2cb02de0bc9 (patch)
tree6cdf25485d11d7aae1a2a4efeab10e2b12ae8b86 /src/models/User.ts
parentMerge branch 'main' of https://github.com/fosscord/fosscord-server-util (diff)
downloadserver-e8c097ef273100c6200c8e814965f2cb02de0bc9.tar.xz
added toBigInt and BigInt getters to bitfields
Diffstat (limited to 'src/models/User.ts')
-rw-r--r--src/models/User.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/models/User.ts b/src/models/User.ts

index 1f01e837..8511a9b0 100644 --- a/src/models/User.ts +++ b/src/models/User.ts
@@ -2,6 +2,7 @@ import { Activity } from "./Activity"; import { ClientStatus, Status } from "./Status"; import { Schema, Types, Document } from "mongoose"; import db from "../util/Database"; +import toBigInt from "../util/toBigInt"; export const PublicUserProjection = { username: true, @@ -141,8 +142,8 @@ export const UserSchema = new Schema({ created_at: Date, verified: Boolean, email: String, - flags: Types.Long, // TODO: automatically convert Types.Long to BitField of UserFlags - public_flags: Types.Long, + flags: { type: String, get: toBigInt }, // TODO: automatically convert Types.Long to BitField of UserFlags + public_flags: { type: String, get: toBigInt }, guilds: [String], // array of guild ids the user is part of user_data: { fingerprints: [String],