summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-10 21:58:13 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-10 22:01:13 +1000
commit19c7dfacc5835a8a11dd27b99a663fa87a2c4b5b (patch)
tree2a880a1e4c16cd2cabba108830a56ba6b0bbb41e
parentMerge branch 'feat/mobile' into slowcord (diff)
parentSet client_state.highest_last_message_id to String OR Number (diff)
downloadserver-19c7dfacc5835a8a11dd27b99a663fa87a2c4b5b.tar.xz
Merge branch 'feat/mobile' into slowcord
-rw-r--r--gateway/src/opcodes/Identify.ts2
-rw-r--r--gateway/src/schema/Identify.ts4
2 files changed, 4 insertions, 2 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts
index 860000da..301f714d 100644
--- a/gateway/src/opcodes/Identify.ts
+++ b/gateway/src/opcodes/Identify.ts
@@ -35,6 +35,8 @@ import { Recipient } from "@fosscord/util";
 
 export async function onIdentify(this: WebSocket, data: Payload) {
 	clearTimeout(this.readyTimeout);
+	if (typeof data.d?.client_state?.highest_last_message_id === "number") 
+		data.d.client_state.highest_last_message_id += "";
 	check.call(this, IdentifySchema, data.d);
 
 	const identify: IdentifySchema = data.d;
diff --git a/gateway/src/schema/Identify.ts b/gateway/src/schema/Identify.ts
index 6a6593c1..6aa93ce7 100644
--- a/gateway/src/schema/Identify.ts
+++ b/gateway/src/schema/Identify.ts
@@ -38,7 +38,7 @@ export const IdentifySchema = {
 	$capabilities: Number,
 	$client_state: {
 		$guild_hashes: Object,
-		$highest_last_message_id: String,
+		$highest_last_message_id: String || Number,
 		$read_state_version: Number,
 		$user_guild_settings_version: Number,
 		$user_settings_version: undefined,
@@ -81,7 +81,7 @@ export interface IdentifySchema {
 	capabilities?: number;
 	client_state?: {
 		guild_hashes?: any;
-		highest_last_message_id?: string;
+		highest_last_message_id?: string | number;
 		read_state_version?: number;
 		user_guild_settings_version?: number;
 		user_settings_version?: number;