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

Don't send private user data in ready event

This commit is contained in:
Madeline 2023-01-05 17:40:46 +11:00
parent e54912a726
commit 9cc9df985c

View File

@ -175,10 +175,11 @@ export async function onIdentify(this: WebSocket, data: Payload) {
})) as any as UserGuildSettings[]; })) as any as UserGuildSettings[];
const channels = recipients.map((x) => { const channels = recipients.map((x) => {
// @ts-ignore
x.channel.recipients = x.channel.recipients?.map((x) => x.user);
//TODO is this needed? check if users in group dm that are not friends are sent in the READY event //TODO is this needed? check if users in group dm that are not friends are sent in the READY event
users = users.concat(x.channel.recipients as unknown as User[]); users = users.concat(
x.channel.recipients?.map((x) => x.user.toPublicUser()) || [],
);
// users = users.concat(x.channel.recipients);
if (x.channel.isDm()) { if (x.channel.isDm()) {
x.channel.recipients = x.channel.recipients!.filter( x.channel.recipients = x.channel.recipients!.filter(
(x) => x.id !== this.user_id, (x) => x.id !== this.user_id,