summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-31 12:16:15 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-31 12:16:15 +1100
commit1cacd4413a2129c054b71fed1bb989cecbd7b591 (patch)
tree1e58ec174674974ed911cc7dd149627b410be546 /src
parentSentry stuff? (diff)
downloadserver-1cacd4413a2129c054b71fed1bb989cecbd7b591.tar.xz
Add `private_channels_version` to `client_state` in identity. also set sentry user in gateway
Diffstat (limited to 'src')
-rw-r--r--src/gateway/events/Message.ts7
-rw-r--r--src/gateway/opcodes/VoiceStateUpdate.ts6
-rw-r--r--src/util/schemas/IdentifySchema.ts2
3 files changed, 13 insertions, 2 deletions
diff --git a/src/gateway/events/Message.ts b/src/gateway/events/Message.ts
index 4ed715b2..204f0025 100644
--- a/src/gateway/events/Message.ts
+++ b/src/gateway/events/Message.ts
@@ -53,11 +53,16 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
 
 	try {
 		var ret = await OPCodeHandler.call(this, data);
-		transaction?.finish();
+		Sentry.withScope((scope) => {
+			scope.setSpan(transaction);
+			scope.setUser({ id: this.user_id });
+			transaction?.finish();
+		});
 		return ret;
 	} catch (error) {
 		Sentry.withScope((scope) => {
 			scope.setSpan(transaction);
+			if (this.user_id) scope.setUser({ id: this.user_id });
 			Sentry.captureException(error);
 		});
 		transaction?.finish();
diff --git a/src/gateway/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts
index 17ed7e4f..daefc504 100644
--- a/src/gateway/opcodes/VoiceStateUpdate.ts
+++ b/src/gateway/opcodes/VoiceStateUpdate.ts
@@ -12,8 +12,12 @@ import {
 	VoiceStateUpdateEvent,
 	VoiceStateUpdateSchema,
 } from "@fosscord/util";
+
 // TODO: check if a voice server is setup
-// Notice: Bot users respect the voice channel's user limit, if set. When the voice channel is full, you will not receive the Voice State Update or Voice Server Update events in response to your own Voice State Update. Having MANAGE_CHANNELS permission bypasses this limit and allows you to join regardless of the channel being full or not.
+
+// Notice: Bot users respect the voice channel's user limit, if set.
+// When the voice channel is full, you will not receive the Voice State Update or Voice Server Update events in response to your own Voice State Update.
+// Having MANAGE_CHANNELS permission bypasses this limit and allows you to join regardless of the channel being full or not.
 
 export async function onVoiceStateUpdate(this: WebSocket, data: Payload) {
 	check.call(this, VoiceStateUpdateSchema, data.d);
diff --git a/src/util/schemas/IdentifySchema.ts b/src/util/schemas/IdentifySchema.ts
index 409a03da..848ea0a6 100644
--- a/src/util/schemas/IdentifySchema.ts
+++ b/src/util/schemas/IdentifySchema.ts
@@ -43,6 +43,7 @@ export const IdentifySchema = {
 		$user_guild_settings_version: Number,
 		$user_settings_version: undefined,
 		$useruser_guild_settings_version: undefined,
+		$private_channels_version: Number,
 	},
 	$clientState: {
 		$guildHashes: Object,
@@ -94,6 +95,7 @@ export interface IdentifySchema {
 		user_guild_settings_version?: number;
 		user_settings_version?: number;
 		useruser_guild_settings_version?: number;
+		private_channels_version?: number;
 	};
 	clientState?: {
 		guildHashes?: any;