summary refs log tree commit diff
path: root/util/src/entities/Member.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 11:10:27 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 11:10:27 +1000
commit1f4f6c555f49c94ac29b00ba069203553b12a611 (patch)
tree46b86c70b1bf6f764725f011f8041746fdac4cf8 /util/src/entities/Member.ts
parentCommitted the wrong rights script (diff)
downloadserver-1f4f6c555f49c94ac29b00ba069203553b12a611.tar.xz
Mostly working user guild settings
Diffstat (limited to 'util/src/entities/Member.ts')
-rw-r--r--util/src/entities/Member.ts46
1 files changed, 39 insertions, 7 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index c2bc65c4..03698453 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -80,7 +80,7 @@ export class Member extends BaseClassWithoutId {
 			val = val.split("\t").join("");
 			if (BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
 		}
-		
+
 		this.nick = val;
 	}
 
@@ -339,20 +339,52 @@ export class Member extends BaseClassWithoutId {
 	}
 }
 
+export interface ChannelOverride {
+	message_notifications: number;
+	mute_config: MuteConfig;
+	muted: boolean;
+	channel_id: string | null;
+}
+
 export interface UserGuildSettings {
+	// channel_overrides: {
+	// 	channel_id: string;
+	// 	message_notifications: number;
+	// 	mute_config: MuteConfig;
+	// 	muted: boolean;
+	// }[];
+
 	channel_overrides: {
-		channel_id: string;
-		message_notifications: number;
-		mute_config: MuteConfig;
-		muted: boolean;
-	}[];
+		[channel_id: string]: ChannelOverride;
+	} | null,
 	message_notifications: number;
 	mobile_push: boolean;
-	mute_config: MuteConfig;
+	mute_config: MuteConfig | null;
 	muted: boolean;
 	suppress_everyone: boolean;
 	suppress_roles: boolean;
 	version: number;
+	guild_id: string | null;
+	flags: number;
+	mute_scheduled_events: boolean;
+	hide_muted_channels: boolean;
+	notify_highlights: 0;
+}
+
+export const DefaultUserGuildSettings: UserGuildSettings = {
+	channel_overrides: null,
+	message_notifications: 1,
+	flags: 0,
+	hide_muted_channels: false,
+	mobile_push: true,
+	mute_config: null,
+	mute_scheduled_events: false,
+	muted: false,
+	notify_highlights: 0,
+	suppress_everyone: false,
+	suppress_roles: false,
+	version: 453,	// ?
+	guild_id: null,
 }
 
 export interface MuteConfig {