summary refs log tree commit diff
path: root/gateway/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 11:10:27 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 11:10:27 +1000
commit544ded68a3cd1d3bb843438f77c95a1e5eb3d941 (patch)
tree2a4e1a7bbbc43aa0563a615f026bbebd286efa5d /gateway/src
parentCommitted the wrong rights script (diff)
downloadserver-544ded68a3cd1d3bb843438f77c95a1e5eb3d941.tar.xz
Mostly working user guild settings
Diffstat (limited to 'gateway/src')
-rw-r--r--gateway/src/opcodes/Identify.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts

index d85f86a5..903934ce 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts
@@ -18,6 +18,8 @@ import { PrivateSessionProjection, MemberPrivateProjection, PresenceUpdateEvent, + DefaultUserGuildSettings, + UserGuildSettings, } from "@fosscord/util"; import { Send } from "../util/Send"; import { CLOSECODES, OPCODES } from "../util/Constants"; @@ -151,7 +153,16 @@ export async function onIdentify(this: WebSocket, data: Payload) { return guild; }); - const user_guild_settings_entries = members.map((x) => x.settings); + const user_guild_settings_entries = members.map((x) => ({ + ...DefaultUserGuildSettings, + ...x.settings, + guild_id: x.guild.id, + // disgusting + channel_overrides: Object.entries(x.settings.channel_overrides ?? {}).map(y => ({ + ...y[1], + channel_id: y[0], + })) + })) as any as UserGuildSettings[]; // VERY disgusting. don't care. const channels = recipients.map((x) => { // @ts-ignore