From 5774c037eedba9f7c05d66f86f350a0a480f82a6 Mon Sep 17 00:00:00 2001 From: Erkin Alp Güney Date: Fri, 8 Apr 2022 10:53:05 +0300 Subject: add joined_by to allow for separate treatment of force-joiners --- util/src/entities/Member.ts | 13 +++++++++++-- 1 file 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; -- cgit 1.4.1