summary refs log tree commit diff
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-08 10:53:05 +0300
committerGitHub <noreply@github.com>2022-04-08 10:53:05 +0300
commit5774c037eedba9f7c05d66f86f350a0a480f82a6 (patch)
tree589931533516c458c2343e7bfd0c3453a3e16637
parentfix the build mistakes from yesternight (diff)
downloadserver-5774c037eedba9f7c05d66f86f350a0a480f82a6.tar.xz
add joined_by to allow for separate treatment of force-joiners
-rw-r--r--util/src/entities/Member.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index a246b891..ae889a85 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -70,7 +70,7 @@ export class Member extends BaseClassWithoutId {
 
 	@Column({ nullable: true })
 	nick?: string;
-
+	
 	@JoinTable({
 		name: "member_roles",
 		joinColumn: { name: "index", referencedColumnName: "index" },
@@ -102,8 +102,17 @@ export class Member extends BaseClassWithoutId {
 
 	@Column({ nullable: true })
 	last_message_id?: string;
+	
+	/**
+	@JoinColumn({ name: "id" })
+	@ManyToOne(() => User, {
+		onDelete: "DO NOTHING",
+	// do not auto-kick force-joined members just because their joiners left the server
+	}) **/
+	@Column({ nullable: true })
+	joined_by: string;
 
-	// TODO: update
+	// TODO: add this when we have proper read receipts
 	// @Column({ type: "simple-json" })
 	// read_state: ReadState;