summary refs log tree commit diff
path: root/util/src
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-03-05 17:49:23 +0300
committerGitHub <noreply@github.com>2022-03-05 17:49:23 +0300
commitf972bfc5287b492556eb05582bc6741e0d59b820 (patch)
tree63f855ae36294319352c5e826c400046a6c6318c /util/src
parentAdded email sanitisation to /users/@me PATCH. Could previously have email as ... (diff)
parentdocument which field is which (diff)
downloadserver-f972bfc5287b492556eb05582bc6741e0d59b820.tar.xz
Merge branch 'master' into fix/claim_accounts
Diffstat (limited to 'util/src')
-rw-r--r--util/src/entities/Member.ts4
-rw-r--r--util/src/entities/ReadState.ts11
-rw-r--r--util/src/entities/User.ts5
3 files changed, 17 insertions, 3 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index 0f7be2a7..3c5f9db0 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -86,7 +86,7 @@ export class Member extends BaseClassWithoutId {
 	joined_at: Date;
 
 	@Column({ nullable: true })
-	premium_since?: number;
+	premium_since?: Date;
 
 	@Column()
 	deaf: boolean;
@@ -245,7 +245,7 @@ export class Member extends BaseClassWithoutId {
 			nick: undefined,
 			roles: [guild_id], // @everyone role
 			joined_at: new Date(),
-			premium_since: undefined,
+			premium_since: new Date(),
 			deaf: false,
 			mute: false,
 			pending: false,
diff --git a/util/src/entities/ReadState.ts b/util/src/entities/ReadState.ts
index ebef89be..e6d73105 100644
--- a/util/src/entities/ReadState.ts
+++ b/util/src/entities/ReadState.ts
@@ -31,8 +31,17 @@ export class ReadState extends BaseClass {
 	})
 	user: User;
 
+	// fully read marker
 	@Column({ nullable: true })
-	last_message_id: string;
+	last_message_id: string; 
+	
+	// public read receipt
+	@Column({ nullable: true })
+	public_ack: string;
+
+	// notification cursor / private read receipt
+	@Column({ nullable: true })
+	notifications_cursor: string;
 
 	@Column({ nullable: true })
 	last_pin_timestamp?: Date;
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts
index f157ac39..1d18c838 100644
--- a/util/src/entities/User.ts
+++ b/util/src/entities/User.ts
@@ -16,6 +16,7 @@ export enum PublicUserEnum {
 	banner,
 	bio,
 	bot,
+	premium_since,
 }
 export type PublicUserKeys = keyof typeof PublicUserEnum;
 
@@ -110,6 +111,9 @@ export class User extends BaseClass {
 	@Column()
 	created_at: Date; // registration date
 
+	@Column({ nullable: true })
+	premium_since: Date; // premium date
+
 	@Column({ select: false })
 	verified: boolean; // if the user is offically verified
 
@@ -246,6 +250,7 @@ export class User extends BaseClass {
 			id: Snowflake.generate(),
 			bot: false,
 			system: false,
+			premium_since: new Date(),
 			desktop: false,
 			mobile: false,
 			premium: true,