summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-01 19:49:54 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-01 19:49:54 +1100
commitd944dd4ef42e0991a69e912636b1d60bb0f843ee (patch)
tree988102165927a25d3860d69e52df73bc73ace085 /src
parentMerge branch 'master' into feat/refactorIdentify (diff)
downloadserver-d944dd4ef42e0991a69e912636b1d60bb0f843ee.tar.xz
allow all role props through ready
Diffstat (limited to 'src')
-rw-r--r--src/gateway/opcodes/Identify.ts16
-rw-r--r--src/util/interfaces/Event.ts1
2 files changed, 6 insertions, 11 deletions
diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts
index 6ae1f9c2..6aa152d3 100644
--- a/src/gateway/opcodes/Identify.ts
+++ b/src/gateway/opcodes/Identify.ts
@@ -249,21 +249,14 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 
 	// Generate guilds list ( make them unavailable if user is bot )
 	const guilds: GuildOrUnavailable[] = members.map((member) => {
-		// Some Discord libraries do `'blah' in object` instead of
-		// checking if the type is correct
-		member.guild.roles.forEach((role) => {
-			for (const key in role) {
-				// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-				//@ts-ignore
-				if (!role[key]) role[key] = undefined;
-			}
-		});
-
 		// filter guild channels we don't have permission to view
 		// TODO: check if this causes issues when the user is granted other roles?
 		member.guild.channels = member.guild.channels.filter((channel) => {
 			const perms = Permissions.finalPermission({
-				user: { id: member.id, roles: member.roles.map((x) => x.id) },
+				user: {
+					id: member.id,
+					roles: member.roles.map((x) => x.id),
+				},
 				guild: member.guild,
 				channel,
 			});
@@ -422,6 +415,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 			Config.get().gateway.endpointPublic ||
 			"ws://127.0.0.1:3001",
 		session_type: "normal", // TODO
+		auth_session_id_hash: "", // TODO
 
 		// lol hack whatever
 		required_action:
diff --git a/src/util/interfaces/Event.ts b/src/util/interfaces/Event.ts
index cbfa0767..21c34c6c 100644
--- a/src/util/interfaces/Event.ts
+++ b/src/util/interfaces/Event.ts
@@ -121,6 +121,7 @@ export interface ReadyEventData {
 	tutorial: number | null;
 	resume_gateway_url: string;
 	session_type: string;
+	auth_session_id_hash: string;
 	required_action?:
 		| "REQUIRE_VERIFIED_EMAIL"
 		| "REQUIRE_VERIFIED_PHONE"