1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

send empty READY_SUPPLEMENTAL for client compatibility

This commit is contained in:
Madeline 2023-07-31 19:42:27 +10:00
parent a0d93fb252
commit 4c0b1391b1
No known key found for this signature in database
GPG Key ID: 80D25DA3BCB24281
2 changed files with 21 additions and 1 deletions

View File

@ -53,6 +53,7 @@ import {
DMChannel,
GuildOrUnavailable,
Recipient,
OPCodes,
} from "@spacebar/util";
import { check } from "./instanceOf";
@ -441,7 +442,25 @@ export async function onIdentify(this: WebSocket, data: Payload) {
),
);
//TODO send READY_SUPPLEMENTAL
// TODO: ready supplemental
await Send(this, {
op: OPCodes.DISPATCH,
t: EVENTEnum.ReadySupplemental,
s: this.sequence++,
d: {
merged_presences: {
guilds: [],
friends: [],
},
// these merged members seem to be all users currently in vc in your guilds
merged_members: [],
lazy_private_channels: [],
guilds: [], // { voice_states: [], id: string, embedded_activities: [] }
// embedded_activities are users currently in an activity?
disclose: ["pomelo"],
},
});
//TODO send GUILD_MEMBER_LIST_UPDATE
//TODO send VOICE_STATE_UPDATE to let the client know if another device is already connected to a voice channel

View File

@ -583,6 +583,7 @@ export type EventData =
export enum EVENTEnum {
Ready = "READY",
ReadySupplemental = "READY_SUPPLEMENTAL",
ChannelCreate = "CHANNEL_CREATE",
ChannelUpdate = "CHANNEL_UPDATE",
ChannelDelete = "CHANNEL_DELETE",