summary refs log tree commit diff
path: root/src/gateway/opcodes
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/gateway/opcodes
parentMerge branch 'master' into feat/refactorIdentify (diff)
downloadserver-d944dd4ef42e0991a69e912636b1d60bb0f843ee.tar.xz
allow all role props through ready
Diffstat (limited to 'src/gateway/opcodes')
-rw-r--r--src/gateway/opcodes/Identify.ts16
1 files changed, 5 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: